Re: [PATCH] ref-filter: don't look for objects when outside of a repository

2018-11-16 Thread SZEDER Gábor
On Fri, Nov 16, 2018 at 02:09:07PM +0900, Junio C Hamano wrote: > Jeff King writes: > > > On Thu, Nov 15, 2018 at 04:38:44AM -0500, Jeff King wrote: > > > >> Is SOURCE_NONE a complete match for what we want? > >> > >> I see problems in both directions: > >> > >> - sorting by "objectname"

Re: [PATCH] ref-filter: don't look for objects when outside of a repository

2018-11-16 Thread Junio C Hamano
Jeff King writes: > If you are arguing that even in a repo we should reject "authorname" > early (just as we would outside of a repo), I could buy that. Yup, that (and replace 'authorname' with anything that won't work with missing objects) for consistency was what I meant.

Re: [PATCH] ref-filter: don't look for objects when outside of a repository

2018-11-16 Thread Jeff King
On Fri, Nov 16, 2018 at 02:09:07PM +0900, Junio C Hamano wrote: > >> I see problems in both directions: > >> > >> - sorting by "objectname" works now, but it's marked with SOURCE_OBJ, > >>and would be forbidden with your patch. I'm actually not sure if > >>SOURCE_OBJ is accurate; we

Re: [PATCH] ref-filter: don't look for objects when outside of a repository

2018-11-15 Thread Junio C Hamano
Jeff King writes: > On Thu, Nov 15, 2018 at 04:38:44AM -0500, Jeff King wrote: > >> Is SOURCE_NONE a complete match for what we want? >> >> I see problems in both directions: >> >> - sorting by "objectname" works now, but it's marked with SOURCE_OBJ, >>and would be forbidden with your

Re: [PATCH] ref-filter: don't look for objects when outside of a repository

2018-11-15 Thread Jeff King
On Thu, Nov 15, 2018 at 04:38:44AM -0500, Jeff King wrote: > Is SOURCE_NONE a complete match for what we want? > > I see problems in both directions: > > - sorting by "objectname" works now, but it's marked with SOURCE_OBJ, >and would be forbidden with your patch. I'm actually not sure if

Re: [PATCH] ref-filter: don't look for objects when outside of a repository

2018-11-15 Thread Jeff King
On Wed, Nov 14, 2018 at 01:27:25PM +0100, SZEDER Gábor wrote: > The command 'git ls-remote --sort=authordate ' segfaults when > run outside of a repository, ever since the introduction of its > '--sort' option in 1fb20dfd8e (ls-remote: create '--sort' option, > 2018-04-09). > > While in general

[PATCH] ref-filter: don't look for objects when outside of a repository

2018-11-14 Thread SZEDER Gábor
The command 'git ls-remote --sort=authordate ' segfaults when run outside of a repository, ever since the introduction of its '--sort' option in 1fb20dfd8e (ls-remote: create '--sort' option, 2018-04-09). While in general the 'git ls-remote' command can be run outside of a repository just fine,

Re: [PATCH] ref-filter: don't look for objects when outside of a repository

2018-09-25 Thread Junio C Hamano
SZEDER Gábor writes: > However, if we go for a more informative error message, then wouldn't > it be better to add this condition in populate_value() before it even > calls get_object()? Then we could also add the problematic format > specifier to the error message (I think, but didn't actually

Re: [PATCH] ref-filter: don't look for objects when outside of a repository

2018-09-24 Thread Jeff King
On Mon, Sep 24, 2018 at 11:20:34PM +0200, SZEDER Gábor wrote: > > Would we perhaps want to give the user a hint that the object is not > > really missing, but rather that we're not in a repository? E.g., > > something like: > > > > if (!have_git_dir()) > > return strbuf_addf_ret(err, -1,

Re: [PATCH] ref-filter: don't look for objects when outside of a repository

2018-09-24 Thread SZEDER Gábor
On Mon, Sep 24, 2018 at 02:17:22PM -0400, Jeff King wrote: > On Sat, Sep 22, 2018 at 04:11:45PM +0200, SZEDER Gábor wrote: > > diff --git a/ref-filter.c b/ref-filter.c > > index e1bcb4ca8a..3555bc29e7 100644 > > --- a/ref-filter.c > > +++ b/ref-filter.c > > @@ -1473,7 +1473,8 @@ static int

Re: [PATCH] ref-filter: don't look for objects when outside of a repository

2018-09-24 Thread Jeff King
On Sat, Sep 22, 2018 at 04:11:45PM +0200, SZEDER Gábor wrote: > The command 'git ls-remote --sort=authordate ' segfaults when > run outside of a repository, ever since the introduction of its > '--sort' option in 1fb20dfd8e (ls-remote: create '--sort' option, > 2018-04-09). > > While in general

Re: [PATCH] ref-filter: don't look for objects when outside of a repository

2018-09-24 Thread Junio C Hamano
SZEDER Gábor writes: > The command 'git ls-remote --sort=authordate ' segfaults when > run outside of a repository, ever since the introduction of its > '--sort' option in 1fb20dfd8e (ls-remote: create '--sort' option, > 2018-04-09). > > While in general the 'git ls-remote' command can be run

[PATCH] ref-filter: don't look for objects when outside of a repository

2018-09-22 Thread SZEDER Gábor
The command 'git ls-remote --sort=authordate ' segfaults when run outside of a repository, ever since the introduction of its '--sort' option in 1fb20dfd8e (ls-remote: create '--sort' option, 2018-04-09). While in general the 'git ls-remote' command can be run outside of a repository just fine,