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

[PATCH v2 3/3] am -i: fix "v"iew

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 17, 2016, 19:15 UTC
Message-ID
<1455736516-13466-4-git-send-email-gitster@pobox.com>
In-Reply-To
<1455736516-13466-1-git-send-email-gitster@pobox.com>

The 'v'iew subcommand of the interactive mode of "git am -i" was broken by the rewrite to C we did at around 2.6.0 timeframe at 7ff26832 (builtin-am: implement -i/--interactive, 2015-08-04); we used to spawn the pager via the shell, accepting things like

	PAGER='less -S'

in the environment, but the rewrite forgot and tried to directly spawn a command whose name is the entire string.

The previous refactoring of the new helper function makes it easier for us to do the right thing.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 * Essentially the same as v1, modulo adjustment for the change in 2/3
 builtin/am.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/am.c b/builtin/am.c
index 1399c8d..56cf26e 100644
--- a/builtin/am.c
+++ b/builtin/am.c
@@ -1740,7 +1740,7 @@ static int do_interactive(struct am_state *state)
 
 			if (!pager)
 				pager = "cat";
-			argv_array_push(&cp.args, pager);
+			prepare_pager_args(&cp, pager);
 			argv_array_push(&cp.args, am_path(state, "patch"));
 			run_command(&cp);
 		}
-- 
2.7.1-489-g20b2cbe
Previous: Junio C HamanoNext: Jeff King
Message 11 of 12 in “fix "v"iew subcommand in "git am -i"”
  1. 0/3 fix "v"iew subcommand in "git am -i"Junio C Hamano, Feb 16, 2016
  2. 1/3 pager: lose a separate argv[]Junio C Hamano, Feb 16, 2016
  3. 2/3 pager: factor out a helper to prepare a child process to run the pagerJunio C Hamano, Feb 16, 2016
  4. Jeff KingFeb 16, 2016
  5. Junio C HamanoFeb 16, 2016
  6. Jeff KingFeb 17, 2016
  7. 3/3 am -i: fix "v"iewJunio C Hamano, Feb 16, 2016
  8. 0/3 fix "v"iew subcommand in "git am -i"Junio C Hamano, Feb 17, 2016
  9. 1/3 pager: lose a separate argv[]Junio C Hamano, Feb 17, 2016
  10. 2/3 pager: factor out a helper to prepare a child process to run the pagerJunio C Hamano, Feb 17, 2016
  11. 3/3 am -i: fix "v"iewJunio C Hamano, Feb 17, 2016
  12. Jeff KingFeb 17, 2016

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.