git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: John Keeping <john@keeping.me.uk>
Cc: Ted Felix <ted@tedfelix.com>, git@vger.kernel.org
Subject: Re: [BUG] rebase no longer omits local commits
Date: Mon, 07 Jul 2014 10:56:23 -0700	[thread overview]
Message-ID: <xmqqbnt1dpdk.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <20140703222501.GF13153@serenity.lan> (John Keeping's message of "Thu, 3 Jul 2014 23:25:02 +0100")

John Keeping <john@keeping.me.uk> writes:

> Perhaps we shuld do something like this (which passes the test suite):
>
> -- >8 --
> diff --git a/git-rebase.sh b/git-rebase.sh
> index 06c810b..0c6c5d3 100755
> --- a/git-rebase.sh
> +++ b/git-rebase.sh
> @@ -544,7 +544,8 @@ if test "$fork_point" = t
>  then
>  	new_upstream=$(git merge-base --fork-point "$upstream_name" \
>  			"${switch_to:-HEAD}")
> -	if test -n "$new_upstream"
> +	if test -n "$new_upstream" &&
> +	   ! git merge-base --is-ancestor "$new_upstream" "$upstream_name"
>  	then
>  		upstream=$new_upstream
>  	fi
> -- 8< --
>
> Since the intent of `--fork-point` is to find the best starting point
> for the "$upstream...$orig_head" range, if the fork point is behind the
> new location of the upstream then should we leave the upstream as it
> was?

Probably; but the check to avoid giving worse fork-point should be
in the implementation of "merge-base --fork-point" itself, so that
we do not have to do the above to both "rebase" and "pull --rebase",
no?

> I haven't thought through this completely, but it seems like we should
> be doing a check like the above, at least when we're in
> "$fork_point=auto" mode.

  reply	other threads:[~2014-07-07 17:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-03 15:14 [BUG] rebase no longer omits local commits Ted Felix
2014-07-03 19:09 ` John Keeping
2014-07-03 22:25   ` John Keeping
2014-07-07 17:56     ` Junio C Hamano [this message]
2014-07-07 21:14       ` John Keeping
2014-07-15 19:14         ` [PATCH 1/2] rebase--am: use --cherry-pick instead of --ignore-if-in-upstream John Keeping
2014-07-15 19:14           ` [PATCH 2/2] rebase: omit patch-identical commits with --fork-point John Keeping
2014-07-15 19:48             ` Ted Felix
2014-07-15 22:06             ` Junio C Hamano
2014-07-16 19:23               ` [PATCH v2 1/2] rebase--am: use --cherry-pick instead of --ignore-if-in-upstream John Keeping
2014-07-16 19:23                 ` [PATCH v2 2/2] rebase: omit patch-identical commits with --fork-point John Keeping
2014-07-16 20:26                   ` Junio C Hamano
2014-07-16 21:27                     ` John Keeping
2014-07-16 21:36                   ` Ted Felix
2014-07-17  9:36                     ` 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=xmqqbnt1dpdk.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=john@keeping.me.uk \
    --cc=ted@tedfelix.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).