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

[PATCH 2/3] cg-admin-rewritehist: catch errors in -r argument early

From
Yann Dirson <ydirson@altern.org>
Date
Jun 11, 2006, 12:04 UTC
Message-ID
<20060611120457.12116.81253.stgit@gandelf.nowhere.earth>
In-Reply-To
<20060611120431.12116.74005.stgit@gandelf.nowhere.earth>
Signed-off-by: Yann Dirson <ydirson@altern.org>
---
 cg-admin-rewritehist |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/cg-admin-rewritehist b/cg-admin-rewritehist
index fe3f210..7cbdb30 100755
--- a/cg-admin-rewritehist
+++ b/cg-admin-rewritehist
@@ -154,6 +154,8 @@ while optparse; do
 	if optparse -d=; then
 		tempdir="$OPTARG"
 	elif optparse -r=; then
+		git-rev-parse "$OPTARG" >/dev/null || die "Unknown revision '$OPTARG'"
+		git-rev-parse "$OPTARG^" >/dev/null || die "Revision '$OPTARG' does not have parents, check what you really want"
 		startrev="^$OPTARG^ $OPTARG $startrev"
 		startrevparents="$OPTARG $startrevparents"
 	elif optparse --env-filter=; then
Previous: Yann DirsonNext: Yann Dirson
Message 2 of 4 in “cg-admin-rewritehist: catch git-rev-list returning no commit”
  1. 1/3 cg-admin-rewritehist: catch git-rev-list returning no commitYann Dirson, Jun 11, 2006
  2. 2/3 cg-admin-rewritehist: catch errors in -r argument earlyYann Dirson, Jun 11, 2006
  3. 3/3 cg-admin-rewritehist: seed the map with the parent of the -r arg, not with itselfYann Dirson, Jun 11, 2006
  4. Petr BaudisJun 17, 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.