How to fix git log output (missing lines in less)?

I have two different servers each running a Ubuntu installation. On both of them, I have set env LESS=-FerX which makes sure that git log output is displayed nicely. Also, line wrapping is turned on.

On one of the servers, if I run git log and there are dynamically-wrapped lines, the topmost lines disappear.

  • Maven prevent build if there is uncommitted changes
  • Bundler: always use latest revision of git branch in Gemfile
  • Keeping a branch up to date with master
  • Ignore specific changes to a file in git, but not the entire file
  • How to I remove files from .gitignore?
  • Cygwin and TortoiseGit
  • For example:

    log --pretty='format:%C(3)[%h] %Cgreen%an%Creset%n %cd %s %Cred%d%Creset' --graph
    

    Output on Server 1:

    * [1234457] John Doe
    | Date fooooo bar baz fooooo bar baz fooooo bar baz fooooo bar baz fooooo bar baz
    fooooo bar baz fooooo bar baz fooooo bar baz fooooo bar baz fooooo bar baz fooooo
    bar baz
    * [4567890] Richard Miles
    | Date fooooo bar baz
    :
    

    Output on Server 2:

    fooooo bar baz fooooo bar baz fooooo bar baz fooooo bar baz fooooo bar baz fooooo
    bar baz
    * [4567890] Richard Miles
    | Date fooooo bar baz
    * [0815123] Mary Major
    | Date fooooo bar baz fooooo bar baz fooooo bar baz
    :
    

    Any idea how to fix this?

  • Reset remote tracked branch
  • How do I remove a working copy created via git-new-workdir without hosing the original repo?
  • Git updating a stale local repo
  • Bug tracker setup with Git integration?
  • Findbugs for Git Pull Request
  • gitolite or gitosis: permission on directory inside of the repository
  • 2 Solutions collect form web for “How to fix git log output (missing lines in less)?”

    Again, I find the answer to my own question only minutes after asking.

    Turns out the problem was the -r parameter to less. It should have been a -R instead.

    From the manpage:

    -R or --RAW-CONTROL-CHARS
              Like  -r,  but  only ANSI "color" escape sequences are output in "raw" form.
              Unlike -r, the screen appearance is  maintained  correctly  in  most  cases.
    

    For some reson not known to me, the lower-case -r works fine on of the other server.

    Perhaps you know this, and you might have tried it, but since you don’t mention it:

    man git config contains (emphasis mine):

    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.

    Git Baby is a git and github fan, let's start git clone.