git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [BUG?] Weird interaction between `git -C`, aliases and worktrees

From
Jeff King <peff@peff.net>
Date
Oct 16, 2020, 00:23 UTC
Message-ID
<20201016002354.GA2932796@coredump.intra.peff.net>
In-Reply-To
<88D2A179-806F-4321-828A-359692E646B1@gmail.com>
On Wed, Oct 14, 2020 at 06:35:39PM -0400, Philippe Blain wrote:
Show 16 quoted lines
> I found two threads [2] and [3] which are manifestations of similar (or the same ?) problems...
> 
> Maybe git-config(1) could document which variables will 
> be set in aliases that shell out, but even that might be tricky because it
> seems the answer is "it depends" (according to [2])...
> 
> I also found 57ea7123c8 (git.c: make sure we do not 
> leak GIT_* to alias scripts, 2015-12-20), in topic 'nd/clear-gitenv-upon-use-of-alias',
> which tries to clear out GIT_* variables from aliases environment,
> which I guess is defeated by the fact that I run `git -C` in my alias...
> 
> Anyway thanks for your answer.
> 
> [1] https://git-scm.com/docs/git#Documentation/git.txt---git-dirltpathgt
> [2] https://lore.kernel.org/git/20200130102933.GE840531@coredump.intra.peff.net/
> [3] https://lore.kernel.org/git/20200228190218.GC1408759@coredump.intra.peff.net/

IMHO it is still worth doing a fix similar to what I wrote earlier. But somebody needs to figure out what's up with the failure in t5601:

 - whether it's a behavior that has to be kept, or if it's something we can
   deprecate or just publicly warn about
 - if kept, can we work around it internally within git-clone /
   git-init? If not, can we work around it with an extra environment
   variable?

I probably won't look at it anytime soon, but I'd be happy if somebody else did. :)

-Peff
Previous: Philippe Blain
Message 4 of 4 in “[BUG?] Weird interaction between `git -C`, aliases and worktrees”
  1. Philippe BlainOct 14, 2020
  2. Elijah NewrenOct 14, 2020
  3. Philippe BlainOct 14, 2020
  4. Jeff KingOct 16, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.