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

Re: [PATCH v2 0/3] rebase: give precise error message

From
Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
Date
Nov 28, 2017, 14:04 UTC
Message-ID
<1511877882.10193.2.camel@gmail.com>
In-Reply-To
<xmqqpo8387hz.fsf@gitster.mtv.corp.google.com>
On Tue, 2017-11-28 at 11:25 +0900, Junio C Hamano wrote:
Show 22 quoted lines
> Kaartic Sivaraam <kaartic.sivaraam@gmail.com> writes:
> 
> > 1. "git rebase <upstream> <remote_branch>" does nothing
> 
> Not limited to "rebase", you do not muck with remote-tracking branch
> in your local repository, so it would be a bug if the above updated
> where the remote-tracking branch points at.
> 
> The form of "git rebase" with one extra argument (i.e. not rebasing
> the history that leads to the current checkout) is mere shorthand of
> checking that extra thing out before doing the rebase, i.e.
> 
> 	$ git rebase origin/next origin/maint
> 
> first checks out origin/maint (you'd get on a detached HEAD) and
> rebase the history leading to the detached HEAD on top of
> origin/next.  If it fast-forwards (and it should if you are talking
> about 'maint' and 'next' I publish), you'll end up sitting on a
> detached HEAD that points at origin/next.
> 
> There is nothing to see here.
> 

You're right. It was my mistake. It seems I didn't notice that I was already on 'origin/next' before I did,

 	$ git rebase origin/next origin/maint
So (obviously) I thought it did nothing, sorry.
Show 9 quoted lines
> > 2. It's possible to do "git rebase <upstream> <commit>"
> 
> Again, that's designed behaviour you can trigger by giving <commit>
> (not <branch>).  Very handy when you do not trust your upstream or
> yourself's ability to resolve potential conflicts as a trial run
> before really committing to perform the rebase, e.g.
> 
> 	$ git rebase origin master^0
> 

I can't comment about usefulness as I haven't used rebase in this way but I'm pretty sure that this should be mentioned in the "Documentation" to help those might be in bare need of syntax like this to discover it.

Something like the following diff with additional changes to other places that refer to <branch>,

diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
index 67d48e688..ba4a545bf 100644
--- a/Documentation/git-rebase.txt
+++ b/Documentation/git-rebase.txt
@@ -9,9 +9,9 @@ SYNOPSIS
 --------
 [verse]
 'git rebase' [-i | --interactive] [options] [--exec <cmd>] [--onto <newbase>]
-       [<upstream> [<branch>]]
+       [<upstream> [<ref>]]
 'git rebase' [-i | --interactive] [options] [--exec <cmd>] [--onto <newbase>]
-       --root [<branch>]
+       --root [<ref>]
 'git rebase' --continue | --skip | --abort | --quit | --edit-todo
 
 DESCRIPTION


If <ref> is the correct substitute <branch>, I could try to send a
patch that fixes this.
-- 
Kaartic
Previous: Junio C HamanoNext: Junio C Hamano
Message 11 of 18 in “rebase: rebasing can also be done when HEAD is detached”
  1. rebase: rebasing can also be done when HEAD is detachedKaartic Sivaraam, Nov 21, 2017
  2. Junio C HamanoNov 22, 2017
  3. 0/3 rebase: give precise error messageKaartic Sivaraam, Nov 27, 2017
  4. 1/3 rebase: use a more appropriate variable nameKaartic Sivaraam, Nov 27, 2017
  5. 2/3 rebase: distinguish user input by quoting itKaartic Sivaraam, Nov 27, 2017
  6. 3/3 rebase: rebasing can also be done when HEAD is detachedKaartic Sivaraam, Nov 27, 2017
  7. Junio C HamanoNov 28, 2017
  8. Kaartic SivaraamNov 28, 2017
  9. 3/3 rebase: rebasing can also be done when HEAD is detachedKaartic Sivaraam, Dec 1, 2017
  10. Junio C HamanoNov 28, 2017
  11. Kaartic SivaraamNov 28, 2017
  12. Junio C HamanoNov 29, 2017
  13. Kaartic SivaraamNov 29, 2017
  14. Junio C HamanoNov 29, 2017
  15. 0/3 rebase: give precise error messagesKaartic Sivaraam, Dec 16, 2017
  16. 1/3 rebase: consistently use branch_name variableKaartic Sivaraam, Dec 16, 2017
  17. 2/3 rebase: distinguish user input by quoting itKaartic Sivaraam, Dec 16, 2017
  18. 3/3 rebase: rebasing can also be done when HEAD is detachedKaartic Sivaraam, Dec 16, 2017

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.