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

Re: [PATCH v2] add tests for 'git rebase --keep-empty'

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 9, 2012, 17:22 UTC
Message-ID
<7v628sou8v.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1344526791-13539-1-git-send-email-martin.von.zweigbergk@gmail.com>
Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> writes:
Show 10 quoted lines
> Add test cases for 'git rebase --keep-empty' with and without an
> "empty" commit already in upstream. The empty commit that is about to
> be rebased should be kept in both cases.
>
> Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
> ---
>
> Added another test for when the upstream already has an empty
> commit. The test case protects the current behavior; I just assume the
> current behavior is what we want.

Thanks. I think it makes sense, as "upstream already has an empty commit" together with "want to keep empty while rebasing" is a strong sign that the user wants to have a history littered with many empty commits. Unlike a normal commit whose "patch-id" identity may have meaningful significance (i.e. "the change to do X is already in, or not yet in, this branch"), all the empty commits share the same emptiness, so having one empty somewhere long time ago in the history of where we are transplanting the commits shouldn't be a reason to countermand the "want to keep empty" wish by the user.

And I do not think the conclusion would change even if we changed the definition of "identity" for empty commits so that two empty commits with the same message are detected as equal. The only semi sensible justification I heard from people who want to have empty commits in their history is to keep in-history "notes" (e.g. "at this point in the series, the code stops to compile, but the next one fixes it", "it is possible that we may want to redo the previous patch but I dunno"), and it may not make sense to drop such an empty commit under "--keep-empty" mode if there are similar or identical looking "notes" in the "upstream" part of the history.

Previous: Martin von ZweigbergkNext: Neil Horman
Message 4 of 8 in “add test for 'git rebase --keep-empty'”
  1. add test for 'git rebase --keep-empty'Martin von Zweigbergk, Aug 8, 2012
  2. Neil HormanAug 8, 2012
  3. add tests for 'git rebase --keep-empty'Martin von Zweigbergk, Aug 9, 2012
  4. Junio C HamanoAug 9, 2012
  5. Neil HormanAug 10, 2012
  6. Joachim SchmitzAug 10, 2012
  7. Porting to a new platformJunio C Hamano, Aug 10, 2012
  8. Joachim SchmitzAug 10, 2012

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.