git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] fix "v"iew subcommand in "git am -i"
@ 2016-02-16 23:06 Junio C Hamano
  2016-02-16 23:06 ` [PATCH 1/3] pager: lose a separate argv[] Junio C Hamano
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Junio C Hamano @ 2016-02-16 23:06 UTC (permalink / raw)
  To: git; +Cc: Paul Tan

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 bug is understandable, because there are things we need to do
other than just run_command() to run the pager, such as running it
with default LESS/LV settings and running it via the shell, but
these pieces of necessary knowledge about what is the right thing to
do are hoarded by the setup_pager() entry point, which is only good
if we are feeding our own standard output to the pager.  A codepath
that wants to run the pager but not on our output needs to do the
right thing on its own.

So the first patch in this series factors out a helper function to
let the caller run the pager the right way.  They make the third
patch to fix the breakage in "am" trivial.

I debated myself where the call of git_pager() should go (it could
be argued that it conceptually belongs to the new prepare_pager_args()
helper), but I opted for a simpler change.

Junio C Hamano (3):
  pager: lose a separate argv[]
  pager: factor out a helper to prepare a child process to run the pager
  am -i: fix "v"iew

 builtin/am.c |  5 +++--
 cache.h      |  4 ++++
 pager.c      | 26 ++++++++++++++++++--------
 3 files changed, 25 insertions(+), 10 deletions(-)

-- 
2.7.1-460-gd45d0a4

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-02-17 19:19 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-16 23:06 [PATCH 0/3] fix "v"iew subcommand in "git am -i" Junio C Hamano
2016-02-16 23:06 ` [PATCH 1/3] pager: lose a separate argv[] Junio C Hamano
2016-02-16 23:06 ` [PATCH 2/3] pager: factor out a helper to prepare a child process to run the pager Junio C Hamano
2016-02-16 23:26   ` Jeff King
2016-02-16 23:49     ` Junio C Hamano
2016-02-17  0:32       ` Jeff King
2016-02-16 23:06 ` [PATCH 3/3] am -i: fix "v"iew Junio C Hamano
2016-02-17 19:15 ` [PATCH v2 0/3] fix "v"iew subcommand in "git am -i" Junio C Hamano
2016-02-17 19:15   ` [PATCH v2 1/3] pager: lose a separate argv[] Junio C Hamano
2016-02-17 19:15   ` [PATCH v2 2/3] pager: factor out a helper to prepare a child process to run the pager Junio C Hamano
2016-02-17 19:15   ` [PATCH v2 3/3] am -i: fix "v"iew Junio C Hamano
2016-02-17 19:19   ` [PATCH v2 0/3] fix "v"iew subcommand in "git am -i" Jeff King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).