Re: git notes: notes
- Date: Wed, 20 Jan 2010 11:48:11 +0100
- From: Johan Herland <johan@xxxxxxxxxxx>
- Subject: Re: git notes: notes
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).
> 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@xxxxxxxxxxx>
www.herland.net
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html