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

git-whatchanged: exit out early on errors

From
Linus Torvalds <torvalds@osdl.org>
Date
Jan 25, 2006, 22:02 UTC
Message-ID
<Pine.LNX.4.64.0601251700540.2644@evo.osdl.org>
In-Reply-To
<Pine.LNX.4.64.0601251655580.2644@evo.osdl.org>
If we get an error parsing the arguments, exit.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
---

This goes together with the previous diff - it just makes git-whatchanged exit gracefully when git-rev-parse errors out.

diff --git a/git-whatchanged.sh b/git-whatchanged.sh
index 80e2500..d4f985b 100755
--- a/git-whatchanged.sh
+++ b/git-whatchanged.sh
@@ -4,7 +4,7 @@ USAGE='[-p] [--max-count=<n>] [<since>..
 SUBDIRECTORY_OK='Yes'
 . git-sh-setup
 
-diff_tree_flags=$(git-rev-parse --sq --no-revs --flags "$@")
+diff_tree_flags=$(git-rev-parse --sq --no-revs --flags "$@") || exit
 test -z "$diff_tree_flags" &&
 	diff_tree_flags=$(git-repo-config --get whatchanged.difftree)
 test -z "$diff_tree_flags" &&
Previous: Linus TorvaldsNext: Junio C Hamano
Message 2 of 3 in “Make git-rev-list and git-rev-parse argument parsing stricter”
  1. Linus TorvaldsJan 25, 2006
  2. git-whatchanged: exit out early on errorsLinus Torvalds, Jan 25, 2006
  3. Junio C HamanoJan 25, 2006

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.