Re: [PATCH v3 2/5] setup: allow for prefix to be passed to git commands

2017-03-28 Thread Stefan Beller
On Mon, Mar 20, 2017 at 3:34 PM, Brandon Williams wrote: > That the gist of how I'm hoping to solve the problem. Hopefully that was > clear enough to get some feedback on. Junio wrote in "What's cooking in git.git (Mar 2017, #10; Fri, 24)" > I saw no particular issues myself. Do others find th

Re: [PATCH v3 2/5] setup: allow for prefix to be passed to git commands

2017-03-21 Thread Junio C Hamano
Brandon Williams writes: > Yes, the prefix that is found during setup of a submodule process would > be NULL or "" as the command would be invoked from the root of that > repository. This series would sort of change that though. OK, because you (eh, rather your caller) do not adjust pathnames a

Re: [PATCH v3 2/5] setup: allow for prefix to be passed to git commands

2017-03-20 Thread Brandon Williams
On 03/17, Junio C Hamano wrote: > Brandon Williams writes: > > > I don't think that prefix can ever have ".." in it. From what I > > understand it is always a path from the root of the repository to the > > cwd that the git command was invoked by. So in your example prefix > > would be "src/".

Re: [PATCH v3 2/5] setup: allow for prefix to be passed to git commands

2017-03-17 Thread Junio C Hamano
Brandon Williams writes: > I don't think that prefix can ever have ".." in it. From what I > understand it is always a path from the root of the repository to the > cwd that the git command was invoked by. So in your example prefix > would be "src/". The prefix would be NULL or "", as you will

Re: [PATCH v3 2/5] setup: allow for prefix to be passed to git commands

2017-03-17 Thread Brandon Williams
On 03/17, Junio C Hamano wrote: > Brandon Williams writes: > > > ... I was being cautious with this patch since git didn't currently > > read GIT_PREFIX. > > Ahh, I forgot about that. Processes we spawn do expect GIT_PREFIX > to tell them where the original $cwd was and they also do expect > t

Re: [PATCH v3 2/5] setup: allow for prefix to be passed to git commands

2017-03-17 Thread Junio C Hamano
Brandon Williams writes: > ... I was being cautious with this patch since git didn't currently > read GIT_PREFIX. Ahh, I forgot about that. Processes we spawn do expect GIT_PREFIX to tell them where the original $cwd was and they also do expect that "git" invoked by them would not be affected

Re: [PATCH v3 2/5] setup: allow for prefix to be passed to git commands

2017-03-17 Thread Brandon Williams
On 03/17, Junio C Hamano wrote: > Stefan Beller writes: > > >> prefix = setup_git_directory_gently_1(nongit_ok); > >> + env_prefix = getenv(GIT_TOPLEVEL_PREFIX_ENVIRONMENT); > >> + > >> + if (env_prefix) > >> + prefix = env_prefix; > >> + > >> if (prefix)

Re: [PATCH v3 2/5] setup: allow for prefix to be passed to git commands

2017-03-17 Thread Brandon Williams
On 03/17, Stefan Beller wrote: > > prefix = setup_git_directory_gently_1(nongit_ok); > > + env_prefix = getenv(GIT_TOPLEVEL_PREFIX_ENVIRONMENT); > > + > > + if (env_prefix) > > + prefix = env_prefix; > > + > > if (prefix) > > setenv(GIT_PREF

Re: [PATCH v3 2/5] setup: allow for prefix to be passed to git commands

2017-03-17 Thread Stefan Beller
On Fri, Mar 17, 2017 at 12:08 PM, Brandon Williams wrote: > On 03/17, Stefan Beller wrote: >> > prefix = setup_git_directory_gently_1(nongit_ok); >> > + env_prefix = getenv(GIT_TOPLEVEL_PREFIX_ENVIRONMENT); >> > + >> > + if (env_prefix) >> > + prefix = env_prefix;

Re: [PATCH v3 2/5] setup: allow for prefix to be passed to git commands

2017-03-17 Thread Brandon Williams
On 03/17, Stefan Beller wrote: > On Fri, Mar 17, 2017 at 12:08 PM, Brandon Williams wrote: > > On 03/17, Stefan Beller wrote: > >> > prefix = setup_git_directory_gently_1(nongit_ok); > >> > + env_prefix = getenv(GIT_TOPLEVEL_PREFIX_ENVIRONMENT); > >> > + > >> > + if (env_prefix

Re: [PATCH v3 2/5] setup: allow for prefix to be passed to git commands

2017-03-17 Thread Junio C Hamano
Stefan Beller writes: >> prefix = setup_git_directory_gently_1(nongit_ok); >> + env_prefix = getenv(GIT_TOPLEVEL_PREFIX_ENVIRONMENT); >> + >> + if (env_prefix) >> + prefix = env_prefix; >> + >> if (prefix) >> setenv(GIT_PREFIX_ENVIRONMENT,

Re: [PATCH v3 2/5] setup: allow for prefix to be passed to git commands

2017-03-17 Thread Stefan Beller
> prefix = setup_git_directory_gently_1(nongit_ok); > + env_prefix = getenv(GIT_TOPLEVEL_PREFIX_ENVIRONMENT); > + > + if (env_prefix) > + prefix = env_prefix; > + > if (prefix) > setenv(GIT_PREFIX_ENVIRONMENT, prefix, 1); so we load that GI

[PATCH v3 2/5] setup: allow for prefix to be passed to git commands

2017-03-17 Thread Brandon Williams
In a future patch child processes which act on submodules need a little more context about the original command that was invoked. This patch teaches git to use the prefix stored in `GIT_INTERNAL_TOPLEVEL_PREFIX` instead of the prefix that was potentally found during the git directory setup process