Files
git/builtin
Jeff King 131f3c96d2 grep: treat revs the same for --untracked as for --no-index
git-grep has always disallowed grepping in a tree (as
opposed to the working directory) with both --untracked
and --no-index. But we traditionally did so by first
collecting the revs, and then complaining when any were
provided.

The --no-index option recently learned to detect revs
much earlier. This has two user-visible effects:

  - we don't bother to resolve revision names at all. So
    when there's a rev/path ambiguity, we always choose to
    treat it as a path.

  - likewise, when you do specify a revision without "--",
    the error you get is "no such path" and not "--untracked
    cannot be used with revs".

The rationale for doing this with --no-index is that it is
meant to be used outside a repository, and so parsing revs
at all does not make sense.

This patch gives --untracked the same treatment. While it
_is_ meant to be used in a repository, it is explicitly
about grepping the non-repository contents. Telling the user
"we found a rev, but you are not allowed to use revs" is
not really helpful compared to "we treated your argument as
a path, and could not find it".

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-02-14 13:59:25 -08:00
..
2016-12-21 14:55:01 -08:00
2016-11-22 13:55:20 -08:00
2017-02-02 13:36:55 -08:00
2016-09-29 15:42:18 -07:00
2016-09-21 15:15:24 -07:00
2016-09-29 15:42:18 -07:00
2016-10-10 14:03:50 -07:00
2016-09-26 16:09:17 -07:00
2016-11-22 13:13:16 -08:00
2016-12-27 00:11:41 -08:00
2016-09-29 15:42:18 -07:00
2017-01-18 15:12:15 -08:00
2016-09-29 15:42:18 -07:00
2017-01-31 13:14:56 -08:00
2015-10-05 13:20:08 -07:00
2017-01-18 15:12:11 -08:00
2016-10-03 12:46:47 -07:00
2017-01-23 18:51:56 -08:00
2017-01-31 13:14:58 -08:00