'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


Inverting the --committer option to git-log with v1.7.5.4

2012-08-26 Thread Todd A. Jacobs
I wanted to search a repository for all commits that were *not*
committed by a particular person. While I eventually managed to build
a regular expression that worked for my limited use case, it seems
like there ought to be a more sensible way to find the data I'm
looking for.

As an example, this didn't work:

git log --format=fuller --not --committer=Foo Bar

Apparently, the --not flag doesn't invert the grep for committer; it
only inverts the revision specifiers. It seems like there should be
something that works like grep's --invert-match option, but I couldn't
find it.

On the other hand, this will work, but is painful and error-prone to
build if you have a lot of committers:

# Assuming the address is foo@example.com
git log --format=fuller --committer='[^r]@'

Is there currently a better way to request logs for everyone but
committer x in Git? If not, is this a feature that someone who
understands the Git source might find useful enough to add in?
--
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