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

[PATCH] Improved error message from git-rebase

From
=?utf-8?q?David_K=C3=A5gedal?= <davidk@lysator.liu.se>
Date
Jan 31, 2007, 16:12 UTC
Message-ID
<873b5r2mya.fsf@morpheus.local>
If the index wasn't clean, git-rebase would simply show the output from
git-diff-index with no further comment to the user.
---
 git-rebase.sh |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

git-rebase sometimes fails without giving a useful error message. Try this:

  $ touch asdf
  $ git add asdf
  $ git rebase origin/master
  A       asdf
  $ 
diff --git a/git-rebase.sh b/git-rebase.sh
index 99cedad..9d2f71d 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -249,7 +249,8 @@ fi
 git-update-index --refresh || exit
 diff=$(git-diff-index --cached --name-status -r HEAD)
 case "$diff" in
-?*)	echo "$diff"
+?*)	echo "cannot rebase: your index is not up-to-date"
+	echo "$diff"
 	exit 1
 	;;
 esac
-- 
1.5.0.rc2.86.gf4f4f-dirty


-- 
David Kågedal
Message 1 of 1 in “Improved error message from git-rebase”
  1. Improved error message from git-rebase=?utf-8?q?David_K=C3=A5gedal?=, Jan 31, 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.