Re: [PATCH] setup.c: set workdir when gitdir is not default

2014-09-04 Thread Max Kirillov
On Thu, Sep 04, 2014 at 06:44:08AM -0400, Eric Sunshine wrote: > > + mkdir -p subdir && > > + cd subdir && > > + git testalias > > If a new test is added following this one, it will be run from within > 'subdir', which might come as a surprise as the author of the new > test. Wra

Re: [PATCH] setup.c: set workdir when gitdir is not default

2014-09-04 Thread Max Kirillov
On Thu, Sep 04, 2014 at 05:53:34PM +0700, Duy Nguyen wrote: > On Thu, Sep 4, 2014 at 5:42 AM, Max Kirillov wrote: >> /* #0, #1, #5, #8, #9, #12, #13 */ >> set_git_work_tree("."); > > I wonder if we should setenv(GIT_WORK_TREE_) from inside this function > instead. A quick glance o

Re: [PATCH] setup.c: set workdir when gitdir is not default

2014-09-04 Thread Duy Nguyen
On Thu, Sep 4, 2014 at 5:42 AM, Max Kirillov wrote: > diff --git a/setup.c b/setup.c > index 0a22f8b..bcf4e31 100644 > --- a/setup.c > +++ b/setup.c > @@ -508,8 +508,10 @@ static const char *setup_discovered_git_dir(const char > *gitdir, > > /* #0, #1, #5, #8, #9, #12, #13 */ > se

Re: [PATCH] setup.c: set workdir when gitdir is not default

2014-09-04 Thread Eric Sunshine
On Wed, Sep 3, 2014 at 6:42 PM, Max Kirillov wrote: > When gitfile is used, git sets GIT_DIR environment variable for > subsequent commands, and that commands start working in mode "GIT_DIR > set, workdir current", which is incorrect for the case when git runs > from subdirectory of repository. Th

[PATCH] setup.c: set workdir when gitdir is not default

2014-09-03 Thread Max Kirillov
When gitfile is used, git sets GIT_DIR environment variable for subsequent commands, and that commands start working in mode "GIT_DIR set, workdir current", which is incorrect for the case when git runs from subdirectory of repository. This can be observed at least for running aliases - git fails w