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

[PATCH v3 1/2] git-am: emit usage when called w/o arguments and w/o patch on stdin

From
Jay Soffian <jaysoffian@gmail.com>
Date
Jan 28, 2009, 15:03 UTC
Message-ID
<1233154990-19745-1-git-send-email-jaysoffian@gmail.com>

When git am is called w/o arguments, w/o a patch on stdin and the user hits ctrl-c, it leaves behind a partially populated $dotest directory. After this commit, it emits usage when called w/o arguments and w/o a patch on stdin.

Noticed by Sverre Rabbelier
Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
---
Change from v2: make Junio happy by no longer removing $dotest if git-am is
interupted while mailsplit is running.
 git-am.sh |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/git-am.sh b/git-am.sh
index b1c05c9..92a64b2 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -254,6 +254,7 @@ else
 		done
 		shift
 	fi
+	test $# = 0 && test -t 0 && usage
 	git mailsplit -d"$prec" -o"$dotest" -b -- "$@" > "$dotest/last" ||  {
 		rm -fr "$dotest"
 		exit 1
-- 
1.6.1.224.gb56c
Next: Jay Soffian
Message 1 of 9 in “git-am: emit usage when called w/o arguments and w/o patch on stdin”
  1. 1/2 git-am: emit usage when called w/o arguments and w/o patch on stdinJay Soffian, Jan 28, 2009
  2. 2/2 git-am: minor cleanupsJay Soffian, Jan 28, 2009
  3. Pieter de BieJan 28, 2009
  4. Jay SoffianJan 28, 2009
  5. Junio C HamanoJan 28, 2009
  6. Jay SoffianJan 28, 2009
  7. Sverre RabbelierJan 28, 2009
  8. Jeff KingJan 28, 2009
  9. Junio C HamanoJan 28, 2009

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.