Re: [PATCH v2 8/8] Use the early config machinery to expand aliases

2017-06-13 Thread Jeff King
On Tue, Jun 13, 2017 at 01:25:53PM +0200, Johannes Schindelin wrote: > > But couldn't we just unconditionally do: > > > > setup_git_directory_gently(); > > But of course we can do that! Why on earth did I not think of that... > > Will change the code accordingly. Thanks. I was really worried

Re: [PATCH v2 8/8] Use the early config machinery to expand aliases

2017-06-13 Thread Johannes Schindelin
Hi Peff, On Sat, 10 Jun 2017, Jeff King wrote: > On Thu, Jun 08, 2017 at 09:53:53PM +0200, Johannes Schindelin wrote: > > > @@ -245,36 +201,37 @@ static int handle_options(const char ***argv, int > > *argc, int *envchanged) > > > > static int handle_alias(int *argcp, const char ***argv) > >

Re: [PATCH v2 8/8] Use the early config machinery to expand aliases

2017-06-12 Thread Junio C Hamano
Jeff King writes: > On Sat, Jun 10, 2017 at 06:07:30AM -0400, Jeff King wrote: > >> But couldn't we just unconditionally do: >> >> setup_git_directory_gently(); >> >> here to move into the top-level if there is one, without caring about >> cdup_dir at all? > > IOW, drop your patch 4, and then

Re: [PATCH v2 8/8] Use the early config machinery to expand aliases

2017-06-10 Thread Jeff King
On Sat, Jun 10, 2017 at 06:07:30AM -0400, Jeff King wrote: > But couldn't we just unconditionally do: > > setup_git_directory_gently(); > > here to move into the top-level if there is one, without caring about > cdup_dir at all? IOW, drop your patch 4, and then squash patches 7 and 8 into thi

Re: [PATCH v2 8/8] Use the early config machinery to expand aliases

2017-06-10 Thread Jeff King
On Thu, Jun 08, 2017 at 09:53:53PM +0200, Johannes Schindelin wrote: > @@ -245,36 +201,37 @@ static int handle_options(const char ***argv, int > *argc, int *envchanged) > > static int handle_alias(int *argcp, const char ***argv) > { > + struct strbuf cdup_dir = STRBUF_INIT; > int en

[PATCH v2 8/8] Use the early config machinery to expand aliases

2017-06-08 Thread Johannes Schindelin
We already taught alias_lookup() to use the early config if the .git/ directory was not yet discovered, of course, however, since we called setup_git_directory_gently() before expanding the alias (if any), we only used the early config code path only if outside of any Git-managed directory. With t