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

Re: [PATCH v5 1/1] send-email: Add sendmail email aliases format

From
Junio C Hamano <gitster@pobox.com>
Date
May 25, 2015, 21:12 UTC
Message-ID
<xmqq1ti4bbu0.fsf@gitster.dls.corp.google.com>
In-Reply-To
<xmqqpp5obotk.fsf@gitster.dls.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 10 quoted lines
> 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:
> ...
> 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.

FYI, I have tentatively queued this on top of your patch. Please see "git log master..cf954075" to double check.

Thanks.
-- >8 --
Subject: [PATCH] t9001: write $HOME/, not ~/, to help shells without tilde expansion

Even though it is in POSIX, we do not have to use it, only to hurt shells that may lack the support.

The .mailrc test tries to define an alias in .mailrc in the home directory by shell redirection, and then tries to see ~/.mailrc in config is tilde-expanded by Git without help from shell. So the creation should become $HOME/ to be portable for shells that may lack tilde expansion but the reference should be done as "~/.mailrc".

The sendmail one refers to the file from the configuration with full path, so it does not need to know that $HOME during the test run is set to the current "trash" directory.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 t/t9001-send-email.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index b04d263..c5c6867 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -1537,7 +1537,7 @@ test_expect_success $PREREQ 'sendemail.aliasfiletype=mailrc' '
 
 test_expect_success $PREREQ 'sendemail.aliasfile=~/.mailrc' '
 	clean_fake_sendmail &&
-	echo "alias sbd  someone@example.org" >~/.mailrc &&
+	echo "alias sbd  someone@example.org" >"$HOME/.mailrc" &&
 	git config --replace-all sendemail.aliasesfile "~/.mailrc" &&
 	git config sendemail.aliasfiletype mailrc &&
 	git send-email \
@@ -1552,7 +1552,7 @@ test_expect_success $PREREQ 'sendemail.aliasfile=~/.mailrc' '
 test_expect_success $PREREQ 'sendemail.aliasfiletype=sendmail' '
 	clean_fake_sendmail && rm -fr outdir &&
 	git format-patch -1 -o outdir &&
-	cat >>~/.tmp-email-aliases <<-\EOF &&
+	cat >>./.tmp-email-aliases" <<-\EOF &&
 	alice: Alice W Land <awol@example.com>
 	bob: Robert Bobbyton <bob@example.com>
 	# this is a comment
-- 
2.4.1-455-ga49e496
Previous: Junio C HamanoNext: Junio C Hamano
Message 9 of 20 in “send-email: Add sendmail email aliases format”
  1. 1/1 send-email: Add sendmail email aliases formatAllen Hubbe, May 23, 2015
  2. Junio C HamanoMay 23, 2015
  3. Junio C HamanoMay 23, 2015
  4. Allen HubbeMay 23, 2015
  5. Junio C HamanoMay 23, 2015
  6. Allen HubbeMay 23, 2015
  7. Allen HubbeMay 25, 2015
  8. Junio C HamanoMay 25, 2015
  9. Junio C HamanoMay 25, 2015
  10. Junio C HamanoMay 25, 2015
  11. Allen HubbeMay 26, 2015
  12. Junio C HamanoMay 26, 2015
  13. Allen HubbeMay 26, 2015
  14. Junio C HamanoMay 26, 2015
  15. Junio C HamanoMay 26, 2015
  16. Eric SunshineMay 26, 2015
  17. Eric SunshineMay 26, 2015
  18. Allen HubbeMay 26, 2015
  19. Eric SunshineMay 26, 2015
  20. Allen HubbeMay 26, 2015

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.