threads / patch / 27745

patch, 2 partsgit-rebase.txt: clarify that --abort checks out <branch>

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

## tl;dr

10 messages between Jul 2, 2011 and Jul 14, 2011. Diffs are folded; open one to read it.

replies: 9people: 4as markdown or json

Martin von Zweigbergk· Jul 2, 2011, 02:38 UTC · lore
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(-)
Show changes to 2 files +2 −2

Documentation/git-rebase.txt, git-rebase.sh

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· Jul 5, 2011, 21:43 UTC · re: Martin von Zweigbergk · lore

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

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

Show 8 quoted lines
> 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.

Show 12 quoted lines
> 
> 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· Jul 6, 2011, 02:19 UTC · re: Drew Northup · lore

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

On Tue, 5 Jul 2011, Drew Northup wrote:
Show 11 quoted lines
> 
> 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?

Show 11 quoted lines
> > 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· Jul 6, 2011, 02:52 UTC · re: Martin von Zweigbergk · lore

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

Martin von Zweigbergk wrote:
Show 7 quoted lines
> 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· Jul 6, 2011, 13:25 UTC · re: Jonathan Nieder · lore

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

On Tue, 2011-07-05 at 21:52 -0500, Jonathan Nieder wrote:
Show 13 quoted lines
> 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· Jul 8, 2011, 02:27 UTC · re: Martin von Zweigbergk · lore

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

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(-)
Show changes to 2 files +6 −2

Documentation/git-rebase.txt, git-rebase.sh

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· Jul 8, 2011, 16:07 UTC · re: Martin von Zweigbergk · lore

Re: [PATCH v2] git-rebase.txt: clarify that --abort checks out <branch>

Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> writes:
Show 13 quoted lines
> 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, ...
Show 18 quoted lines
>  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, ...
Show 14 quoted lines
>  --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· Jul 10, 2011, 18:07 UTC · re: Junio C Hamano · lore

Re: [PATCH v2] git-rebase.txt: clarify that --abort checks out <branch>

Hi Junio,
On Fri, 8 Jul 2011, Junio C Hamano wrote:
Show 24 quoted lines
> 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· Jul 10, 2011, 18:31 UTC · re: Martin von Zweigbergk · lore

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

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(-)
Show changes to 2 files +8 −4

Documentation/git-rebase.txt, git-rebase.sh

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· Jul 14, 2011, 03:47 UTC · re: Martin von Zweigbergk · lore

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

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(-)
Show changes to 2 files +11 −7

Documentation/git-rebase.txt, git-rebase.sh

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

← back to recent threads