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

Re: [RFC/PATCH] commit notes workflow

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Feb 27, 2011, 14:31 UTC
Message-ID
<4D6A6056.20201@drmicha.warpmail.net>
In-Reply-To
<20110225133056.GA1026@sigill.intra.peff.net>
Jeff King venit, vidit, dixit 25.02.2011 14:30:
Show 52 quoted lines
> I was revising a long-ish series today, and I have been wanting to start
> using "git notes" to store information on what's changed between
> versions (which will eventually go after the "---" in format-patch).
> 
> So my workflow was something like:
> 
>   1. git rebase -i, mark one or more commits for edit
> 
>   2. For each commit we stop at:
> 
>      a. Tweak the tree either with enhancements, or to resolve
>         conflicts from tweaks to earlier patches.
> 
>      b. commit --amend, tweak commit message is needed
> 
>      c. git notes add, mention changes
> 
>      d. git rebase --continue
> 
> Two things annoyed me:
> 
>   1. Editing the commit message and notes separately felt awkward. They
>      are conceptually part of the same task to me.
> 
>   2. In the conflict case, there is no opportunity to run "git notes
>      add" because you fix up commits and directly run "rebase
>      --continue".
> 
> So my solution was that "git commit" should be able to embed and extract
> notes from the commit message itself. The patch below implements "git
> commit --notes", which does two things:
> 
>   1. If we are amending, it populates the commit message not just with
>      the existing message, but also with a "---" divider and any notes on
>      the commit.
> 
>   2. After editing the commit message, it looks for the "---" divider
>      and puts everything after it into a commit note (whether or not it
>      put in a divider in step (1), so you can add new notes, too).
> 
> So your commit template looks like:
> 
>   subject
> 
>   commit message body
>   ---
>   notes data
> 
>   # usual template stuff
> 
> I'm curious what people think. Do others find this useful? Does it seem
> harmful?
I can haz tis wiz "format-patch --notes-behind-triple-dash"?
Michael
Previous: Drew NorthupNext: Jeff King
Message 25 of 27 in “commit notes workflow”
  1. commit notes workflowJeff King, Feb 25, 2011
  2. Johan HerlandFeb 25, 2011
  3. Jeff KingMar 1, 2011
  4. Johan HerlandMar 2, 2011
  5. Sverre RabbelierMar 3, 2011
  6. Junio C HamanoMar 3, 2011
  7. Sverre RabbelierMar 3, 2011
  8. commit, status: #comment diff output in verbose modeIan Ward Comfort, Mar 3, 2011
  9. Sverre RabbelierMar 3, 2011
  10. Jeff KingMar 7, 2011
  11. 1/2 notes: make expand_notes_ref globally accessibleJeff King, Mar 7, 2011
  12. Johan HerlandMar 8, 2011
  13. 2/2 commit: allow editing notes in commit message editorJeff King, Mar 7, 2011
  14. Johan HerlandMar 8, 2011
  15. Michel LespinasseMar 8, 2011
  16. Chris PackhamMar 2, 2011
  17. Drew NorthupMar 2, 2011
  18. Piotr KrukowieckiMar 2, 2011
  19. Junio C HamanoFeb 25, 2011
  20. Drew NorthupFeb 25, 2011
  21. Jeff KingMar 1, 2011
  22. Drew NorthupMar 1, 2011
  23. Jeff KingMar 1, 2011
  24. Drew NorthupMar 1, 2011
  25. Michael J GruberFeb 27, 2011
  26. Jeff KingMar 1, 2011
  27. Yann DirsonMar 9, 2011

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.