Dear all,

sorry to ask a (probably stupid) question on git here, but my question arose
from trying to do SageMath development.

I have a commit xyz with a very small changeset: It modifies a single line
in a single file my_file.

Being on a different git branch, I tried
   git cherry-pick xyz
which failed, because my_file has changed and thus the diff from xyz didn't
match. No surprise so far: The changeset is for version A of a file, and
it is to be applied to an incompatible version B of the file.

So, I did
   git mergetool
which started meld, but I guess the situation using kdiff3 would be alike.
I would expect that the middle column starts with version B with all hunks
applied that do match (in my case, none), the right column is the raw
version B, and the left column is version A+changeset; only one conflict is
highlighted, namely the part that in column A+changeset corresponds to the
single failing hunk of the changeset. That's easy to resolve manually.

But in reality, the middle column (i.e., the result of merging) started with
version A, not B! In other words, meld made me go through *all* differences
between version A and version B of my_file --- which are numerous ---, and to
manually apply all the differences between version A and B.

To me, that seems counter intuitive. I want to apply a changeset to version
B of a file, and thus the starting point of merging ought to be *that*
version, not version A.

By some googling, I found one hint, namely to do
   git config --global merge.conflictstyle diff3
However, that made no difference. At some point, someone here pointed
me to rerere, but I suppose that wouldn't apply to my problem, because it
is not about re-using a previous conflict resolution but to resolve a small
(for a human, apparently not small for git) conflict for the first time.

So, what can one do to merge a single-line changeset without touching hundreds
of lines?

Best regards,
Simon

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to