Re: GIT_DIR vs. --git-dir
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 24, 2012, 14:36 UTC
- Message-ID
- <7vipb31o9x.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <CACsJy8DHGtktnvvziA_+Fp6a4VFsE9_=zkWKNBJU7Ro_QO+==A@mail.gmail.com>
Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
> "~" is a shell feature. Know your shell. If we make an exception for > --git-dir, we might have to support --blahblah=~/somewhere.
Correct but not entirely true.
When we know --git-dir=<path> must name a path, we should be able to do better. See OPT_FILENAME in >parse-optios.h>, for inspiration.
MJG's patch later in this thread is conceptually OK but I do not think it should introduce a "expand and then setenv" helper that won't be useful unless the variable is GIT_DIR. That pattern does not appear that often, and smells like a bad API design taste.