Re: 'git --grep' doesn't grep notes?

2012-08-27 Thread Andreas Schwab
"Todd A. Jacobs"  writes:

> What is the right way to include notes in log searches, especially if
> the end goal is to find the related commit ID?

You can git grep on refs/notes/commits and s,/,,g on the file name
found.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


'git --grep' doesn't grep notes?

2012-08-27 Thread Todd A. Jacobs
I have a note attached to a commit, but the text of the note isn't
treated as part of the commit for the purposes of grep. For example:

mkdir /tmp/foo
cd /tmp/foo
git init
git commit --allow-empty -m 'Blank commit.'
git notes add -m 'Find me!'
git log --show-notes --regexp-ignore-case --grep=find

This doesn't match anything. Expected behavior is that this will match
the commit that contains "Find me!" in the notes.

As an example use case, consider ticket integration, where you may
want to add a ticket ID to a commit long after it's been pushed. You
don't want to rewind the branch, or push a rebase, so a note seems
like a sensible place to store a ticket ID. However, if the notes
aren't part of the commit, this will break integration with tools like
Pivotal Tracker that search the commits, and it will also require you
to use an external grep and some custom parsing to find related commit
IDs.

I'm sure there are other use cases. This just happens to be mine right now.

What is the right way to include notes in log searches, especially if
the end goal is to find the related commit ID?
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html