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

Re: [PATCH/RFD] builtin-revert.c: release index lock when cherry-picking an empty commit

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 8, 2009, 04:14 UTC
Message-ID
<7v63ikmz11.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<1236418251-16947-1-git-send-email-chris_johnsen@pobox.com>
Chris Johnsen <chris_johnsen@pobox.com> writes:
Show 6 quoted lines
> When a cherry-pick of an empty commit is done, release the lock
> held on the index.
>
> The fix is the same as was applied to similar code in 4271666046.
>
> Signed-off-by: Chris Johnsen <chris_johnsen@pobox.com>

Thanks. Will apply. We should handle possible refactoring as a separate topic.

Show 7 quoted lines
> UNEVEN TREATMENT OF EMPTY CHANGES
>
> It seems that empty commits suffer uneven treatment under various
> patch-transport/history-rewriting mechanisms. They seem to be
> handled okay in the most of the core (fetch, push, bundle all
> seem to preserve empty commits, though I have not done rigorous
> testing).

They just transfer an existing history from one place to another without modifying, so it is unfortunately true that they preserve such a broken history with empty commits.

> 'format-patch', 'send-email', 'apply', 'am', 'rebase' (automatic,
> non-fast-forward; and --interactive).

These are all about creating history afresh, and they actively discourage empty commits to be (re)created.

There is no "uneven treatment".
> 36863af16e (git-commit --allow-empty) says "This is primarily for
> use by foreign scm interface scripts.". Is this the only case
> where empty commits _should_ be used?

If foreign scm recorded an empty commit, it would be nice to be able to recreate such a broken history _if the user wanted to_, and that is where the --allow-empty option can be used.

Previous: Johannes SchindelinNext: Chris Johnsen
Message 5 of 21 in “builtin-revert.c: release index lock when cherry-picking an empty commit”
  1. builtin-revert.c: release index lock when cherry-picking an empty commitChris Johnsen, Mar 7, 2009
  2. Johannes SchindelinMar 7, 2009
  3. Chris JohnsenMar 7, 2009
  4. Johannes SchindelinMar 8, 2009
  5. Junio C HamanoMar 8, 2009
  6. Chris JohnsenMar 8, 2009
  7. Junio C HamanoMar 8, 2009
  8. Jeff KingMar 8, 2009
  9. Jeff KingMar 8, 2009
  10. Junio C HamanoMar 8, 2009
  11. Jeff KingMar 10, 2009
  12. Tomas CarneckyMar 10, 2009
  13. Tomas CarneckyMar 10, 2009
  14. Chris JohnsenMar 10, 2009
  15. Jeff KingMar 11, 2009
  16. Mike RalphsonMar 11, 2009
  17. Mike RalphsonMar 11, 2009
  18. Jeff KingMar 22, 2009
  19. Junio C HamanoMar 22, 2009
  20. Jeff KingMar 22, 2009
  21. Brandon CaseyMar 9, 2009

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.