From: Johan Herland <johan@herland.net>
To: git@vger.kernel.org
Cc: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Subject: Re: git notes and git-commit
Date: Fri, 10 Dec 2010 15:13:43 +0100 [thread overview]
Message-ID: <201012101513.43890.johan@herland.net> (raw)
In-Reply-To: <AANLkTi=q1F7WEgH+dLKTHOKhsNVuhU=OeyJ2AsP7oW2G@mail.gmail.com>
On Friday 10 December 2010, Nguyen Thai Ngoc Duy wrote:
> Hi,
>
> I have never used git-notes before, just have had a quick look over
> git-notes.txt so this may have already been discussed.
>
> Isn't it more convenient to write/update notes when editing commit
> message? Jakub mentioned of "---" in the archive elsewhere. There's
> notes.rewriteRef for commit --amend. But if I amend a commit, I might
> as well change my notes. rewriteRef would not work with "git commit
> -c" either.
It seems your notes data is very much tied to your commit messages. If
your notes needs editing every time you edit the commit message, I have
to ask why you simply don't fold the notes into the commit message.
The same goes for rewriteRef vs. "git commit -c". If the notes should
follow the commit message around, I have to ask why the notes are
separate from the commit message in the first place.
That said, there might well be good use cases for this (e.g. using notes
to store data types - e.g. binary data - that cannot be part of the
commit message), so I will not advise against implementing this, but if
you do, please also consider that there are notes use cases where the
notes are tied to the actual contents of the commit, and not the commit
message (e.g. notes-cache).
> Another (probably silly) thing. Can I temporarily attach notes to
> HEAD? I could add up notes while working, the notes show up when I
> edit for commit message. I could make revise the notes a bit and
> commit. Then the notes are attached to a commit.
Currently, this does not exist. However, a co-worker of mine suggested a
feature recently that would benefit from what you describe above:
<digression>
When cherry-picking, instead of using -x to store "(cherry picked from
commit 1234567...)" in the commit message, it would be nice to use
(e.g.) -X to store that message in a note. Storing these annotations in
notes instead of in the commit message allows us to clean them up (i.e.
removing references to now-unreachable commits) at a later date,
without rewriting history.
However, in order for this to work together
with "cherry-pick --no-commit", we need somewhere to store the note
until the subsequent 'git commit' (i.e. something similar
to .git/MERGE_MSG, but for notes).
</digression>
Implementing something for notes analogous to .git/MERGE_MSG for commit
messages would indeed be interesting. AFAICS, that also solves your
request for editing notes for commits-in-progress.
...Johan
--
Johan Herland, <johan@herland.net>
www.herland.net
next prev parent reply other threads:[~2010-12-10 14:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-10 13:11 git notes and git-commit Nguyen Thai Ngoc Duy
2010-12-10 14:13 ` Johan Herland [this message]
2010-12-10 14:38 ` Nguyen Thai Ngoc Duy
2010-12-10 19:11 ` Jonathan Nieder
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201012101513.43890.johan@herland.net \
--to=johan@herland.net \
--cc=git@vger.kernel.org \
--cc=pclouds@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.