git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v5 04/12] Stop starting pager recursively

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
Feb 4, 2012, 15:59 UTC
Message-ID
<1328371156-4009-5-git-send-email-pclouds@gmail.com>
In-Reply-To
<1328371156-4009-1-git-send-email-pclouds@gmail.com>

git-column can be used as a pager for other git commands, something like this:

    GIT_PAGER="git -p column --mode='dense color'" git -p branch

The problem with this is that "git -p column" also has $GIT_PAGER set so the pager runs itself again as a pager, then again and again.

Stop this.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 pager.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pager.c b/pager.c
index 772a5a6..e4353dc 100644
--- a/pager.c
+++ b/pager.c
@@ -89,7 +89,7 @@ void setup_pager(void)
 	const char *pager = git_pager(isatty(1));
 	int width;
 
-	if (!pager)
+	if (!pager || pager_in_use())
 		return;
 
 	setenv("GIT_PAGER_IN_USE", "true", 1);
-- 
1.7.8.36.g69ee2
Previous: Nguyễn Thái Ngọc DuyNext: Nguyễn Thái Ngọc Duy
Message 32 of 43 in “Column display again”
  1. 00/13 Column display againNguyễn Thái Ngọc Duy, Feb 3, 2012
  2. 01/13 Save terminal width before setting up pagerNguyễn Thái Ngọc Duy, Feb 3, 2012
  3. 02/13 column: add API to print items in columnsNguyễn Thái Ngọc Duy, Feb 3, 2012
  4. Junio C HamanoFeb 3, 2012
  5. Junio C HamanoFeb 3, 2012
  6. 03/13 parseopt: make OPT_INTEGER support hexadecimal as wellNguyễn Thái Ngọc Duy, Feb 3, 2012
  7. Junio C HamanoFeb 3, 2012
  8. Nguyen Thai Ngoc DuyFeb 4, 2012
  9. Junio C HamanoFeb 4, 2012
  10. Nguyen Thai Ngoc DuyFeb 4, 2012
  11. 04/13 Add git-column and column mode parsingNguyễn Thái Ngọc Duy, Feb 3, 2012
  12. 05/13 Stop starting pager recursivelyNguyễn Thái Ngọc Duy, Feb 3, 2012
  13. 06/13 column: add columnar layoutNguyễn Thái Ngọc Duy, Feb 3, 2012
  14. 07/13 column: support columns with different widthsNguyễn Thái Ngọc Duy, Feb 3, 2012
  15. 08/13 column: add column.ui for default column output settingsNguyễn Thái Ngọc Duy, Feb 3, 2012
  16. Junio C HamanoFeb 3, 2012
  17. 09/13 help: reuse print_columns() for help -aNguyễn Thái Ngọc Duy, Feb 3, 2012
  18. Junio C HamanoFeb 3, 2012
  19. 10/13 branch: add --columnNguyễn Thái Ngọc Duy, Feb 3, 2012
  20. Junio C HamanoFeb 3, 2012
  21. Nguyen Thai Ngoc DuyFeb 4, 2012
  22. 11/13 status: add --columnNguyễn Thái Ngọc Duy, Feb 3, 2012
  23. Junio C HamanoFeb 3, 2012
  24. 12/13 column: support piping stdout to external git-column processNguyễn Thái Ngọc Duy, Feb 3, 2012
  25. 13/13 tag: add --columnNguyễn Thái Ngọc Duy, Feb 3, 2012
  26. Junio C HamanoFeb 3, 2012
  27. 00/12 Column displayNguyễn Thái Ngọc Duy, Feb 4, 2012
  28. 01/12 Save terminal width before setting up pagerNguyễn Thái Ngọc Duy, Feb 4, 2012
  29. 02/12 column: add API to print items in columnsNguyễn Thái Ngọc Duy, Feb 4, 2012
  30. 03/12 Add git-column and column mode parsingNguyễn Thái Ngọc Duy, Feb 4, 2012
  31. 03/12 Add git-column and column mode parsingNguyễn Thái Ngọc Duy, Feb 4, 2012
  32. 04/12 Stop starting pager recursivelyNguyễn Thái Ngọc Duy, Feb 4, 2012
  33. 05/12 column: add columnar layoutNguyễn Thái Ngọc Duy, Feb 4, 2012
  34. 06/12 column: support columns with different widthsNguyễn Thái Ngọc Duy, Feb 4, 2012
  35. 07/12 column: add column.ui for default column output settingsNguyễn Thái Ngọc Duy, Feb 4, 2012
  36. 07/12 column: add column.ui for default column output settingsNguyễn Thái Ngọc Duy, Feb 4, 2012
  37. 08/12 help: reuse print_columns() for help -aNguyễn Thái Ngọc Duy, Feb 4, 2012
  38. 09/12 branch: add --columnNguyễn Thái Ngọc Duy, Feb 4, 2012
  39. Junio C HamanoFeb 6, 2012
  40. 10/12 status: add --columnNguyễn Thái Ngọc Duy, Feb 4, 2012
  41. 11/12 column: support piping stdout to external git-column processNguyễn Thái Ngọc Duy, Feb 4, 2012
  42. 12/12 tag: add --columnNguyễn Thái Ngọc Duy, Feb 4, 2012
  43. Junio C HamanoFeb 6, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.