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

Re: [PATCH 1/1] git-config: git-config --list fixed when GIT_CONFIG value starts with ~/

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 14, 2014, 20:10 UTC
Message-ID
<xmqqk32x35nb.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1415989760-20259-1-git-send-email-kuleshovmail@gmail.com>
0xAX <kuleshovmail@gmail.com> writes:
Show 5 quoted lines
> When we execute git config --list and $GIT_CONFIG value starts with home
> prefix - ~/ it produces folowing error - fatal: unable to read config
> file '~/.gitconfig': No such file or directory. This patch fixed it with
> expand_user_path for configuration file path before git-config --list
> call.

Expanding tilde ~ in environment variables is what you let your shell do when you assign it. This is not limited to Git:

    $ FOO=~/.bashrc
    $ BAR='~/.bashrc'
    $ head -n 1 "$FOO"
    # Bourne Again SHell init file.
    $ head -n 1 "$BAR"
    head: cannot open ‘~/.bashrc’ for reading: No such file rdirectory
    $ echo "FOO=$FOO" "BAR=$BAR"
    FOO=/home/gitster/.bashrc BAR=~/.bashrc
The patch does not fix anything and not necessary.
Previous: Jeff King
Message 6 of 6 in “git-config: git-config --list fixed when GIT_CONFIG value starts with ~/”
  1. 1/1 git-config: git-config --list fixed when GIT_CONFIG value starts with ~/0xAX, Nov 14, 2014
  2. Eric SunshineNov 14, 2014
  3. Jeff KingNov 14, 2014
  4. Alex KuleshovNov 14, 2014
  5. Jeff KingNov 14, 2014
  6. Junio C HamanoNov 14, 2014

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.