# [PATCH 2/2] git-rebase.txt: clarify that --abort checks out <branch>

10 messages from 2011-07-02 to 2011-07-14. Participants: Martin von Zweigbergk, Drew Northup, Jonathan Nieder, Junio C Hamano.
Thread: https://gitlist.dev/t/27745

## Martin von Zweigbergk, 2011-07-02 02:38

Subject: [PATCH 2/2] git-rebase.txt: clarify that --abort checks out <branch>
Message-ID: <1309574324-6833-1-git-send-email-martin.von.zweigbergk@gmail.com>
URL: https://gitlist.dev/e/1309574324-6833-1-git-send-email-martin.von.zweigbergk%40gmail.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, like so:

    Abort the rebase operation and check out <branch>.

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

This was basically suggested by Jonathan in [1] ('git rebase
--discard'/'git rebase --abort --stay' or whatever it should be
called). Since I have not had much time for Git lately, I thought I
would just post these two patches for now, in case it will take time
before I get a chance to move even the simple work in [1] forward.


 [1] http://thread.gmane.org/gmane.comp.version-control.git/174655/focus=174683



 Documentation/git-rebase.txt |    2 +-
 git-rebase.sh                |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
index a9e0e50..f103eca 100644
--- a/Documentation/git-rebase.txt
+++ b/Documentation/git-rebase.txt
@@ -232,7 +232,7 @@ 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 check out <branch>.
 
 --skip::
 	Restart the rebasing process by skipping the current patch.
diff --git a/git-rebase.sh b/git-rebase.sh
index d7855ea..de419ac 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -58,7 +58,7 @@ ignore-whitespace! passed to 'git apply'
 C=!                passed to 'git apply'
  Actions:
 continue!          continue rebasing process
-abort!             abort rebasing process and restore original branch
+abort!             abort rebasing process and check out <branch>
 skip!              skip current patch and continue rebasing process
 "
 . git-sh-setup
-- 
1.7.5.3.640.gd1066

```

## Drew Northup, 2011-07-05 21:43

Subject: Re: [PATCH 2/2] git-rebase.txt: clarify that --abort checks out <branch>
Message-ID: <1309902196.31762.30.camel@drew-northup.unet.maine.edu>
URL: https://gitlist.dev/e/1309902196.31762.30.camel%40drew-northup.unet.maine.edu
In-Reply-To: <1309574324-6833-1-git-send-email-martin.von.zweigbergk@gmail.com>

```

On Fri, 2011-07-01 at 22:38 -0400, Martin von Zweigbergk wrote:
> 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. 

When you are in the middle of a rebase you _are_not_on_any_branch_. This
is why "Restore the original branch" is used. I have to admit that it
could potentially be clearer, but your solution alas is not.

> 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, like so:
> 
>     Abort the rebase operation and check out <branch>.

So when I rebase I'm really checking out another branch--which, just to
increase confusion, doesn't actually exist? What if there isn't another
branch (rebase -i on a single-branch repo, for instance)? This doesn't
solve the problem.

> 
> Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
> ---
> 
> This was basically suggested by Jonathan in [1] ('git rebase
> --discard'/'git rebase --abort --stay' or whatever it should be
> called). Since I have not had much time for Git lately, I thought I
> would just post these two patches for now, in case it will take time
> before I get a chance to move even the simple work in [1] forward.
> 
> 
>  [1] http://thread.gmane.org/gmane.comp.version-control.git/174655/focus=174683

-- 
-Drew Northup
________________________________________________
"As opposed to vegetable or mineral error?"
-John Pescatore, SANS NewsBites Vol. 12 Num. 59

```

## Martin von Zweigbergk, 2011-07-06 02:19

Subject: Re: [PATCH 2/2] git-rebase.txt: clarify that --abort checks out <branch>
Message-ID: <alpine.DEB.2.00.1107052148370.7799@debian>
URL: https://gitlist.dev/e/alpine.DEB.2.00.1107052148370.7799%40debian
In-Reply-To: <1309902196.31762.30.camel@drew-northup.unet.maine.edu>

```
On Tue, 5 Jul 2011, Drew Northup wrote:

> 
> On Fri, 2011-07-01 at 22:38 -0400, Martin von Zweigbergk wrote:
> > 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. 
> 
> When you are in the middle of a rebase you _are_not_on_any_branch_. This
> is why "Restore the original branch" is used.

