All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] use the pager in 'add -p'
@ 2024-07-12  0:57 Rubén Justo
  2024-07-12  1:00 ` [PATCH 1/4] add-patch: test for 'p' command Rubén Justo
                   ` (5 more replies)
  0 siblings, 6 replies; 70+ messages in thread
From: Rubén Justo @ 2024-07-12  0:57 UTC (permalink / raw)
  To: Git List; +Cc: Junio C Hamano, Dragan Simic, Jeff King, Phillip Wood

I'm resuming work on introducing a mechanism to use the PAGER to display
hunks during interactive "git add -p" sessions, which will make it
easier to review large hunks.

The thread where the previous discussion took place is:
https://lore.kernel.org/git/1d0cb55c-5f32-419a-b593-d5f0969a51fd@gmail.com/

I'm bringing back the proposal to introduce 'P' as a mechanism to
display the current hunks through the PAGER.

I think it's sensible to exclude from the scope of this series the
option of a new command '|[cmd]' and other modifications to the original
proposal that have raised questions that perhaps deserve their own
discussion, outside the scope of this series.  Questions like:

   - What to do with ANSI codes?
   - How to allow the definition of a default command?
   - How to facilitate the reuse of a command?
   - How to combine a default command with command reuse?
   - What to do if the command fails?

To mention a few...

I'm also leaving for a future series a possible configuration
"interactive.pipeCommand", "interactive.pager" or similar.

I hope this approach makes sense and allows us to move forward, and that
it doesn't represent a step back.

Thanks.

Rubén Justo (4):
  add-patch: test for 'p' command
  pager: do not close fd 2 unnecessarily
  pager: introduce wait_for_pager
  add-patch: render hunks through the pager

 add-patch.c                | 18 ++++++++++--
 pager.c                    | 45 ++++++++++++++++++++++++----
 pager.h                    |  1 +
 t/t3701-add-interactive.sh | 60 ++++++++++++++++++++++++++++++++++++++
 4 files changed, 116 insertions(+), 8 deletions(-)

-- 
2.45.1

^ permalink raw reply	[flat|nested] 70+ messages in thread
* [PATCH v2 0/2] add-p P fixups
@ 2024-07-23  0:39 Rubén Justo
  2024-07-23  9:15 ` Phillip Wood
  0 siblings, 1 reply; 70+ messages in thread
From: Rubén Justo @ 2024-07-23  0:39 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Git List

Rubén Justo (1):
  t3701: avoid one-shot export for shell functions
  pager: make wait_for_pager a no-op for "cat"

 pager.c                    | 3 +++
 t/t3701-add-interactive.sh | 6 +++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

Range-diff against v1:
1:  c3b8ebbae7 ! 1:  15fbf82fff t3701: avoid one-shot export for shell functions
    @@ Commit message
     
             VAR=VAL command args
     
    -    it's a common way to define one-shot variables within the scope of
    +    is a common way to set and export one-shot variables within the scope of
         executing a "command".
     
         However, when "command" is a function which in turn executes the
    @@ Commit message
             $ A=1 f
             A=
     
    +    Note that POSIX is not specific about this behavior:
    +
    +    http://www.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_01
    +
         One of our CI jobs on GitHub Actions uses Ubuntu 20.04 running dash
         0.5.10.2-6, so we failed the test t3701:51;  the "git add -p" being
         tested did not get our custom GIT_PAGER, which broke the test.
2:  f45455f1ff ! 2:  b87c3d96e4 pager: make wait_for_pager a no-op for "cat"
    @@ Commit message
         "cat" [*2*], then we return from `setup_pager()` silently without doing
         anything, allowing the output to go directly to the normal stdout.
     
    -    Let's make the call to `wait_for_pager()` for these cases, or any other
    -    future optimizations that may occur, also exit silently without doing
    -    anything.
    +    If `setup_pager()` avoids forking a pager, then when the client calls
    +    the corresponding `wait_for_pager()`, we might fail trying to terminate
    +    a process that wasn't started.
    +
    +    One solution to avoid this problem could be to make the caller aware
    +    that `setup_pager()` did nothing, so it could avoid calling
    +    `wait_for_pager()`.
    +
    +    However, let's avoid shifting that responsibility to the caller and
    +    instead treat the call to `wait_for_pager()` as a no-op when we know we
    +    haven't forked a pager.
     
            1.- 402461aab1 (pager: do not fork a pager if PAGER is set to empty.,
                            2006-04-16)
-- 
2.45.1

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

end of thread, other threads:[~2024-07-25 13:44 UTC | newest]

Thread overview: 70+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-12  0:57 [PATCH 0/4] use the pager in 'add -p' Rubén Justo
2024-07-12  1:00 ` [PATCH 1/4] add-patch: test for 'p' command Rubén Justo
2024-07-12  1:00 ` [PATCH 2/4] pager: do not close fd 2 unnecessarily Rubén Justo
2024-07-12  1:00 ` [PATCH 3/4] pager: introduce wait_for_pager Rubén Justo
2024-07-12 13:17   ` Phillip Wood
2024-07-12  1:00 ` [PATCH 4/4] add-patch: render hunks through the pager Rubén Justo
2024-07-12  8:58   ` Dragan Simic
2024-07-12 13:26   ` Phillip Wood
2024-07-12 16:24     ` Rubén Justo
2024-07-13  3:23       ` Rubén Justo
2024-07-13  9:12       ` Junio C Hamano
2024-07-13 13:17       ` phillip.wood123
2024-07-13 23:13         ` Rubén Justo
2024-07-12  8:56 ` [PATCH 0/4] use the pager in 'add -p' Dragan Simic
2024-07-13 16:26 ` [PATCH v2 " Rubén Justo
2024-07-13 16:29   ` [PATCH v2 1/4] add-patch: test for 'p' command Rubén Justo
2024-07-13 16:29   ` [PATCH v2 2/4] pager: do not close fd 2 unnecessarily Rubén Justo
2024-07-13 16:29   ` [PATCH v2 3/4] pager: introduce wait_for_pager Rubén Justo
2024-07-13 16:30   ` [PATCH v2 4/4] add-patch: render hunks through the pager Rubén Justo
2024-07-13 17:08   ` [PATCH v2 0/4] use the pager in 'add -p' Junio C Hamano
2024-07-13 23:21     ` Rubén Justo
2024-07-14  1:18       ` Junio C Hamano
2024-07-14 16:00   ` [PATCH v3 " Rubén Justo
2024-07-14 16:04     ` [PATCH v3 1/4] add-patch: test for 'p' command Rubén Justo
2024-07-14 16:04     ` [PATCH v3 2/4] pager: do not close fd 2 unnecessarily Rubén Justo
2024-07-14 16:04     ` [PATCH v3 4/4] add-patch: render hunks through the pager Rubén Justo
2024-07-15 14:10       ` Phillip Wood
2024-07-15 23:54       ` Junio C Hamano
2024-07-17 17:20         ` Rubén Justo
2024-07-17 19:39           ` phillip.wood123
2024-07-17 20:03             ` Junio C Hamano
2024-07-17 20:09               ` Eric Sunshine
2024-07-17 20:21                 ` Junio C Hamano
2024-07-20 22:37                 ` Rubén Justo
2024-07-22  7:18                   ` Eric Sunshine
2024-07-22 14:53                     ` Rubén Justo
2024-07-18  9:48               ` phillip.wood123
2024-07-17 20:31             ` Junio C Hamano
2024-07-18  9:56               ` phillip.wood123
2024-07-20 22:39               ` Rubén Justo
2024-07-20 22:29             ` Rubén Justo
2024-07-22 10:18               ` Phillip Wood
2024-07-22 16:45                 ` Rubén Justo
2024-07-22 17:22               ` Junio C Hamano
2024-07-22 19:06                 ` Rubén Justo
2024-07-22 19:27                   ` Junio C Hamano
2024-07-22 21:06                     ` Re* " Junio C Hamano
2024-07-22 22:00                       ` Rubén Justo
2024-07-22 23:12                       ` Kyle Lippincott
2024-07-22 23:28                         ` Junio C Hamano
2024-07-23  2:31                         ` Junio C Hamano
2024-07-22 21:25                   ` Junio C Hamano
2024-07-22 23:20                     ` Rubén Justo
2024-07-22 23:24                       ` [PATCH 1/2] t3701: avoid one-shot export for shell functions Rubén Justo
2024-07-22 23:44                         ` Junio C Hamano
2024-07-22 23:57                           ` Junio C Hamano
2024-07-22 23:24                       ` [PATCH 2/2] pager: make wait_for_pager a no-op for "cat" Rubén Justo
2024-07-22 23:54                         ` Junio C Hamano
2024-07-18  9:58           ` [PATCH v3 4/4] add-patch: render hunks through the pager phillip.wood123
2024-07-20 22:45             ` Rubén Justo
2024-07-14 16:04     ` [PATCH v3 3/4] pager: introduce wait_for_pager Rubén Justo
2024-07-15 14:13       ` Phillip Wood
2024-07-15 20:04         ` Rubén Justo
2024-07-17 14:58           ` phillip.wood123
2024-07-15 20:16     ` [PATCH v4 0/4] add-patch: render hunks through the pager Rubén Justo
2024-07-15 20:20       ` [PATCH v4 1/4] add-patch: test for 'p' command Rubén Justo
2024-07-15 20:21       ` [PATCH v4 2/4] pager: do not close fd 2 unnecessarily Rubén Justo
2024-07-15 20:21       ` [PATCH v4 3/4] pager: introduce wait_for_pager Rubén Justo
2024-07-15 20:22       ` [PATCH v4 4/4] add-patch: render hunks through the pager Rubén Justo
  -- strict thread matches above, loose matches on Subject: below --
2024-07-23  0:39 [PATCH v2 0/2] add-p P fixups Rubén Justo
2024-07-23  9:15 ` Phillip Wood
2024-07-23 22:08   ` Rubén Justo
2024-07-24 15:21     ` phillip.wood123
2024-07-24 16:12       ` Rubén Justo
2024-07-25  9:45         ` Phillip Wood
2024-07-25 12:16           ` Rubén Justo
2024-07-25 13:42             ` [PATCH 0/4] squash fixups in rj/add-p-pager Rubén Justo
2024-07-25 13:44               ` [PATCH 4/4] add-patch: render hunks through the pager Rubén Justo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.