git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Git mailing list <git@vger.kernel.org>
Subject: Re: [PATCH v2 0/3] rebase: give precise error message
Date: Tue, 28 Nov 2017 19:34:42 +0530	[thread overview]
Message-ID: <1511877882.10193.2.camel@gmail.com> (raw)
In-Reply-To: <xmqqpo8387hz.fsf@gitster.mtv.corp.google.com>

On Tue, 2017-11-28 at 11:25 +0900, Junio C Hamano wrote:
> 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.


> > 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

  reply	other threads:[~2017-11-28 14:04 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-21 15:25 [PATCH] rebase: rebasing can also be done when HEAD is detached Kaartic Sivaraam
2017-11-22  2:13 ` Junio C Hamano
2017-11-27 17:21   ` [PATCH v2 0/3] rebase: give precise error message Kaartic Sivaraam
2017-11-27 17:21     ` [PATCH v2 1/3] rebase: use a more appropriate variable name Kaartic Sivaraam
2017-11-27 17:21     ` [PATCH v2 2/3] rebase: distinguish user input by quoting it Kaartic Sivaraam
2017-11-27 17:21     ` [PATCH v2 3/3] rebase: rebasing can also be done when HEAD is detached Kaartic Sivaraam
2017-11-28  2:31       ` Junio C Hamano
2017-11-28 16:15         ` Kaartic Sivaraam
2017-12-01  6:09         ` [PATCH v3 " Kaartic Sivaraam
2017-11-28  2:25     ` [PATCH v2 0/3] rebase: give precise error message Junio C Hamano
2017-11-28 14:04       ` Kaartic Sivaraam [this message]
2017-11-29  0:10         ` Junio C Hamano
2017-11-29  3:11           ` Kaartic Sivaraam
2017-11-29  6:47             ` Junio C Hamano
2017-12-16  9:03     ` [PATCH v5 0/3] rebase: give precise error messages Kaartic Sivaraam
2017-12-16  9:03       ` [PATCH v5 1/3] rebase: consistently use branch_name variable Kaartic Sivaraam
2017-12-16  9:03       ` [PATCH v5 2/3] rebase: distinguish user input by quoting it Kaartic Sivaraam
2017-12-16  9:03       ` [PATCH v5 3/3] rebase: rebasing can also be done when HEAD is detached Kaartic Sivaraam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1511877882.10193.2.camel@gmail.com \
    --to=kaartic.sivaraam@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).