Re: [PATCH 6/7] grep: avoid resolving revision names in --no-index case

2017-02-14 Thread Jonathan Tan
On 02/14/2017 10:04 AM, Jeff King wrote: On Tue, Feb 14, 2017 at 08:53:04AM -0800, Jonathan Tan wrote: On 02/13/2017 10:07 PM, Jeff King wrote: diff --git a/builtin/grep.c b/builtin/grep.c index e83b33bda..c4c632594 100644 --- a/builtin/grep.c +++ b/builtin/grep.c @@ -1176,6 +1176,12 @@ int

Re: [PATCH 6/7] grep: avoid resolving revision names in --no-index case

2017-02-14 Thread Jeff King
On Tue, Feb 14, 2017 at 08:53:04AM -0800, Jonathan Tan wrote: > On 02/13/2017 10:07 PM, Jeff King wrote: > > diff --git a/builtin/grep.c b/builtin/grep.c > > index e83b33bda..c4c632594 100644 > > --- a/builtin/grep.c > > +++ b/builtin/grep.c > > @@ -1176,6 +1176,12 @@ int cmd_grep(int argc, const

Re: [PATCH 6/7] grep: avoid resolving revision names in --no-index case

2017-02-14 Thread Jonathan Tan
On 02/13/2017 10:07 PM, Jeff King wrote: diff --git a/builtin/grep.c b/builtin/grep.c index e83b33bda..c4c632594 100644 --- a/builtin/grep.c +++ b/builtin/grep.c @@ -1176,6 +1176,12 @@ int cmd_grep(int argc, const char **argv, const char *prefix) break; }

[PATCH 6/7] grep: avoid resolving revision names in --no-index case

2017-02-13 Thread Jeff King
We disallow the use of revisions with --no-index, but we don't actually check and complain until well after we've parsed the revisions. This is the cause of a few problems: 1. We shouldn't be calling get_sha1() at all when we aren't in a repository, as it might access the ref or object