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

[PATCH] git-rebase.sh: Display error output from git-checkout when detaching HEAD fails.

From
RSRobert Shearman <robertshearman@gmail.com>
Date
Jul 11, 2008, 21:26 UTC
Message-ID
<1215811619-28512-1-git-send-email-robertshearman@gmail.com>
The "git checkout" command executed could fail if, for example, upstream contains a file that would overrwrite a local, untracked file. The output redirection didn't work as stderr was redirected to /dev/null, as was stdout. This appears to be not what was intended so the order of redirections is fixed so that stderr is redirected to stdout instead.
---
 git-rebase.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-rebase.sh b/git-rebase.sh
index e2d85ee..0da2210 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -376,7 +376,7 @@ fi
 
 # Detach HEAD and reset the tree
 echo "First, rewinding head to replay your work on top of it..."
-git checkout "$onto^0" >/dev/null 2>&1 ||
+git checkout "$onto^0" 2>&1 >/dev/null ||
 	die "could not detach HEAD"
 # git reset --hard "$onto^0"
 
-- 
1.5.6.2.225.g4596.dirty
Next: Junio C Hamano
Message 1 of 4 in “git-rebase.sh: Display error output from git-checkout when detaching HEAD fails.”
  1. git-rebase.sh: Display error output from git-checkout when detaching HEAD fails.Robert Shearman, Jul 11, 2008
  2. Junio C HamanoJul 11, 2008
  3. Rob ShearmanJul 14, 2008
  4. Junio C HamanoJul 15, 2008

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.