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

git commands empty output #54

Closed
vguerci opened this issue Mar 18, 2012 · 8 comments
Closed

git commands empty output #54

vguerci opened this issue Mar 18, 2012 · 8 comments
Labels

Comments

@vguerci
Copy link
Contributor

vguerci commented Mar 18, 2012

Hi,

Since yesterday I've noticed that some git commands like git diff, git stash list was not returning anything.
Searched for a while to identify that the 34a5743 commit related to #35 was causing this. (-X removal)

Any ideas?

@sorin-ionescu
Copy link
Owner

I knew that there was more to -X before committing that. I just could not remember what it was.

So, having that switch breaks scrolling; not having that switch breaks Git and everything else that has similar pager behaviour.

There is another switch -F that tells less to exit if the content fits on one screen. It's annoying to have to manually quit less after an often 2-line Git output.

We either have to add -X or remove -F, neither of which is desirable.

I do not want a less configuration, a man pager configuration, a git pager configuration, etc. because there is no end in sight.

@giddie might just have to search man pages instead of scrolling.

@vguerci
Copy link
Contributor Author

vguerci commented Mar 18, 2012

Maybe that will help, from man git-config:

core.pager
    The command that git will use to paginate output. Can be overridden with the GIT_PAGER
    environment variable. Note that git sets the LESS environment variable to FRSX if it is unset
    when it runs the pager. One can change these settings by setting the LESS variable to some
    other value. Alternately, these settings can be overridden on a project or global basis by
    setting the core.pager option. Setting core.pager has no affect on the LESS environment
    variable behaviour above, so if you want to override git's default settings this way, you need
    to be explicit. For example, to disable the S option in a backward compatible manner, set
    core.pager to less -+$LESS -FRX. This will be passed to the shell by git, which will translate
    the final command to LESS=FRSX less -+FRSX -FRX.

@sorin-ionescu
Copy link
Owner

I know, but it will not set FRSX if LESS is defined.

@vguerci
Copy link
Contributor Author

vguerci commented Mar 19, 2012

I've read that as well, as I've also read that you do not want several pagers configuration.
But if git is the only one having this paging behavior that could be a solution for everyone:

export LESS='-F -g -i -M -R -S -w -z-4'
export GIT_PAGER="less $LESS -X"

Once again, I've read you're against this.
Just my 2 cents, not really 2 separate configurations, one extending the other.

@sorin-ionescu
Copy link
Owner

svn, mecurial, bazaar, and so many other programs need a pager.

@sorin-ionescu
Copy link
Owner

Does @giddie not use Git?

@giddie
Copy link
Contributor

giddie commented Mar 19, 2012

Yes, I do. I have the following in my ~/.gitconfig:

[core]
  pager = LESS="RS" less

I remember this being an issue for me at one time, and that's the solution I came up with. I don't remember clearly how I came to this solution, but it looks like this just clobbers any existing LESS options, so git basically has its own paging options. I seem to recall that I had a similar toss-up between the mousewheel working and the pager sometimes getting in the way. Personally, I'd rather have a working mousewheel.

@sorin-ionescu
Copy link
Owner

You just disabled FX. I would rather not force every Git user in existence to mess with his pager options. This has to be fixed in OMZ.

lildude pushed a commit to lildude/prezto that referenced this issue Jan 12, 2014
mjwestcott added a commit to mjwestcott/prezto that referenced this issue Mar 18, 2017
* 'master' of https://github.com/zsh-users/prezto: (53 commits)
  Allow setting ZPREZTODIR to make prezto easier to integrate with (sorin-ionescu#54)
  documenting PR approval process defined in sorin-ionescu#41 (sorin-ionescu#45)
  Revert "Restore the parser status to PS2"
  Fix typos and link usernames
  Clearly define who are the project leaders (sorin-ionescu#26)
  Restore the parser status to PS2
  Revert "resolve race condition between git completion and coalesce function"
  Fix links in README
  Do not call `editor-info` in `zle-line-finish`
  Bump license years and tidy up readme
  Provide upgrade instructions + link to new fork
  ssh: update ps|grep ssh-agent check
  Don't load pfunctions from vi swap files
  Add module 'encode64' from oh-my-zsh (renamed to 'base64')
  Add module 'fancy-ctrl-z' from oh-my-zsh
  Update all submodules
  Discover and reuse existing ssh-agent if possible
  added maven plugin from oh-my-zsh
  Add basic set of aliases for npm
  Revert "use non breaking space" see sorin-ionescu#14
  ...
jetm pushed a commit to jetm/prezto that referenced this issue Mar 23, 2017
…in-ionescu#54)

* Allow setting ZPREZTODIR to make prezto easier to integrate with

* Set ZPREZTODIR to ${0:h}
RIT80 pushed a commit to RIT80/prezto that referenced this issue Jan 25, 2022
RIT80 added a commit to RIT80/prezto that referenced this issue Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants