From: Phillip Wood Date: Tue, 26 Mar 2024 14:37:50 GMT Subject: Re: [PATCH v2 0/2] improve interactive-patch Message-ID: <59f19783-a663-449d-a1ef-3a9ebc43cc59@gmail.com> In-Reply-To: <6f2ed406-2152-476b-b463-3010afe7e11e@gmail.com> Hi Rubén On 26/03/2024 00:15, Rubén Justo wrote: > Let's reduce the verbosity in the interactive-patch process, in order to > make it less confusing. I think this is a good idea, I've left a few comments on the patches. Best Wishes Phillip > Rubén Justo (2): > add-patch: introduce 'p' in interactive-patch > add-patch: do not print hunks repeatedly > > Documentation/git-add.txt | 1 + > add-patch.c | 20 +++++++++++++++----- > t/t3701-add-interactive.sh | 22 +++++++++++----------- > 3 files changed, 27 insertions(+), 16 deletions(-) > > Range-diff against v1: > 1: 48a2c63b78 ! 1: 5e319f439d add-patch: introduce 'p' in interactive-patch > @@ Commit message > > Signed-off-by: Rubén Justo > > + ## Documentation/git-add.txt ## > +@@ Documentation/git-add.txt: patch:: > + K - leave this hunk undecided, see previous hunk > + s - split the current hunk into smaller hunks > + e - manually edit the current hunk > ++ p - print again the current hunk > + ? - print help > + + > + After deciding the fate for all hunks, if there is any hunk > + > ## add-patch.c ## > @@ add-patch.c: N_("j - leave this hunk undecided, see next undecided hunk\n" > "/ - search for a hunk matching the given regex\n" > @@ add-patch.c: static int patch_update_file(struct add_p_state *s, > goto soft_increment; > } > + } else if (s->answer.buf[0] == 'p') { > -+ /* nothing to do */ > ++ /* nothing special is needed */ > } else { > const char *p = _(help_patch_remainder), *eol = p; > > 2: 1730493096 ! 2: 1177bfeae4 add-patch: do not print hunks repeatedly > @@ Commit message > g - select a hunk to go to > / - search for a hunk matching the given regex > e - manually edit the current hunk > + p - print again the current hunk > ? - print help > @@ -1394,7 +1394,7 @@ N_("j - leave this hunk undecided, see next undecided hunk\n" > static int patch_update_file(struct add_p_state *s, > @@ add-patch.c: static int patch_update_file(struct add_p_state *s, > goto soft_increment; > } > } else if (s->answer.buf[0] == 'p') { > -- /* nothing to do */ > +- /* nothing special is needed */ > + prev_hunk_index = -1; > } else { > const char *p = _(help_patch_remainder), *eol = p;