Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add no-pager option to git branch #2637

Merged
merged 1 commit into from
Oct 23, 2021
Merged

Add no-pager option to git branch #2637

merged 1 commit into from
Oct 23, 2021

Conversation

nix6839
Copy link
Contributor

@nix6839 nix6839 commented Oct 23, 2021

To use install.sh in an automated script when there is no no-pager option, the user must press q directly. It's so terrible.

@ljharb
Copy link
Member

ljharb commented Oct 23, 2021

Can you elaborate on the problem you’re seeing?

Adding this argument seems fine, but hundreds of thousands of people, including me, have used the install script and not had to press a key to complete it.

@ljharb ljharb added the installing nvm Problems installing nvm itself label Oct 23, 2021
@nix6839
Copy link
Contributor Author

nix6839 commented Oct 23, 2021

While running the installation script, the following screen displayed and I must press q to continue the installation.

# Install nvm
curl -o- 'https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh' | bash

# Displayed during installation.
* (HEAD detached at FETCH_HEAD)
  master
(END)

The following is information about installation environment

echo $SHELL
/bin/zsh

$SHELL --version
zsh 5.8 (x86_64-pc-linux-gnu)

git --version
git version 2.33.1

Thank you

@ljharb
Copy link
Member

ljharb commented Oct 23, 2021

What else is in that script before the curl? How do you run the script? Do you have any git config related to a pager?

@nix6839
Copy link
Contributor Author

nix6839 commented Oct 23, 2021

Run as follow

chmod +x ./test.sh
./test.sh

test.sh content

#!/bin/sh

echo asdf
curl -o- 'https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh' | bash

You can see my other script in: https://github.com/nix6839/dotfiles/blob/master/resource/run_once_script/install/node.sh (See https://raw.githubusercontent.com/nix6839/nvm/no-pager/install.sh as https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh)

Thank you

@ljharb
Copy link
Member

ljharb commented Oct 23, 2021

That all seems simple enough. What about your git config?

@nix6839
Copy link
Contributor Author

nix6839 commented Oct 23, 2021

[user]
    user.name = b
    user.email = b
    user.signingkey = b
[commit]
    gpgsign = true
[pull]
    rebase = false

However, if I run rm ~/.config/git/config and git config --list is empty, it still works the same.

Thank you

@ljharb
Copy link
Member

ljharb commented Oct 23, 2021

One more question :-) what's echo $PAGER say?

Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a few other git branch commands; they should presumably all have it?

Does git v1.7.10 have --no-pager?

@nix6839
Copy link
Contributor Author

nix6839 commented Oct 23, 2021

echo $PAGER says less, but if i run unset PAGER, it still works the same.

The other git branch commands are probably not needed.

git v1.7.10 has --no-pager
You can check that here: https://github.com/git/git/blob/v1.7.10/Documentation/git.txt#L14

Thank you

@ljharb
Copy link
Member

ljharb commented Oct 23, 2021

Let's update the PR to add --no-pager to all the git branch commands, just in case.

@nix6839
Copy link
Contributor Author

nix6839 commented Oct 23, 2021

Okay everything is done.

@ljharb ljharb merged commit c9e7bb2 into nvm-sh:master Oct 23, 2021
@nix6839
Copy link
Contributor Author

nix6839 commented Oct 23, 2021

Thank you for your hard work.

@nix6839 nix6839 deleted the no-pager branch January 21, 2022 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installing nvm Problems installing nvm itself
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants