{"thread":{"id":"22634","subject":"Commit annotations (editable commit messages)","startedAt":"2010-02-12T22:32:55Z","lastAt":"2010-02-13T21:46:04Z","messageCount":5,"participants":["Vladimir Panteleev","Avery Pennarun","Mark Lodato","Johan Herland"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"134391","messageId":"op.u71cw50km02fvl@cybershadow.mshome.net","threadId":"22634","inReplyTo":null,"subject":"Commit annotations (editable commit messages)","fromName":"Vladimir Panteleev","fromEmail":"thecybershadow@gmail.com","sentAt":"2010-02-12T22:32:55Z","receivedAt":"2010-02-12T22:32:55Z","isPatch":false,"sender":{"key":"thecybershadow@gmail.com","avatar":"https://gravatar.com/avatar/3e299714bf51dc14d421243faf5bea230d483e2a82fc049a717ecccaf36accb4?d=mp&s=160"},"body":"You have to agree, being able to edit commit messages in a controlled  \n(logged/versioned) fashion is pretty useful. Aside mundane corrections  \nsuch as typos or undocumented changes, it makes it possible to document  \nbugs and other unintended changes in the commit that they were introduced.  \nThis is possible in centralized VCSes and is implemented in Subversion  \n(controlled by a server-side hook).\n\nWhen I presented somewhere the idea of migrating from SVN to Git, I got an  \nopinion that the inability to edit commit messages (without rewriting  \nhistory) would be a show-stopper, so I began to wonder how would it be  \npossible to implement versioned editable commit messages (or commit  \n\"annotations\") in Git:\n1) the repository has a separate, special branch that only contains text  \nfiles named by the SHA-1 of the commit they are describing\n2) commit annotations are created/edited by creating/editing the  \nrespective text files, either manually or using some utilities (e.g. \"git  \nedit-annotation <SHA-1>\" could check out the file from the branch, open up  \nan editor and commit it back)\n3) setting up \"git push/pull\" to also push/pull the annotations branch\n4) \"git log\" and related commands would also show the contents of the  \nrespective text files, if they exist\n\nThe first three seem trivial... I'm not sure how to approach 4) though.  \nWould it be possible to hack git to add a commit message output  \npreprocessor hook OSLT?\n\nThere's also the problem with rebasing. Aside hacks with copies or  \nsymlinks in the annotations branch, what would be the best way to have an  \nannotation follow commits after they're rebased (and have a different  \nSHA-1)? Perhaps tie them to some property unique to the commit  \n(timestamp?)? Depending on how this idea (and git rebase) is implemented,  \nit could also just copy over the then-current version of the annotation  \ninto the new commit message when rebasing the commit.\n\n-- \nBest regards,\n  Vladimir                            mailto:thecybershadow@gmail.com\n"},{"id":"134395","messageId":"32541b131002121455s46bfe15aie484e9be484259c6@mail.gmail.com","threadId":"22634","inReplyTo":"op.u71cw50km02fvl@cybershadow.mshome.net","subject":"Re: Commit annotations (editable commit messages)","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2010-02-12T22:55:46Z","receivedAt":"2010-02-12T22:55:46Z","isPatch":false,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"2010/2/12 Vladimir Panteleev <thecybershadow@gmail.com>:\n> You have to agree, being able to edit commit messages in a controlled\n> (logged/versioned) fashion is pretty useful. Aside mundane corrections such\n> as typos or undocumented changes, it makes it possible to document bugs and\n> other unintended changes in the commit that they were introduced. This is\n> possible in centralized VCSes and is implemented in Subversion (controlled\n> by a server-side hook).\n\nIt sounds like you want to read about a new feature called git-notes:\nhttp://www.kernel.org/pub/software/scm/git/docs/git-notes.html\n\nHave fun,\n\nAvery\n"},{"id":"134397","messageId":"op.u71e00v4m02fvl@cybershadow.mshome.net","threadId":"22634","inReplyTo":"32541b131002121455s46bfe15aie484e9be484259c6@mail.gmail.com","subject":"Re: Commit annotations (editable commit messages)","fromName":"Vladimir Panteleev","fromEmail":"thecybershadow@gmail.com","sentAt":"2010-02-12T23:18:26Z","receivedAt":"2010-02-12T23:18:26Z","isPatch":false,"sender":{"key":"thecybershadow@gmail.com","avatar":"https://gravatar.com/avatar/3e299714bf51dc14d421243faf5bea230d483e2a82fc049a717ecccaf36accb4?d=mp&s=160"},"body":"On Sat, 13 Feb 2010 00:55:46 +0200, Avery Pennarun <apenwarr@gmail.com>  \nwrote:\n\n> 2010/2/12 Vladimir Panteleev <thecybershadow@gmail.com>:\n>> You have to agree, being able to edit commit messages in a controlled\n>> (logged/versioned) fashion is pretty useful. Aside mundane corrections  \n>> such\n>> as typos or undocumented changes, it makes it possible to document bugs  \n>> and\n>> other unintended changes in the commit that they were introduced. This  \n>> is\n>> possible in centralized VCSes and is implemented in Subversion  \n>> (controlled\n>> by a server-side hook).\n>\n> It sounds like you want to read about a new feature called git-notes:\n> http://www.kernel.org/pub/software/scm/git/docs/git-notes.html\n>\n> Have fun,\n>\n> Avery\n\nWow, thanks! Looks like I'm behind the times. (Currently stuck with  \nmsysGit/1.6.5)\n\nThe documentation looks pretty scant. Does anyone know how close were my  \nsuggestions to the actual implemented behavior (esp. regarding rebasing)?\n\n-- \nBest regards,\n  Vladimir                            mailto:thecybershadow@gmail.com\n"},{"id":"134400","messageId":"ca433831002121701u7c4e47ddn2f8bc19c45b2bd03@mail.gmail.com","threadId":"22634","inReplyTo":"op.u71e00v4m02fvl@cybershadow.mshome.net","subject":"Re: Commit annotations (editable commit messages)","fromName":"Mark Lodato","fromEmail":"lodatom@gmail.com","sentAt":"2010-02-13T01:01:00Z","receivedAt":"2010-02-13T01:01:00Z","isPatch":false,"sender":{"key":"lodatom@gmail.com","avatar":"https://avatars.githubusercontent.com/u/58860?v=4"},"body":"2010/2/12 Vladimir Panteleev <thecybershadow@gmail.com>:\n>> It sounds like you want to read about a new feature called git-notes:\n>> http://www.kernel.org/pub/software/scm/git/docs/git-notes.html\n>\n> Wow, thanks! Looks like I'm behind the times. (Currently stuck with\n> msysGit/1.6.5)\n\nYes, what you described sounds *exactly* like git-notes :)\n\n> The documentation looks pretty scant. Does anyone know how close were my\n> suggestions to the actual implemented behavior (esp. regarding rebasing)?\n\n1, 2, 3, and 4 are all implemented, as far as I know.  However, I\ndon't think notes copy during a rebase.  My gut feeling is that you\nprobably shouldn't be rebasing so much that this is an issue.  I'm\nguessing that you should copy the note to the new commit ID after the\nrebase.\n\nI have also found the documentation lacking.  It helped a bit to see\nthe history.  It's pretty compact in the logs.  Here are two commands\nto isolate the commits:\n\ngit log --reverse fed8a7de3592~..df27f6280545\ngitk fed8a7de3592..df27f6280545\n\n--\nMark\n"},{"id":"134496","messageId":"201002132246.04558.johan@herland.net","threadId":"22634","inReplyTo":"ca433831002121701u7c4e47ddn2f8bc19c45b2bd03@mail.gmail.com","subject":"Re: Commit annotations (editable commit messages)","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2010-02-13T21:46:04Z","receivedAt":"2010-02-13T21:46:04Z","isPatch":false,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"On Saturday 13 February 2010, Mark Lodato wrote:\n> 2010/2/12 Vladimir Panteleev <thecybershadow@gmail.com>:\n> > The documentation looks pretty scant. Does anyone know how close were\n> > my suggestions to the actual implemented behavior (esp. regarding\n> > rebasing)?\n> \n> 1, 2, 3, and 4 are all implemented, as far as I know.  However, I\n> don't think notes copy during a rebase.\n\nThe last patch of the latest iteration of the jh/notes series (posted 5 \nminutes ago) adds a \"git notes copy\" command that does just this. Patching \nrebase/cherry-pick/amend to call \"git notes copy\" should be fairly \nstraightforward.\n\n\n...Johan\n\n-- \nJohan Herland, <johan@herland.net>\nwww.herland.net\n"}]}