* git notes and git-commit
@ 2010-12-10 13:11 Nguyen Thai Ngoc Duy
2010-12-10 14:13 ` Johan Herland
0 siblings, 1 reply; 4+ messages in thread
From: Nguyen Thai Ngoc Duy @ 2010-12-10 13:11 UTC (permalink / raw)
To: Git Mailing List
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.
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.
--
Duy
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: git notes and git-commit
2010-12-10 13:11 git notes and git-commit Nguyen Thai Ngoc Duy
@ 2010-12-10 14:13 ` Johan Herland
2010-12-10 14:38 ` Nguyen Thai Ngoc Duy
2010-12-10 19:11 ` Jonathan Nieder
0 siblings, 2 replies; 4+ messages in thread
From: Johan Herland @ 2010-12-10 14:13 UTC (permalink / raw)
To: git; +Cc: Nguyen Thai Ngoc Duy
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: git notes and git-commit
2010-12-10 14:13 ` Johan Herland
@ 2010-12-10 14:38 ` Nguyen Thai Ngoc Duy
2010-12-10 19:11 ` Jonathan Nieder
1 sibling, 0 replies; 4+ messages in thread
From: Nguyen Thai Ngoc Duy @ 2010-12-10 14:38 UTC (permalink / raw)
To: Johan Herland; +Cc: git
On Fri, Dec 10, 2010 at 9:13 PM, Johan Herland <johan@herland.net> wrote:
> 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.
Both commit message and notes are "notes" related to a commit. Some
info, like todos, I'd rather leave them out of commit message. I
wasn't clear what I was getting to. But as you said below, notes can
be cleaned up without rewriting history, making it separate from
commit message. So basically they all are just notes (with different
purpose), which makes me think they should be able to be edited at the
same time.
> 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.
Aside from "all editable at the same time" above, I think related
notes should show up when I write commit messages. Notes can give
helpful info for writing commit message, even if I don't update them.
> 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).
Ah, I didn't know this. Thanks.
--
Duy
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: git notes and git-commit
2010-12-10 14:13 ` Johan Herland
2010-12-10 14:38 ` Nguyen Thai Ngoc Duy
@ 2010-12-10 19:11 ` Jonathan Nieder
1 sibling, 0 replies; 4+ messages in thread
From: Jonathan Nieder @ 2010-12-10 19:11 UTC (permalink / raw)
To: Johan Herland; +Cc: git, Nguyen Thai Ngoc Duy
Johan Herland wrote:
> 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)
A small clarification: Can't binary data be part of the commit
message, too? I suppose you mean "e.g. using notes to store data -
e.g. build products - that would be obnoxious to be unconditionally
shown by git log".
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-12-10 19:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-10 13:11 git notes and git-commit Nguyen Thai Ngoc Duy
2010-12-10 14:13 ` Johan Herland
2010-12-10 14:38 ` Nguyen Thai Ngoc Duy
2010-12-10 19:11 ` Jonathan Nieder
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.