{"thread":{"id":"26016","subject":"git notes and git-commit","startedAt":"2010-12-10T13:11:54Z","lastAt":"2010-12-10T19:11:14Z","messageCount":4,"participants":["Nguyen Thai Ngoc Duy","Johan Herland","Jonathan Nieder"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"157816","messageId":"AANLkTi=q1F7WEgH+dLKTHOKhsNVuhU=OeyJ2AsP7oW2G@mail.gmail.com","threadId":"26016","inReplyTo":null,"subject":"git notes and git-commit","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2010-12-10T13:11:54Z","receivedAt":"2010-12-10T13:11:54Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Hi,\n\nI have never used git-notes before, just have had a quick look over\ngit-notes.txt so this may have already been discussed.\n\nIsn't it more convenient to write/update notes when editing commit\nmessage? Jakub mentioned of \"---\" in the archive elsewhere. There's\nnotes.rewriteRef for commit --amend. But if I amend a commit, I might\nas well change my notes. rewriteRef would not work with \"git commit\n-c\" either.\n\nAnother (probably silly) thing. Can I temporarily attach notes to\nHEAD? I could add up notes while working, the notes show up when I\nedit for commit message. I could make revise the notes a bit and\ncommit. Then the notes are attached to a commit.\n-- \nDuy\n"},{"id":"157822","messageId":"201012101513.43890.johan@herland.net","threadId":"26016","inReplyTo":"AANLkTi=q1F7WEgH+dLKTHOKhsNVuhU=OeyJ2AsP7oW2G@mail.gmail.com","subject":"Re: git notes and git-commit","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2010-12-10T14:13:43Z","receivedAt":"2010-12-10T14:13:43Z","isPatch":false,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"On Friday 10 December 2010, Nguyen Thai Ngoc Duy wrote:\n> Hi,\n>\n> I have never used git-notes before, just have had a quick look over\n> git-notes.txt so this may have already been discussed.\n>\n> Isn't it more convenient to write/update notes when editing commit\n> message? Jakub mentioned of \"---\" in the archive elsewhere. There's\n> notes.rewriteRef for commit --amend. But if I amend a commit, I might\n> as well change my notes. rewriteRef would not work with \"git commit\n> -c\" either.\n\nIt seems your notes data is very much tied to your commit messages. If \nyour notes needs editing every time you edit the commit message, I have \nto ask why you simply don't fold the notes into the commit message.\n\nThe same goes for rewriteRef vs. \"git commit -c\". If the notes should \nfollow the commit message around, I have to ask why the notes are \nseparate from the commit message in the first place.\n\nThat said, there might well be good use cases for this (e.g. using notes \nto store data types - e.g. binary data - that cannot be part of the \ncommit message), so I will not advise against implementing this, but if \nyou do, please also consider that there are notes use cases where the \nnotes are tied to the actual contents of the commit, and not the commit \nmessage (e.g. notes-cache).\n\n> Another (probably silly) thing. Can I temporarily attach notes to\n> HEAD? I could add up notes while working, the notes show up when I\n> edit for commit message. I could make revise the notes a bit and\n> commit. Then the notes are attached to a commit.\n\nCurrently, this does not exist. However, a co-worker of mine suggested a \nfeature recently that would benefit from what you describe above:\n\n<digression>\nWhen cherry-picking, instead of using -x to store \"(cherry picked from \ncommit 1234567...)\" in the commit message, it would be nice to use \n(e.g.) -X to store that message in a note. Storing these annotations in \nnotes instead of in the commit message allows us to clean them up (i.e. \nremoving references to now-unreachable commits) at a later date, \nwithout rewriting history.\n\nHowever, in order for this to work together \nwith \"cherry-pick --no-commit\", we need somewhere to store the note \nuntil the subsequent 'git commit' (i.e. something similar \nto .git/MERGE_MSG, but for notes).\n</digression>\n\nImplementing something for notes analogous to .git/MERGE_MSG for commit \nmessages would indeed be interesting. AFAICS, that also solves your \nrequest for editing notes for commits-in-progress.\n\n\n...Johan\n\n-- \nJohan Herland, <johan@herland.net>\nwww.herland.net\n"},{"id":"157823","messageId":"AANLkTinmM5Nktd8AUH+ePobyMPkieB-2J0+pPUsX135p@mail.gmail.com","threadId":"26016","inReplyTo":"201012101513.43890.johan@herland.net","subject":"Re: git notes and git-commit","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2010-12-10T14:38:08Z","receivedAt":"2010-12-10T14:38:08Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Fri, Dec 10, 2010 at 9:13 PM, Johan Herland <johan@herland.net> wrote:\n> On Friday 10 December 2010, Nguyen Thai Ngoc Duy wrote:\n>> Hi,\n>>\n>> I have never used git-notes before, just have had a quick look over\n>> git-notes.txt so this may have already been discussed.\n>>\n>> Isn't it more convenient to write/update notes when editing commit\n>> message? Jakub mentioned of \"---\" in the archive elsewhere. There's\n>> notes.rewriteRef for commit --amend. But if I amend a commit, I might\n>> as well change my notes. rewriteRef would not work with \"git commit\n>> -c\" either.\n>\n> It seems your notes data is very much tied to your commit messages. If\n> your notes needs editing every time you edit the commit message, I have\n> to ask why you simply don't fold the notes into the commit message.\n\nBoth commit message and notes are \"notes\" related to a commit. Some\ninfo, like todos, I'd rather leave them out of commit message. I\nwasn't clear what I was getting to. But as you said below, notes can\nbe cleaned up without rewriting history, making it separate from\ncommit message. So basically they all are just notes (with different\npurpose), which makes me think they should be able to be edited at the\nsame time.\n\n> The same goes for rewriteRef vs. \"git commit -c\". If the notes should\n> follow the commit message around, I have to ask why the notes are\n> separate from the commit message in the first place.\n\nAside from \"all editable at the same time\" above, I think related\nnotes should show up when I write commit messages. Notes can give\nhelpful info for writing commit message, even if I don't update them.\n\n> That said, there might well be good use cases for this (e.g. using notes\n> to store data types - e.g. binary data - that cannot be part of the\n> commit message), so I will not advise against implementing this, but if\n> you do, please also consider that there are notes use cases where the\n> notes are tied to the actual contents of the commit, and not the commit\n> message (e.g. notes-cache).\n\nAh, I didn't know this. Thanks.\n-- \nDuy\n"},{"id":"157837","messageId":"20101210191114.GB6210@burratino","threadId":"26016","inReplyTo":"201012101513.43890.johan@herland.net","subject":"Re: git notes and git-commit","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-12-10T19:11:14Z","receivedAt":"2010-12-10T19:11:14Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Johan Herland wrote:\n\n> That said, there might well be good use cases for this (e.g. using notes \n> to store data types - e.g. binary data - that cannot be part of the \n> commit message)\n\nA small clarification: Can't binary data be part of the commit\nmessage, too?  I suppose you mean \"e.g. using notes to store data -\ne.g. build products - that would be obnoxious to be unconditionally\nshown by git log\".\n"}]}