git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Multiple paths in GIT_EXEC_PATH
@ 2017-10-17 15:21 Nikolay Yakimov
  2017-10-17 15:56 ` Kevin Daudt
  2017-10-24 20:12 ` Dennis Kaarsemaker
  0 siblings, 2 replies; 4+ messages in thread
From: Nikolay Yakimov @ 2017-10-17 15:21 UTC (permalink / raw)
  To: git

Hello. After updating to a recent git release (2.14, I believe, but
possibly earlier), setting GIT_EXEC_PATH to multiple directories
stopped working. It did work before, and I believe the culprit is
'git-sh-setup', which uses 'git --exec-path' output directly, while
most other git components observe PATH syntax, i.e. multiple paths
with colon separator. Is this intended, or is it an oversight?

For why I need that is another matter. Long story short, I need git to
look for '.gitignore' in a particular non-standard location, since I
have multiple git repositories in the same workdir (that workdir being
$HOME and git repositories being stores for my different configs)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Multiple paths in GIT_EXEC_PATH
  2017-10-17 15:21 Multiple paths in GIT_EXEC_PATH Nikolay Yakimov
@ 2017-10-17 15:56 ` Kevin Daudt
  2017-10-17 21:08   ` Junio C Hamano
  2017-10-24 20:12 ` Dennis Kaarsemaker
  1 sibling, 1 reply; 4+ messages in thread
From: Kevin Daudt @ 2017-10-17 15:56 UTC (permalink / raw)
  To: Nikolay Yakimov; +Cc: git, Anders Kaseorg

On Tue, Oct 17, 2017 at 06:21:22PM +0300, Nikolay Yakimov wrote:
> Hello. After updating to a recent git release (2.14, I believe, but
> possibly earlier), setting GIT_EXEC_PATH to multiple directories
> stopped working. It did work before, and I believe the culprit is
> 'git-sh-setup', which uses 'git --exec-path' output directly, while
> most other git components observe PATH syntax, i.e. multiple paths
> with colon separator. Is this intended, or is it an oversight?
> 
> For why I need that is another matter. Long story short, I need git to
> look for '.gitignore' in a particular non-standard location, since I
> have multiple git repositories in the same workdir (that workdir being
> $HOME and git repositories being stores for my different configs)

The commit that changed what you described is 1073094f3 (git-sh-setup:
be explicit where to dot-source git-sh-i18n from., 2016-10-29). That
commit claims there were already scripts that assumed GIT_EXEC_PATH is
just a single entry. That commit was included in v2.11.

There was also a recent thread[0] about it that discussed this issue,
where someone stated that indeed treating GIT_EXEC_PATH with the same
semantics as PATH has been broken for a while, but it seems there are no
real plans to fix it.

[0]:https://public-inbox.org/git/20170928223134.GA30744@varnish/



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Multiple paths in GIT_EXEC_PATH
  2017-10-17 15:56 ` Kevin Daudt
@ 2017-10-17 21:08   ` Junio C Hamano
  0 siblings, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2017-10-17 21:08 UTC (permalink / raw)
  To: Kevin Daudt; +Cc: Nikolay Yakimov, git, Anders Kaseorg

Kevin Daudt <me@ikke.info> writes:

> The commit that changed what you described is 1073094f3 (git-sh-setup:
> be explicit where to dot-source git-sh-i18n from., 2016-10-29). That
> commit claims there were already scripts that assumed GIT_EXEC_PATH is
> just a single entry. That commit was included in v2.11.
>
> There was also a recent thread[0] about it that discussed this issue,
> where someone stated that indeed treating GIT_EXEC_PATH with the same
> semantics as PATH has been broken for a while, but it seems there are no
> real plans to fix it.

The variable was never meant to have more than one path concatenated
with ':' from day one.

In C code we've used it as a leading directory path to tack a
command name to form a path to give to exec(3), without any
intention to have it a list of paths, which is split at ':'.
sh-setup was doing "PATH=$GIT_EXEC_PATH:$PATH" without rejecting a
value in GIT_EXEC_PATH with a colon in it but that was merely being
lazy and made it "work" by accident.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Multiple paths in GIT_EXEC_PATH
  2017-10-17 15:21 Multiple paths in GIT_EXEC_PATH Nikolay Yakimov
  2017-10-17 15:56 ` Kevin Daudt
@ 2017-10-24 20:12 ` Dennis Kaarsemaker
  1 sibling, 0 replies; 4+ messages in thread
From: Dennis Kaarsemaker @ 2017-10-24 20:12 UTC (permalink / raw)
  To: Nikolay Yakimov, git

On Tue, 2017-10-17 at 18:21 +0300, Nikolay Yakimov wrote:
> For why I need that is another matter. Long story short, I need git to
> look for '.gitignore' in a particular non-standard location, since I
> have multiple git repositories in the same workdir (that workdir being
> $HOME and git repositories being stores for my different configs)

That is solvable without needing multiple directories in
$GIT_EXEC_PATH. vcsh, which also solves the 'multiple repos with same
workdir' problem in a very thin wrapper around git, does this by
setting core.excludesfile in the per repo config to a unique path.

hurricane:~$ vcsh dotfiles config core.excludesfile
.gitignore.d/dotfiles
hurricane:~$ vcsh secrets config core.excludesfile
.gitignore.d/secrets

D.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-10-24 20:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-17 15:21 Multiple paths in GIT_EXEC_PATH Nikolay Yakimov
2017-10-17 15:56 ` Kevin Daudt
2017-10-17 21:08   ` Junio C Hamano
2017-10-24 20:12 ` Dennis Kaarsemaker

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).