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

Re: git notes: notes

From
Johan Herland <johan@herland.net>
Date
Jan 20, 2010, 10:48 UTC
Message-ID
<201001201148.11701.johan@herland.net>
In-Reply-To
<20100120050343.GA12860@gnu.kitenet.net>
On Wednesday 20 January 2010, Joey Hess wrote:
> Just a quick note that the new notes feature can break things that parse
> git log. For example a parser that assumes it can split the log on blank
> lines to separate the header and commit message, can easily become
> confused by the new blank line before "Notes:".

As Thomas already stated, git log is porcelain, and its output format is not set in stone. If you need a stable, script-friendly format, you should probably use the --format option, or use plumbing instead (such as e.g. git rev-list, which also has a --format option).

Show 6 quoted lines
> Might be worth documenting in release notes, maybe too late now though.
> But really, it's all good, notes are a great feature.
> 
> PS, Has anyone thought about using notes to warn bisect away from
> commits that are known to be unbuildable or otherwise cause bisection
> trouble?
No, I haven't thought of that specific use case. Great idea! :)

BTW, since I started talking about git notes, people on this list have found more and more interesting use cases for them:

- Free-form text extension to the commit message
- Help in bug tracking with header-like lines such as:
    - Causes-Bug: #12345
    - Fixes-Bug: #54321
- Store after-the-fact "Acked-By", "Reviewed-By", etc. annotations
- In a repo converted from a merge-unfriendly VCS (such as CVS), use notes
  to identify merges without having to rewrite Git history (note that you
  can also use grafts, or "git replace" to accomplish this).
- Refer to related commits elsewhere in the repo (i.e. relationships that
  are not already apparent from the commit graph)
- When cherry-picking, add a reverse link from the source commit to the
  cherry-picked commit (since it may be of interest to people reviewing the
  source commit
- Rebasing public branches is forbidden, but if you wanted to change that,
  you could potentially help solve it by using notes to add reverse links
  from source commits to rebased commits, so that downstream people could
  more easily traverse your history when rebasing/merging their own
  branches.
- Initially, there were some discussion whether it could also be used to
  guide git blame to make better decisions, although I don't currently see
  how that would be done in practice.

In any case, it seems the notes idea may have the potential to become one of the more useful features in Git.

Have fun! :)
...Johan
[1]: ...almost 3 years ago (wow, time flies...):
     http://article.gmane.org/gmane.comp.version-control.git/46883
-- 
Johan Herland, <johan@herland.net>
www.herland.net
Previous: Joey HessNext: Joey Hess
Message 4 of 36 in “git notes: notes”
  1. Joey HessJan 20, 2010
  2. Thomas RastJan 20, 2010
  3. Joey HessJan 20, 2010
  4. Johan HerlandJan 20, 2010
  5. Joey HessJan 20, 2010
  6. Junio C HamanoJan 20, 2010
  7. Joey HessJan 20, 2010
  8. Junio C HamanoJan 20, 2010
  9. Joey HessJan 20, 2010
  10. Jeff KingJan 20, 2010
  11. Junio C HamanoJan 20, 2010
  12. Jeff KingJan 20, 2010
  13. Jeff KingJan 20, 2010
  14. Junio C HamanoJan 20, 2010
  15. Jeff KingJan 20, 2010
  16. Michael J GruberJan 20, 2010
  17. Junio C HamanoJan 20, 2010
  18. Jeff KingJan 20, 2010
  19. Junio C HamanoJan 20, 2010
  20. Jeff KingJan 20, 2010
  21. Junio C HamanoJan 20, 2010
  22. Johannes SchindelinJan 20, 2010
  23. Jeff KingJan 20, 2010
  24. Junio C HamanoJan 20, 2010
  25. Johan HerlandJan 21, 2010
  26. Junio C HamanoJan 21, 2010
  27. Junio C HamanoJan 21, 2010
  28. Michael J GruberJan 21, 2010
  29. Matthieu MoyJan 24, 2010
  30. Sverre RabbelierJan 24, 2010
  31. Johan HerlandJan 21, 2010
  32. Johannes SchindelinJan 21, 2010
  33. Joey HessJan 21, 2010
  34. Johan HerlandJan 27, 2010
  35. John KoleszarJan 25, 2010
  36. Christian CouderJan 27, 2010

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.