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

Re: [PATCH v4 5/8] git-rebase, sequencer: extend --quiet option for the interactive machinery

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jan 21, 2019, 18:19 UTC
Message-ID
<nycvar.QRO.7.76.6.1901211916400.41@tvgsbejvaqbjf.bet>
In-Reply-To
<CABPp-BFrgjW-c8NKGYKs1VaH--Oc8yUu0enQMSp1pQVUwBOBwA@mail.gmail.com>
Hi Elijah,
On Mon, 21 Jan 2019, Elijah Newren wrote:
Show 59 quoted lines
> On Mon, Jan 21, 2019 at 8:10 AM Johannes Schindelin
> <Johannes.Schindelin@gmx.de> wrote:
> >
> > On Tue, 11 Dec 2018, Elijah Newren wrote:
> >
> > > While 'quiet' and 'interactive' may sound like antonyms, the interactive
> > > machinery actually has logic that implements several
> > > interactive_rebase=implied cases (--exec, --keep-empty, --rebase-merges)
> > > which won't pop up an editor.  The rewrite of interactive rebase in C
> > > added a quiet option, though it only turns stats off.  Since we want to
> > > make the interactive machinery also take over for git-rebase--merge, it
> > > should fully implement the --quiet option.
> > >
> > > git-rebase--interactive was already somewhat quieter than
> > > git-rebase--merge and git-rebase--am, possibly because cherry-pick has
> > > just traditionally been quieter.  As such, we only drop a few
> > > informational messages -- "Rebasing (n/m)" and "Successfully rebased..."
> > >
> > > Also, for simplicity, remove the differences in how quiet and verbose
> > > options were recorded.  Having one be signalled by the presence of a
> > > "verbose" file in the state_dir, while the other was signalled by the
> > > contents of a "quiet" file was just weirdly inconsistent.  (This
> > > inconsistency pre-dated the rewrite into C.)  Make them consistent by
> > > having them both key off the presence of the file.
> > >
> > > Signed-off-by: Elijah Newren <newren@gmail.com>
> >
> > This is convincing. I would like to point out, though...
> >
> > > ---
> > >  builtin/rebase.c      |  5 +----
> > >  git-legacy-rebase.sh  |  2 +-
> > >  git-rebase--common.sh |  2 +-
> > >  sequencer.c           | 23 +++++++++++++----------
> > >  sequencer.h           |  1 +
> > >  5 files changed, 17 insertions(+), 16 deletions(-)
> > >
> > > diff --git a/builtin/rebase.c b/builtin/rebase.c
> > > index 78e982298f..ec2e5fbf23 100644
> > > --- a/builtin/rebase.c
> > > +++ b/builtin/rebase.c
> > > @@ -185,10 +185,7 @@ static int read_basic_state(struct rebase_options *opts)
> > >       if (get_oid(buf.buf, &opts->orig_head))
> > >               return error(_("invalid orig-head: '%s'"), buf.buf);
> > >
> > > -     strbuf_reset(&buf);
> > > -     if (read_one(state_dir_path("quiet", opts), &buf))
> > > -             return -1;
> > > -     if (buf.len)
> > > +     if (file_exists(state_dir_path("quiet", opts)))
> >
> > This changes the behavior. AFAIR the `quiet` file was always written, but
> > contained `t` in quiet mode. I have to interrupt my review here, and will
> > continue later, but maybe you will beat me to looking into that.
> >
> > Ciao,
> > Dscho
> 
> You are certainly consistent;
You flatter me!
Show 21 quoted lines
> you commented on this exact same issue in both v1 and v2 (you didn't
> have time to review v3). In v2, your comment was[1]:
> 
> "
> I am slightly concerned that some creative power user could have written
> scripts that rely on this behavior.
> 
> But only *slightly* concerned.
> 
> The patch looks correct.
> "
> 
> Also, I have a fuzzy memory of discussing a very similar case with
> some rebase-oriented option and its on-disk representation, where the
> concern was more about users upgrading git versions during an
> incomplete rebase rather than power users looking at internal file
> contents.  And I think either Phillip or Junio made some statement
> about considering these internal details and that they felt the worry
> about upgrade mid-rebase was overly worrying.  But I can't find the
> emails right now, and it's been so long (at least half a year) that I
> might be imagining things.

Indeed, it was one of Phillip's patch series that fixed an incorrect quoting in the author script. And we eventually all agreed that it would not be worth the trouble to take care of upgrade-spanning rebases (both Phillip and I spent some time to make it so, IIRC).

Show 10 quoted lines
> But from first principles, in this case even if you're worried about
> power users reaching into internal files of rebase or about users
> upgrade mid-rebase, at *worst* people will get or lose a few fluffy
> progress-update messages.  To me, that's an innocuous level of change
> that's certainly worth the risk to allow us to get rid of the annoying
> differences in implementation of handling of different options.  But,
> if you strongly feel that's too big a risk, we can remove the part of
> the patch making verbose and quiet be handled consistently; it's not
> critical to the rest of the series.  I just thought it was a good
> cleanup while I was touching the area.

I think you are correct. It is much easier in C to check whether a file exists than to read it, parse it and determine whether its Boolean value should be `false` or `true`.

So color me convinced that your clean-up is worth it. Maybe, just maybe, if you submit another iteration (and only if), could you add a little paragraph for future Dscho to understand that this clean-up was slipped in?

Thanks, Dscho

Previous: Elijah NewrenNext: Johannes Schindelin
Message 37 of 67 in “Reimplement rebase --merge via interactive machinery”
  1. 0/2 Reimplement rebase --merge via interactive machineryElijah Newren, Nov 8, 2018
  2. 1/2 git-rebase, sequencer: extend --quiet option for the interactive machineryElijah Newren, Nov 8, 2018
  3. Johannes SchindelinNov 12, 2018
  4. 2/2 rebase: Implement --merge via git-rebase--interactiveElijah Newren, Nov 8, 2018
  5. Johannes SchindelinNov 12, 2018
  6. Phillip WoodNov 12, 2018
  7. Johannes SchindelinNov 13, 2018
  8. Elijah NewrenNov 14, 2018
  9. Elijah NewrenNov 13, 2018
  10. Elijah NewrenNov 14, 2018
  11. Johannes SchindelinNov 15, 2018
  12. Elijah NewrenNov 8, 2018
  13. 0/7 Reimplement rebase --merge via interactive machineryElijah Newren, Nov 22, 2018
  14. 4/7 git-rebase, sequencer: extend --quiet option for the interactive machineryElijah Newren, Nov 22, 2018
  15. 2/7 t5407: add a test demonstrating how interactive handles --skip differentlyElijah Newren, Nov 22, 2018
  16. 1/7 rebase: fix incompatible options error messageElijah Newren, Nov 22, 2018
  17. Johannes SchindelinNov 28, 2018
  18. Elijah NewrenNov 28, 2018
  19. Duy NguyenNov 28, 2018
  20. Elijah NewrenNov 28, 2018
  21. 7/7 rebase: Implement --merge via the interactive machineryElijah Newren, Nov 22, 2018
  22. 5/7 git-legacy-rebase: simplify unnecessary triply-nested ifElijah Newren, Nov 22, 2018
  23. 3/7 am, rebase--merge: do not overlook --skip'ed commits with post-rewriteElijah Newren, Nov 22, 2018
  24. 6/7 rebase: define linearization ordering and enforce itElijah Newren, Nov 22, 2018
  25. 0/8 Reimplement rebase --merge via interactive machineryElijah Newren, Dec 11, 2018
  26. 1/8 rebase: make builtin and legacy script error messages the sameElijah Newren, Dec 11, 2018
  27. 4/8 am, rebase--merge: do not overlook --skip'ed commits with post-rewriteElijah Newren, Dec 11, 2018
  28. Johannes SchindelinJan 21, 2019
  29. Elijah NewrenJan 21, 2019
  30. Johannes SchindelinJan 21, 2019
  31. 2/8 rebase: fix incompatible options error messageElijah Newren, Dec 11, 2018
  32. 6/8 git-legacy-rebase: simplify unnecessary triply-nested ifElijah Newren, Dec 11, 2018
  33. 8/8 rebase: Implement --merge via the interactive machineryElijah Newren, Dec 11, 2018
  34. 5/8 git-rebase, sequencer: extend --quiet option for the interactive machineryElijah Newren, Dec 11, 2018
  35. Johannes SchindelinJan 21, 2019
  36. Elijah NewrenJan 21, 2019
  37. Johannes SchindelinJan 21, 2019
  38. Johannes SchindelinJan 21, 2019
  39. Junio C HamanoJan 22, 2019
  40. Phillip WoodFeb 20, 2019
  41. Elijah NewrenFeb 21, 2019
  42. 7/8 rebase: define linearization ordering and enforce itElijah Newren, Dec 11, 2018
  43. 3/8 t5407: add a test demonstrating how interactive handles --skip differentlyElijah Newren, Dec 11, 2018
  44. Elijah NewrenJan 7, 2019
  45. Junio C HamanoJan 7, 2019
  46. Junio C HamanoJan 7, 2019
  47. Elijah NewrenJan 7, 2019
  48. Elijah NewrenJan 11, 2019
  49. Johannes SchindelinJan 18, 2019
  50. Johannes SchindelinJan 18, 2019
  51. Junio C HamanoJan 18, 2019
  52. Elijah NewrenJan 18, 2019
  53. Johannes SchindelinJan 18, 2019
  54. Junio C HamanoJan 18, 2019
  55. Johannes SchindelinJan 21, 2019
  56. Johannes SchindelinJan 21, 2019
  57. Johannes SchindelinJan 21, 2019
  58. Elijah NewrenJan 21, 2019
  59. 0/8 Reimplement rebase --merge via interactive machineryElijah Newren, Jan 29, 2019
  60. 1/8 rebase: make builtin and legacy script error messages the sameElijah Newren, Jan 29, 2019
  61. 6/8 git-legacy-rebase: simplify unnecessary triply-nested ifElijah Newren, Jan 29, 2019
  62. 4/8 am, rebase--merge: do not overlook --skip'ed commits with post-rewriteElijah Newren, Jan 29, 2019
  63. 8/8 rebase: implement --merge via the interactive machineryElijah Newren, Jan 29, 2019
  64. 5/8 git-rebase, sequencer: extend --quiet option for the interactive machineryElijah Newren, Jan 29, 2019
  65. 7/8 rebase: define linearization ordering and enforce itElijah Newren, Jan 29, 2019
  66. 2/8 rebase: fix incompatible options error messageElijah Newren, Jan 29, 2019
  67. 3/8 t5407: add a test demonstrating how interactive handles --skip differentlyElijah Newren, Jan 29, 2019

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.