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

Re: [PATCH v2 2/3] rebase: reinstate --no-keep-empty

From
Elijah Newren <newren@gmail.com>
Date
Apr 10, 2020, 21:41 UTC
Message-ID
<CABPp-BGUdUB2ePCWFvxFfnCTx3QBgvOH2pm-CZ9YvpM2Bt4qyg@mail.gmail.com>
In-Reply-To
<xmqqtv1rhyaj.fsf@gitster.c.googlers.com>
On Fri, Apr 10, 2020 at 1:38 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 7 quoted lines
>
> "Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
> > That commit viewed this, though as
> > turning that flag into a no-op.
>
> Sorry, but I do not understand this sentence.
Hmm...it wouldn't hurt to just drop the two sentences with "no-op" in them.
Show 6 quoted lines
> > Provide users a way to drop commits which start empty using a flag that
> > existed for years: --no-keep-empty.  Interpret --keep-empty as
> > countermanding any previous --no-keep-empty, but otherwise leaving
> > --keep-empty as the default.
>
> But everything after that sentence down to here was very clear.
:-)
Show 12 quoted lines
> > This might lead to some slight weirdness since commands like
> >   git rebase --empty=drop --keep-empty
> >   git rebase --empty=keep --no-keep-empty
> > look really weird despite making perfect sense (the first will drop
> > commits which become empty, but keep commits that started empty; the
> > second will keep commits which become empty, but drop commits which
> > started empty).
>
> That is true.  Do we leave it to others (or our later selves) to
> think about the UI further?  That is fine by me, but in that case we
> may want to add " We may want to rethink the option names later",
> perhaps?

The names might not be great, but since --no-keep-empty and --keep-empty already existed for years and prior to 2.16 and were about how to handle commits which started empty, it seemed reasonable to (re)use them. My personal preference would be that for commits whose keep/drop state can be determined solely by looking at its contents of the commit before the rebase (whether that's because they start empty or for whatever other reasons), I'd rather recommend that people just fire up an interactive rebase and pick out the commits they don't want to keep. So, my own bias would be that I wouldn't recommend that new people use either --keep-empty or --no-keep-empty. In my mind, the --[no-]keep-empty flags are just for backward compatibility, so going through effort to rename or alias doesn't seem like it makes a lot of sense.

I don't have a strongly held position here and I'm happy to hear alternate viewpoints, but that's the thought process I went through when creating this change.

Show 8 quoted lines
> > +--no-keep-empty::
> >  --keep-empty::
> > +     Do not keep commits that start empty before the rebase
> > +     (i.e. that do not change anything from its parent) in the
> > +     result.  For commits which become empty after rebasing, see
> > +     the --empty and --keep-cherry-pick flags.
>
> keep-cherry-pick will appear later, not here, right?

--keep-cherry-pick is the new flag added by jt/rebase-allow-duplicate. I guess I should technically probably wait until I create a commit on top of that series and this one to mention it. Or rebase Jonathan's commit, and combine the two series (adding his second since mine might be viewed as a bugfix).

Previous: Junio C HamanoNext: Elijah Newren via GitGitGadget
Message 9 of 27 in “rebase -i: mark commits that begin empty in todo editor”
  1. rebase -i: mark commits that begin empty in todo editorElijah Newren via GitGitGadget, Apr 9, 2020
  2. Junio C HamanoApr 10, 2020
  3. Bryan TurnerApr 10, 2020
  4. Junio C HamanoApr 10, 2020
  5. 0/3 rebase -i: mark commits that begin empty in todo editorElijah Newren via GitGitGadget, Apr 10, 2020
  6. 1/3 rebase -i: mark commits that begin empty in todo editorElijah Newren via GitGitGadget, Apr 10, 2020
  7. 2/3 rebase: reinstate --no-keep-emptyElijah Newren via GitGitGadget, Apr 10, 2020
  8. Junio C HamanoApr 10, 2020
  9. Elijah NewrenApr 10, 2020
  10. 3/3 rebase: fix an incompatible-options error messageElijah Newren via GitGitGadget, Apr 10, 2020
  11. Junio C HamanoApr 10, 2020
  12. Junio C HamanoApr 10, 2020
  13. Junio C HamanoApr 10, 2020
  14. Elijah NewrenApr 10, 2020
  15. Junio C HamanoApr 10, 2020
  16. Elijah NewrenApr 10, 2020
  17. Junio C HamanoApr 10, 2020
  18. Elijah NewrenApr 11, 2020
  19. Junio C HamanoApr 11, 2020
  20. 0/4 rebase -i: mark commits that begin empty in todo editorElijah Newren via GitGitGadget, Apr 11, 2020
  21. 2/4 rebase: reinstate --no-keep-emptyElijah Newren via GitGitGadget, Apr 11, 2020
  22. 1/4 rebase -i: mark commits that begin empty in todo editorElijah Newren via GitGitGadget, Apr 11, 2020
  23. Junio C HamanoApr 15, 2020
  24. 3/4 rebase: fix an incompatible-options error messageElijah Newren via GitGitGadget, Apr 11, 2020
  25. 4/4 rebase --merge: optionally skip upstreamed commitsJonathan Tan via GitGitGadget, Apr 11, 2020
  26. Jonathan TanApr 11, 2020
  27. Phillip WoodApr 14, 2020

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.