From: "Johannes Schindelin" <Johannes.Schindelin@xxxxxx>
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).
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html