Skip to content

git log or git show does not work when setting pager.<cmd> in version 2.11.0(2) or later #1077

Closed
@hattya

Description

@hattya
  • I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options
git version 2.11.0.windows.1
sizeof-long: 4
machine: x86_64
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver

Microsoft Windows [Version 10.0.14393]

Details

$ git config --global pager.diff 'diff-highlight | less'
$ git config --global pager.log 'diff-highlight | less'
$ git config --global pager.show 'diff-highlight | less'
$ git diff
$ git log
diff-highlight | less: No such file or directory
$ git show
diff-highlight | less: No such file or directory

The issue is introduced in commit 382b41b, and it seems that it is appeared by commit a9b8a09.

Following patch fixes the issue:

--- a/git.c
+++ b/git.c
@@ -633,10 +633,10 @@ static int run_argv(int *argcp, const char ***argv)
                                argv_array_push(&args, (*argv)[i]);

                        if (get_super_prefix())
-                               die("%s doesn't support --super-prefix", args.argv[0]);
+                               die("%s doesn't support --super-prefix", args.argv[1]);

                        if (use_pager == -1)
-                               use_pager = check_pager_config(args.argv[0]);
+                               use_pager = check_pager_config(args.argv[1]);
                        commit_pager_choice();

                        trace_argv_printf(args.argv, "trace: exec:");

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions