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

Re: [PATCH/RFC v2] sequencer.c: record revert/cherry-pick commit with trailer lines

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Nov 4, 2018, 21:30 UTC
Message-ID
<20181104213007.GL731755@genre.crustytoothpaste.net>
In-Reply-To
<20181104181026.8451-1-pclouds@gmail.com>
On Sun, Nov 04, 2018 at 07:10:26PM +0100, Nguyễn Thái Ngọc Duy wrote:
Show 22 quoted lines
> When a commit is reverted (or cherry-picked with -x) we add an English
> sentence recording that commit id in the new commit message. Make
> these real trailer lines instead so that they are more friendly to
> parsers (especially "git interpret-trailers").
> 
> A reverted commit will have a new trailer
> 
>     Revert: <commit-id>
> 
> Similarly a cherry-picked commit with -x will have
> 
>     Cherry-picked-from: <commit-id>
> 
> When reverting or cherry picking a merge, the reverted/cherry-picked
> branch will be shown using extended SHA-1 syntax, e.g.
> 
>     Revert: <commit-id>~2
> 
> Since we're not producing the old lines "This reverts commit ..." and
> "(cherry picked from commit .." anymore, scripts that look for these
> lines will need to be updated to handle both. Fresh new history could
> just rely on git-interpret-trailers instead.

Overall, I like the idea of this series. This is a much cleaner way to handle things and much better for machine-readability. I foresee git cherry potentially learning how to parse this, for example, for cases where the patch-id doesn't match due to context changes.

However, I do have concerns about breaking compatibility with existing scripts. I wonder if we could add a long alias for git cherry-pick -x, say "--notate" and have "--notate=text" mean "-x" and "--notate=trailer" mean this new format. Similarly, git revert could learn such an option as well.

One final thought: since our trailers seem to act as if we wrote "this commit" (has been), I wonder if we should say "Reverts" instead of "Revert" for consistency.

-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204
Previous: Nguyễn Thái Ngọc DuyNext: Duy Nguyen
Message 7 of 25 in “sequencer.c: record revert/cherry-pick commit with trailer lines”
  1. sequencer.c: record revert/cherry-pick commit with trailer linesNguyễn Thái Ngọc Duy, Nov 4, 2018
  2. Phillip WoodNov 4, 2018
  3. Duy NguyenNov 4, 2018
  4. Phillip WoodNov 4, 2018
  5. Johannes SchindelinNov 5, 2018
  6. sequencer.c: record revert/cherry-pick commit with trailer linesNguyễn Thái Ngọc Duy, Nov 4, 2018
  7. brian m. carlsonNov 4, 2018
  8. Duy NguyenNov 5, 2018
  9. Support --append-trailer in cherry-pick and revertNguyễn Thái Ngọc Duy, Nov 6, 2018
  10. Ævar Arnfjörð BjarmasonNov 6, 2018
  11. Jeff KingNov 6, 2018
  12. Jeff KingNov 6, 2018
  13. Junio C HamanoNov 7, 2018
  14. Duy NguyenNov 7, 2018
  15. Jeff KingNov 7, 2018
  16. Junio C HamanoNov 8, 2018
  17. Jeff KingNov 8, 2018
  18. Junio C HamanoNov 8, 2018
  19. Junio C HamanoNov 7, 2018
  20. Junio C HamanoNov 5, 2018
  21. Duy NguyenNov 5, 2018
  22. Junio C HamanoNov 6, 2018
  23. Ævar Arnfjörð BjarmasonNov 6, 2018
  24. Duy NguyenNov 6, 2018
  25. Ævar Arnfjörð BjarmasonNov 6, 2018

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.