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

[PATCH v4] rebase: clarify "restore the original branch"

From
Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Date
Jul 14, 2011, 03:47 UTC
Message-ID
<1310615226-3251-1-git-send-email-martin.von.zweigbergk@gmail.com>
In-Reply-To
<1310322661-24924-1-git-send-email-martin.von.zweigbergk@gmail.com>
The description for 'git rebase --abort' currently says:
    Restore the original branch and abort the rebase operation.

The "restore" can be misinterpreted to imply that the original branch was somehow in a broken state during the rebase operation. It is also not completely clear what "the original branch" is --- is it the branch that was checked out before the rebase operation was called or is the the branch that is being rebased (it is the latter)? Although both issues are made clear in the DESCRIPTION section, let us also make the entry in the OPTIONS secion more clear.

Also remove the term "rebasing process" from the usage text, since the user already knows that the text is about "git rebase".

Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
---

While reading some sample output in an unrelated mail from Jeff, I noticed that we actually use "restore" in a few more places (I had originally seached for "abort" to find places to update). This patch fixes those places.

I used the term "check out" instead of "reset HEAD to", because I think the concept feels more familiar to many people, even though "reset HEAD to" is technically more correct.

The phrase "restore the original branch" is also used in git-am, where I think it makes even less sense. I rarely use git-am, but I think it always applies the patches to the current branch, so there "restore the original branch" really means "resets the (current) branch to the original position (where it was when git-am was started)", doesn't it?

 Documentation/git-rebase.txt |    8 ++++++--
 git-rebase.sh                |   10 +++++-----
 2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
index a9e0e50..504945c 100644
--- a/Documentation/git-rebase.txt
+++ b/Documentation/git-rebase.txt
@@ -45,7 +45,7 @@ with a different commit message or timestamp will be skipped).
 It is possible that a merge failure will prevent this process from being
 completely automatic.  You will have to resolve any such merge failure
 and run `git rebase --continue`.  Another option is to bypass the commit
-that caused the merge failure with `git rebase --skip`.  To restore the
+that caused the merge failure with `git rebase --skip`.  To check out the
 original <branch> and remove the .git/rebase-apply working files, use the
 command `git rebase --abort` instead.
 
@@ -232,7 +232,11 @@ leave out at most one of A and B, in which case it defaults to HEAD.
 	Restart the rebasing process after having resolved a merge conflict.
 
 --abort::
-	Restore the original branch and abort the rebase operation.
+	Abort the rebase operation and reset HEAD to the original
+	branch. If <branch> was provided when the rebase operation was
+	started, then HEAD will be reset to <branch>. Otherwise HEAD
+	will be reset to where it was when the rebase operation was
+	started.
 
 --skip::
 	Restart the rebasing process by skipping the current patch.
diff --git a/git-rebase.sh b/git-rebase.sh
index d7855ea..38cbee7 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -13,7 +13,7 @@ It then attempts to create a new commit for each commit from the original
 It is possible that a merge failure will prevent this process from being
 completely automatic.  You will have to resolve any such merge failure
 and run git rebase --continue.  Another option is to bypass the commit
-that caused the merge failure with git rebase --skip.  To restore the
+that caused the merge failure with git rebase --skip.  To check out the
 original <branch> and remove the .git/rebase-apply working files, use the
 command git rebase --abort instead.
 
@@ -57,9 +57,9 @@ whitespace=!       passed to 'git apply'
 ignore-whitespace! passed to 'git apply'
 C=!                passed to 'git apply'
  Actions:
-continue!          continue rebasing process
-abort!             abort rebasing process and restore original branch
-skip!              skip current patch and continue rebasing process
+continue!          continue
+abort!             abort and check out the original branch
+skip!              skip current patch and continue
 "
 . git-sh-setup
 set_reflog_action rebase
@@ -72,7 +72,7 @@ ok_to_skip_pre_rebase=
 resolvemsg="
 When you have resolved this problem run \"git rebase --continue\".
 If you would prefer to skip this patch, instead run \"git rebase --skip\".
-To restore the original branch and stop rebasing run \"git rebase --abort\".
+To check out the original branch and stop rebasing run \"git rebase --abort\".
 "
 unset onto
 strategy=
-- 
1.7.6.51.g07e0e
Previous: Martin von Zweigbergk
Message 10 of 10 in “git-rebase.txt: clarify that --abort checks out <branch>”
  1. 2/2 git-rebase.txt: clarify that --abort checks out <branch>Martin von Zweigbergk, Jul 2, 2011
  2. Drew NorthupJul 5, 2011
  3. Martin von ZweigbergkJul 6, 2011
  4. Jonathan NiederJul 6, 2011
  5. Drew NorthupJul 6, 2011
  6. git-rebase.txt: clarify that --abort checks out <branch>Martin von Zweigbergk, Jul 8, 2011
  7. Junio C HamanoJul 8, 2011
  8. Martin von ZweigbergkJul 10, 2011
  9. git-rebase.txt: clarify that --abort checks out <branch>Martin von Zweigbergk, Jul 10, 2011
  10. rebase: clarify "restore the original branch"Martin von Zweigbergk, Jul 14, 2011

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.