Re: git notes and git-commit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@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


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]