Skip to content

Commit 342c14d

Browse files
committed
Merge branch 'jc/unexport-git-pager-in-use-in-pager' into maint
When you say "!<ENTER>" while running say "git log", you'd confuse yourself in the resulting shell, that may look as if you took control back to the original shell you spawned "git log" from but that isn't what is happening. To that new shell, we leaked GIT_PAGER_IN_USE environment variable that was meant as a local communication between the original "Git" and subprocesses that was spawned by it after we launched the pager, which caused many "interesting" things to happen, e.g. "git diff | cat" still paints its output in color by default. Stop leaking that environment variable to the pager's half of the fork; we only need it on "Git" side when we spawn the pager. * jc/unexport-git-pager-in-use-in-pager: pager: do not leak "GIT_PAGER_IN_USE" to the pager
2 parents 3b175fb + 124b519 commit 342c14d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

pager.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ void setup_pager(void)
7878
argv_array_push(&pager_process.env_array, "LESS=FRX");
7979
if (!getenv("LV"))
8080
argv_array_push(&pager_process.env_array, "LV=-c");
81+
argv_array_push(&pager_process.env_array, "GIT_PAGER_IN_USE");
8182
if (start_command(&pager_process))
8283
return;
8384

0 commit comments

Comments
 (0)