{"thread":{"id":"31365","subject":"'git --grep' doesn't grep notes?","startedAt":"2012-08-27T18:18:29Z","lastAt":"2012-08-27T19:09:07Z","messageCount":2,"participants":["Todd A. Jacobs","Andreas Schwab"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"197926","messageId":"CAPRhCbvnRqUpKcw_E383ekG_M0O2a+cTTixUQtU-0mtj3V=7uw@mail.gmail.com","threadId":"31365","inReplyTo":null,"subject":"'git --grep' doesn't grep notes?","fromName":"Todd A. Jacobs","fromEmail":"nospam+listmail@codegnome.org","sentAt":"2012-08-27T18:18:29Z","receivedAt":"2012-08-27T18:18:29Z","isPatch":false,"sender":{"key":"nospam+listmail@codegnome.org","avatar":null},"body":"I have a note attached to a commit, but the text of the note isn't\ntreated as part of the commit for the purposes of grep. For example:\n\n    mkdir /tmp/foo\n    cd /tmp/foo\n    git init\n    git commit --allow-empty -m 'Blank commit.'\n    git notes add -m 'Find me!'\n    git log --show-notes --regexp-ignore-case --grep=find\n\nThis doesn't match anything. Expected behavior is that this will match\nthe commit that contains \"Find me!\" in the notes.\n\nAs an example use case, consider ticket integration, where you may\nwant to add a ticket ID to a commit long after it's been pushed. You\ndon't want to rewind the branch, or push a rebase, so a note seems\nlike a sensible place to store a ticket ID. However, if the notes\naren't part of the commit, this will break integration with tools like\nPivotal Tracker that search the commits, and it will also require you\nto use an external grep and some custom parsing to find related commit\nIDs.\n\nI'm sure there are other use cases. This just happens to be mine right now.\n\nWhat is the right way to include notes in log searches, especially if\nthe end goal is to find the related commit ID?\n"},{"id":"197929","messageId":"m2harob19o.fsf@igel.home","threadId":"31365","inReplyTo":"CAPRhCbvnRqUpKcw_E383ekG_M0O2a+cTTixUQtU-0mtj3V=7uw@mail.gmail.com","subject":"Re: 'git --grep' doesn't grep notes?","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2012-08-27T19:09:07Z","receivedAt":"2012-08-27T19:09:07Z","isPatch":false,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"\"Todd A. Jacobs\" <nospam+listmail@codegnome.org> writes:\n\n> What is the right way to include notes in log searches, especially if\n> the end goal is to find the related commit ID?\n\nYou can git grep on refs/notes/commits and s,/,,g on the file name\nfound.\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5\n\"And now for something completely different.\"\n"}]}