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

Re: [RFC/PATCH] git: expand user path in --git-dir

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Sep 25, 2012, 07:27 UTC
Message-ID
<50615CF3.2010802@drmicha.warpmail.net>
In-Reply-To
<alpine.LNX.2.01.1209250732150.25195@nerf07.vanv.qr>
Jan Engelhardt venit, vidit, dixit 25.09.2012 07:33:
Show 18 quoted lines
> 
> On Monday 2012-09-24 14:57, Michael J Gruber wrote:
> 
>> Currently, all paths in the config file are subject to tilde expansion
>> for user paths while the argument to --git-dir is not expanded, and
>> neither are paths in the environment such as GIT_DIR. From the user
>> perspective, though, the two commands
>>
>> GIT_DIR=~user/foo git command
>> git --git-dir=~user/foo command
>>
>> currently behave differently because in the first case the shell would
>> perform tilde expansion, but not in the second.
> 
> If git uses a standardized option logic (getopt-like) which accepts
> both '=' and (new argument) for long options, you could easily do
> 
> 	git --git-dir ~user/foo command

Of course, but wouldn't it be even more confusing if tilde expansion "is done" for "--git-dir ~user/foo" but not "--git-dir=~user/foo"?

That confusion is all bash's "fault" since "is done" == "is done by bash" (or not), but still.

Michael
Previous: Jan EngelhardtNext: Andreas Schwab
Message 11 of 17 in “GIT_DIR vs. --git-dir”
  1. Michael J GruberSep 24, 2012
  2. Nguyen Thai Ngoc DuySep 24, 2012
  3. Michael J GruberSep 24, 2012
  4. Nguyen Thai Ngoc DuySep 24, 2012
  5. Michael J GruberSep 24, 2012
  6. git: expand user path in --git-dirMichael J Gruber, Sep 24, 2012
  7. Jeff KingSep 24, 2012
  8. Michael J GruberSep 24, 2012
  9. Junio C HamanoSep 24, 2012
  10. Jan EngelhardtSep 25, 2012
  11. Michael J GruberSep 25, 2012
  12. Andreas SchwabSep 24, 2012
  13. Junio C HamanoSep 24, 2012
  14. Michael J GruberSep 24, 2012
  15. Jeff KingSep 24, 2012
  16. Michael J GruberSep 24, 2012
  17. Andreas SchwabSep 24, 2012

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.