git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git-grep misses an instance of a string (after conflict)
@ 2006-11-26 14:53 Johannes Sixt
  2006-11-26 20:49 ` [PATCH] grep: do not skip unmerged entries when grepping in the working tree Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Sixt @ 2006-11-26 14:53 UTC (permalink / raw)
  To: git

I've roughly had the following sequence of operations on a particular file
in my project:

1. git-cherry-pick a commit, which resulted in a conflict in in that file
2. edit the file to insert a particular string (which wasn't there before)
3. then:

$ git-grep getSibling -- kdbg/exprwnd.h    # this file had a conflict
$ grep getSibling -- kdbg/exprwnd.h       
    { return static_cast<VarTree*>(getSibling()); }
$ git-update-index kdbg/exprwnd.h
$ git-grep getSibling -- kdbg/exprwnd.h       
kdbg/exprwnd.h:    { return static_cast<VarTree*>(getSibling()); }

As you can see, the first git-grep doesn't find the string, but after the
update-index, it does find it.

This is unexpected behavior, in particular since the manual page talks about
git-grep to search the working tree. I understand that the conflict may
have influenced the behavior, but the manual page is not in line with the
behavior. Am I missing something?

-- Hannes


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

end of thread, other threads:[~2006-11-26 21:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-26 14:53 git-grep misses an instance of a string (after conflict) Johannes Sixt
2006-11-26 20:49 ` [PATCH] grep: do not skip unmerged entries when grepping in the working tree Junio C Hamano
2006-11-26 21:30   ` Johannes Sixt

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).