git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Martin Langhoff" <martin.langhoff@gmail.com>
To: "git list" <git@vger.kernel.org>
Subject: [BUG] git grep broken on master - won't work when merging
Date: Tue, 6 Nov 2007 12:53:21 +1300	[thread overview]
Message-ID: <46a038f90711051553p6202cc62wfda6b45ff7769984@mail.gmail.com> (raw)

Strange behaviour of git grep on one of the projects I hack on...

  $ git --version
  git version 1.5.3.5.561.g140d

  $ git grep LOB lib
  fatal: insanely many options to grep

After a bit of head-scratching I realised I was in the middle of a
merge, with some unresolved paths in the lib directory. A bit of
testing shows that the unresolved index is probably the problem:

  $ git grep LOB lib
  fatal: insanely many options to grep

  # an unresolved file
  $ git grep  LOB lib/accesslib.php
  fatal: insanely many options to grep


  $ git grep --cached LOB lib
  (... expected grep output...)

  $ git reset --hard
  $ git grep LOB lib
  (... expected grep output...)

... not sure what the correct behaviour should be -- I guess the most
reasonable action would be to grep the files on disk for those
unresolved paths. In any case, the error message is insanely many
confusing to user! ;-)

Probably whitespace damaged...

diff --git a/builtin-grep.c b/builtin-grep.c
index c7b45c4..1831ef0 100644
--- a/builtin-grep.c
+++ b/builtin-grep.c
@@ -213,7 +213,7 @@ static int flush_grep(struct grep_opt *opt,
                 * arguments even for the call in the main loop.
                 */
                if (kept)
-                       die("insanely many options to grep");
+                       die("Unresolved index or too many options to grep");

                /*
                 * If we have two or more paths, we do not have to do


cheers,


martin

             reply	other threads:[~2007-11-05 23:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-05 23:53 Martin Langhoff [this message]
2007-11-06  1:02 ` [BUG] git grep broken on master - won't work when merging Junio C Hamano
2007-11-06  2:00   ` Martin Langhoff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46a038f90711051553p6202cc62wfda6b45ff7769984@mail.gmail.com \
    --to=martin.langhoff@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).