Re: more concerns about '--git-dir'
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 23, 2014, 19:23 UTC
- Message-ID
- <xmqq1tvkjo4c.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <CAKpPgvf_UfgtOkotPz+aF4=UqQTOmk0O8tXg4Cm3zjzFimUoHw@mail.gmail.com>
Pasha Bolokhov <pasha.bolokhov@gmail.com> writes:
Show 15 quoted lines
> 1) an apparent missing "normalize_path(git_dir)", when GIT_DIR is an > absolute path: > > don't even need to name the repository anything different, but run this command: > > $ cd ~/tmp/ > $ git init > $ git --git-dir=$HOME/tmp/../tmp/./././.git --work-tree=$HOME/tmp/../tmp/ status > > You won't notice anything different in the output of course, but the > environment will be odd: > GIT_DIR=../tmp/./././.git > GIT_WORK_TREE=$HOME/tmp > Notice how the work-tree has been normalized and git-dir hasn't. It's > kinda hard to imagine when this can lead to an error, but never know.
I think this one is in the "if it hurts, don't do it then" territory.
> Would there be objections to fixing this?
As long as it can be cleanly done without penalizing sane usage, I do not think there will be.
Show 6 quoted lines
> 2) "git --git-dir=meta status" complains: > > $ git --git-dir=meta init > $ git --git-dir=meta status > > yells that work-tree isn't setup and denies to run.
Is that because meta/config does not say where the worktree is?
Again, this smells like "if it hurts, don't do it then", even more so than the previous one. Does it help if you add --git-work-tree to the command line, too?