git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 'git --grep' doesn't grep notes?
@ 2012-08-27 18:18 Todd A. Jacobs
  2012-08-27 19:09 ` Andreas Schwab
  0 siblings, 1 reply; 2+ messages in thread
From: Todd A. Jacobs @ 2012-08-27 18:18 UTC (permalink / raw)
  To: Git Mailing List

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?

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-08-27 19:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-27 18:18 'git --grep' doesn't grep notes? Todd A. Jacobs
2012-08-27 19:09 ` Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).