git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Keeping <john@keeping.me.uk>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Martin von Zweigbergk <martinvonz@gmail.com>,
	Jonathan Nieder <jrnieder@gmail.com>
Subject: Re: [RFC/PATCH] rebase: use reflog to find common base with upstream
Date: Mon, 9 Dec 2013 20:40:08 +0000	[thread overview]
Message-ID: <20131209204008.GF3163@serenity.lan> (raw)
In-Reply-To: <xmqq7gbdzsvt.fsf@gitster.dls.corp.google.com>

On Mon, Dec 09, 2013 at 12:11:50PM -0800, Junio C Hamano wrote:
> John Keeping <john@keeping.me.uk> writes:
> 
> > Last time this came up [1], there was some discussion about moving the
> > added block of code to affect upstreams given on the command line as
> > well as when the upstream is discovered from the config.  Having tried
> > that, it has some more fallout on the test suite than I like; this
> > pattern ends up dropping the tip commit of "side" because it's in the
> > reflog of "master":
> >
> > 	# start on "master"
> > 	git branch side &&
> > 	git reset --hard HEAD^ &&
> > 	git checkout side &&
> > 	git rebase master
> 
> We shouldn't do anything funky using the reflog when an explicit
> commit object name was given like in the last step above, I think.
> Automation to help human end-users is good, but at some level there
> must be a mechanism to reliably reproduce the same result given the
> same precondition for those who implement such automation, and I do
> not think it is a good idea to force scripts to say
> 
> 	git rebase --do-not-look-at-reflog master
> 
> in order to do so.
> 
> > I wonder if it would be better to add a --fork-point argument to
> > git-rebase and default it to true when no upstream is given on the
> > command line.
> 
> I am not sure what you exactly mean by "when no upstream is given",
> though.  Do you mean
> 
> 	git rebase <no other arguments>
> 
> which we interpret as "rebase the current branch on @{u}", and it
> should behave as if the command was run like so:
> 
> 	git rebase --fork-point @{u}
> 
> If that is what you suggest, I certainly can buy that.  Those who
> want to disable the automation can explicitly say
> 
> 	git rebase @{u}
> 
> and rebase the current exactly on top of the named commit (e.g. the
> current value of refs/remotes/origin/master or whatever remote-tracking
> branch you forked from).

Yes, that's what I meant; the first non-option argument to "git rebase"
is called "upstream" in the manpage (and throughout the code).  So if
"<no other arguments>" means "<no non-option arguments>" then that's
exactly what I meant.

  reply	other threads:[~2013-12-09 20:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-08 20:06 [RFC/PATCH] rebase: use reflog to find common base with upstream John Keeping
2013-12-08 23:34 ` Martin von Zweigbergk
2013-12-09 20:11 ` Junio C Hamano
2013-12-09 20:40   ` John Keeping [this message]
2013-12-09 23:16     ` [PATCH v2] " John Keeping

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=20131209204008.GF3163@serenity.lan \
    --to=john@keeping.me.uk \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --cc=martinvonz@gmail.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).