Git development
 help / color / mirror / Atom feed
From: "Philip Oakley" <philipoakley@iee.org>
To: "Johannes Schindelin" <Johannes.Schindelin@gmx.de>,
	"Francois-Xavier Le Bail" <devel.fx.lebail@orange.fr>
Cc: "Konstantin Khomoutov" <kostix+git@007spb.ru>,
	"Matthieu Moy" <Matthieu.Moy@grenoble-inp.fr>,
	"Git List" <git@vger.kernel.org>
Subject: Re: How to rebase when some commit hashes are in some commit messages
Date: Fri, 16 Oct 2015 09:01:07 +0100	[thread overview]
Message-ID: <84D417D967EA4E31B0AD471329E9577C@PhilipOakley> (raw)
In-Reply-To: alpine.DEB.1.00.1510151134250.31610@s15462909.onlinehome-server.info

From: "Johannes Schindelin" <Johannes.Schindelin@gmx.de>
> Hi Francois-Xavier,
>
> On Thu, 15 Oct 2015, Francois-Xavier Le Bail wrote:
>
>> On 13/10/2015 15:29, Philip Oakley wrote:
>>
>> > Thus the only sha1 numbers that could be used are those that are
>> > within the (possibly implied) instruction sheet (which will list the
>> > current sha1s that will be converted by rebase to new sha1's).
>>
>> Yes.
>
> So what happens for commits that are in the pick list but then end up not
> being rewritten at all, e.g. when a patch has been applied upstream (and
> the --cherry logic did not detect that) and then you end up with a "No
> changes to commit"? And what if a patch ends up in merge conflicts and the
> user just skips it? And what if the referenced commit is to be picked
> *afterwards* due to the commits being reordered?

My policy (bikeshed) for these style of occurrences would be that such 
'disappeared sha1 refs' should be considered as equivalent to a 'merge 
conflict' "known"<>"unknown", and drop the user into the appropriate review 
code path so the user can fix it up.

A sha1 ref can only 'disappear' if it was known before hand, that is, it 
must have been reachable from the tip of the original rebase.

Only those commits between the original rebase tip and its merge-base with 
the destination (e.g. --onto) are candidates for re-write. When taken along 
with the minimum (config) length for a sha1 it should be pretty robust to 
false positives.

In the case of --orphan branch rebasing one does get left and right roots 
for the 'merge-base' which is a particular corner case.

>
> It would appear that the strategy you propose is still too ill-defined to
> make for a robust feature.
>
> Ciao,
> Johannes
>
> P.S.: The recommended way to refer to a commit is not only using the SHA-1
> but also mentioning the one-line, and even the date. That way, even
> rebased commits can found most of the time. This is not fool-proof, by
> far, of course, but still better than trying to rewrite a SHA-1 and
> failing.
>

In terms of re-writing a quoted --one-line ref, the tool must also be told 
(config option) the few valid quoting commands the user wishes to re-write, 
so that if the sha1 is part of a full quote then the whole quote can be 
replaced by a fresh quote of the updated commit (especially in the --onto 
case).

  reply	other threads:[~2015-10-16  8:01 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-12 19:59 How to rebase when some commit hashes are in some commit messages Francois-Xavier Le Bail
2015-10-12 20:21 ` Matthieu Moy
2015-10-13  8:50   ` Francois-Xavier Le Bail
2015-10-13 13:00     ` Konstantin Khomoutov
2015-10-13 13:29       ` Philip Oakley
2015-10-13 17:07         ` Jacob Keller
2015-10-13 18:00           ` Mike Rappazzo
2015-10-13 19:24             ` Philip Oakley
2015-10-13 21:28               ` Jacob Keller
2015-10-13 23:06                 ` Philip Oakley
2015-10-15  8:12             ` Francois-Xavier Le Bail
2015-10-15  8:06           ` Francois-Xavier Le Bail
2015-10-15  7:44         ` Francois-Xavier Le Bail
2015-10-15  9:41           ` Johannes Schindelin
2015-10-16  8:01             ` Philip Oakley [this message]
2015-10-18 13:58           ` Thomas Koch
2015-10-18 16:23 ` Ævar Arnfjörð Bjarmason

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=84D417D967EA4E31B0AD471329E9577C@PhilipOakley \
    --to=philipoakley@iee.org \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --cc=devel.fx.lebail@orange.fr \
    --cc=git@vger.kernel.org \
    --cc=kostix+git@007spb.ru \
    /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