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

[PATCH] git-revert: Fix die before git-sh-setup defines it.

From
Bob Proulx <bob@proulx.com>
Date
Jan 12, 2007, 06:45 UTC
Message-ID
<20070112064538.GA3012@dementia.proulx.com>

The code previously checked it's own name and called 'die' upon an error. However 'die' was not yet defined because git-sh-setup had not been sourced yet. Instead simply write the error message to stderr and exit with an error as was originally desired.

Signed-off-by: Bob Proulx <bob@proulx.com>
---

I found this by inspection. I contemplated several different ways of resolving it but in the end the simplest seemed to be the best.

 git-revert.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-revert.sh b/git-revert.sh
index 50cc47b..5ca894a 100755
--- a/git-revert.sh
+++ b/git-revert.sh
@@ -16,7 +16,7 @@ case "$0" in
 	me=cherry-pick
 	USAGE='[--edit] [-n] [-r] [-x] <commit-ish>'  ;;
 * )
-	die "What are you talking about?" ;;
+	echo "What are you talking about?" 1>&2 ; exit 1 ;;
 esac
 . git-sh-setup
 
-- 
1.4.0
Message 1 of 1 in “git-revert: Fix die before git-sh-setup defines it.”
  1. git-revert: Fix die before git-sh-setup defines it.Bob Proulx, Jan 12, 2007

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.