Are you saying that something (what?) in "Abort the rebase operation
and check out <branch>." suggests to the user that he/she _is_ on some
branch?

> > 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, like so:
> > 
> >     Abort the rebase operation and check out <branch>.
> 
> So when I rebase I'm really checking out another branch--which, just to
> increase confusion, doesn't actually exist?

Same question as above: what makes it sound like rebase is checking
out another branch?

> What if there isn't another
> branch (rebase -i on a single-branch repo, for instance)? This doesn't
> solve the problem.

That reminds me that <branch> may not have been specified. How about
saying things more explicitly like this?

  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.

Does phrasing it as "reset HEAD to" instead of "check out" also
address your concern about "checking out another branch"?


Martin

```

## Jonathan Nieder, 2011-07-06 02:52

Subject: Re: [PATCH 2/2] git-rebase.txt: clarify that --abort checks out <branch>
Message-ID: <20110706025228.GB10015@elie>
URL: https://gitlist.dev/e/20110706025228.GB10015%40elie
In-Reply-To: <alpine.DEB.2.00.1107052148370.7799@debian>

```
Martin von Zweigbergk wrote:

> That reminds me that <branch> may not have been specified. How about
> saying things more explicitly like this?
>
>   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.

Sounds great to me for what it's worth.  (With the caveat that "git
rebase --abort" reattaches HEAD in addition to what "git reset --hard"
would do, but I think it's fine to just leave that implied.)  Sorry to
have been slow to respond lately.

```

## Drew Northup, 2011-07-06 13:25

Subject: Re: [PATCH 2/2] git-rebase.txt: clarify that --abort checks out <branch>
Message-ID: <1309958707.10212.6.camel@drew-northup.unet.maine.edu>
URL: https://gitlist.dev/e/1309958707.10212.6.camel%40drew-northup.unet.maine.edu
In-Reply-To: <20110706025228.GB10015@elie>

```

On Tue, 2011-07-05 at 21:52 -0500, Jonathan Nieder wrote:
> Martin von Zweigbergk wrote:
> 
> > That reminds me that <branch> may not have been specified. How about
> > saying things more explicitly like this?
> >
> >   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.
> 
> Sounds great to me for what it's worth.  (With the caveat that "git
> rebase --abort" reattaches HEAD in addition to what "git reset --hard"
> would do, but I think it's fine to just leave that implied.)

Agreed, that is better.

-- 
-Drew Northup
________________________________________________
"As opposed to vegetable or mineral error?"
-John Pescatore, SANS NewsBites Vol. 12 Num. 59

```

## Martin von Zweigbergk, 2011-07-08 02:27

Subject: [PATCH v2] git-rebase.txt: clarify that --abort checks out <branch>
Message-ID: <1310092069-19708-1-git-send-email-martin.von.zweigbergk@gmail.com>
URL: https://gitlist.dev/e/1310092069-19708-1-git-send-email-martin.von.zweigbergk%40gmail.com
In-Reply-To: <1309574324-6833-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.

Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
---
 Documentation/git-rebase.txt |    6 +++++-
 git-rebase.sh                |    2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
index a9e0e50..d2f2cd9 100644
--- a/Documentation/git-rebase.txt
+++ b/Documentation/git-rebase.txt
@@ -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..f2d4c72 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -58,7 +58,7 @@ ignore-whitespace! passed to 'git apply'
 C=!                passed to 'git apply'
  Actions:
 continue!          continue rebasing process
-abort!             abort rebasing process and restore original branch
+abort!             abort rebasing process and reset HEAD to <branch>
 skip!              skip current patch and continue rebasing process
 "
 . git-sh-setup
-- 
1.7.6.51.g07e0e

```

## Junio C Hamano, 2011-07-08 16:07

Subject: Re: [PATCH v2] git-rebase.txt: clarify that --abort checks out <branch>
Message-ID: <7vzkkog3ia.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vzkkog3ia.fsf%40alter.siamese.dyndns.org
In-Reply-To: <1310092069-19708-1-git-send-email-martin.von.zweigbergk@gmail.com>

```
Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> writes:

> 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.
>
> Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>

While I agree that there is a problem, ...

>  Documentation/git-rebase.txt |    6 +++++-
>  git-rebase.sh                |    2 +-
>  2 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
> index a9e0e50..d2f2cd9 100644
> --- a/Documentation/git-rebase.txt
> +++ b/Documentation/git-rebase.txt
> @@ -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.

and I think this is a vast improvement, ...

>  --skip::
>  	Restart the rebasing process by skipping the current patch.
> diff --git a/git-rebase.sh b/git-rebase.sh
> index d7855ea..f2d4c72 100755
> --- a/git-rebase.sh
> +++ b/git-rebase.sh
> @@ -58,7 +58,7 @@ ignore-whitespace! passed to 'git apply'
>  C=!                passed to 'git apply'
>   Actions:
>  continue!          continue rebasing process
> -abort!             abort rebasing process and restore original branch
> +abort!             abort rebasing process and reset HEAD to <branch>
>  skip!              skip current patch and continue rebasing process
>  "

I don't think it is quite right to use placeholder notation here, unless
you are talking about "git rebase --abort <branch>", and you are of course
not in this case. Perhaps

	abort and check out the original branch

might be slightly better. I dunno.

As the user knows these help text are all about "rebase", I do not think
it is worth repeating "rebasing process" over and over again.

```

## Martin von Zweigbergk, 2011-07-10 18:07

Subject: Re: [PATCH v2] git-rebase.txt: clarify that --abort checks out <branch>
Message-ID: <alpine.DEB.2.00.1107100841400.2491@debian>
URL: https://gitlist.dev/e/alpine.DEB.2.00.1107100841400.2491%40debian
In-Reply-To: <7vzkkog3ia.fsf@alter.siamese.dyndns.org>

```
Hi Junio,

On Fri, 8 Jul 2011, Junio C Hamano wrote:

> Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> writes:
> 
> >  --skip::
> >  	Restart the rebasing process by skipping the current patch.
> > diff --git a/git-rebase.sh b/git-rebase.sh
> > index d7855ea..f2d4c72 100755
> > --- a/git-rebase.sh
> > +++ b/git-rebase.sh
> > @@ -58,7 +58,7 @@ ignore-whitespace! passed to 'git apply'
> >  C=!                passed to 'git apply'
> >   Actions:
> >  continue!          continue rebasing process
> > -abort!             abort rebasing process and restore original branch
> > +abort!             abort rebasing process and reset HEAD to <branch>
> >  skip!              skip current patch and continue rebasing process
> >  "
> 
> I don't think it is quite right to use placeholder notation here, unless
> you are talking about "git rebase --abort <branch>", and you are of course
> not in this case. Perhaps
> 
> 	abort and check out the original branch
> 
> might be slightly better. I dunno.

Good point. I tried to find something that would fit in 80 characters
and still not use the term "check out", but I agree that using the
placeholder notation was a bad idea. I would be happy to change to
your proposed text. Drew, I hope you don't mind.

> As the user knows these help text are all about "rebase", I do not think
> it is worth repeating "rebasing process" over and over again.

I was thinking about changing "rebasing process" to "rebase", but
removing it completely is probably good idea.

Patch coming up.

```

## Martin von Zweigbergk, 2011-07-10 18:31

Subject: [PATCH v3] git-rebase.txt: clarify that --abort checks out <branch>
Message-ID: <1310322661-24924-1-git-send-email-martin.von.zweigbergk@gmail.com>
URL: https://gitlist.dev/e/1310322661-24924-1-git-send-email-martin.von.zweigbergk%40gmail.com
In-Reply-To: <1310092069-19708-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>
---
 Documentation/git-rebase.txt |    6 +++++-
 git-rebase.sh                |    6 +++---
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
index a9e0e50..d2f2cd9 100644
--- a/Documentation/git-rebase.txt
+++ b/Documentation/git-rebase.txt
@@ -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..9065c16 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -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
-- 
1.7.6.51.g07e0e

```

## Martin von Zweigbergk, 2011-07-14 03:47

Subject: [PATCH v4] rebase: clarify "restore the original branch"
Message-ID: <1310615226-3251-1-git-send-email-martin.von.zweigbergk@gmail.com>
URL: https://gitlist.dev/e/1310615226-3251-1-git-send-email-martin.von.zweigbergk%40gmail.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

```
