Re: [PATCH v5 1/1] send-email: Add sendmail email aliases format
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 25, 2015, 16:32 UTC
- Message-ID
- <xmqqpp5obotk.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <CAJ80sas_D-6z4MvuFvvjoX7U_bM6b3brCo4rvYFCUfTmKS=6bA@mail.gmail.com>
Allen Hubbe <allenbh@gmail.com> writes:
> Looking closer at this and the other test cases, they are inconsistent > about using ".mailrc", "~/.mailrc", and "$(pwd)/.mailrc". This would > add another one, "$HOME/.mailrc".
In t9001, I see two tests on mailrc:
* Create .mailrc in the current directory and point at it from the configuration file sendemail.aliasfile with $(pwd)/.mailrc
This one is correct in that test wants to make sure an absolute path is usable as the value; the creation in the current directory (hence >.mailrc) is a mere implementation detail that the file it wants to use can be created by pathname relative to the current directory when "echo" is run.
* Create ~/.mailrc, relying on tilde expansion of the shell when "echo" is run, and then point at it from the configuration file as "~/.mailrc".
The former, i.e. "echo ... >~/.mailrc" should instead redirect into >$HOME/.mailrc in order to support shells that do not understand tilde expansion. However, the latter is correct, as this test wants to make sure that whoever reads the configuration interprets ~/.mailrc as "file .mailrc in the home directory", without help from the shell.
Specifically, the difference between these two tests is not inconcistency; they are covering two different use patterns.
So I do not see any reason to change most of these; except that the target of 'echo' should be changed from ~/.mailrc to $HOME/.mailrc.
Thanks.