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=~/.bashrcThe patch does not fix anything and not necessary.