top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Unexpected merge results in git-svn repo

+2 votes
440 views

I am getting some unexpected results from a merge and I'd like to understand why.

I have two commits X and Y that I want to merge.

git merge-base X Y # yields B
git diff B X -- F # is empty
git diff B Y -- F # contains the change I want merged
git rev-list X ^B -- F # is empty
git rev-list Y ^B -- F # contains one commit

git checkout X
git merge Y

fails with fixable merge conflicts on other files, but uses X's copy of F instead of Y's. I was expecting it to use Y's copy of F, since only Y has modified F since B. What could cause this?

posted Jul 31, 2013 by Amit Parthsarthi

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
+2 votes

I am learning, and experimenting. I was experimenting with "git merge", forgot the "--no-commit", and discovered the hard way that aborting the editor that comes up without saving does NOT abort the merge.

And git merge --abort fails, because the merge succeeded.

Git Gui has a way to amend the comment of the last merge, but no way to undo it. I figure this should be simple, but I don't know how.

+2 votes

I tend to accumulate lots of branches as I'd do one branch per feature. When cleaning up, I'd like to
delete all branches, which have been merged.

I could use

 $ git branch -d (which was merged already?) ^C
 $ git branch --merged # let's find out
 ...
 $ # Now run git branch -d with each of the branches.

This kind of question has already been discussed,
http://stackoverflow.com/questions/6127328/how-can-i-delete-all-git-branches-which-are-already-merged
suggests: git branch --merged | grep -v "*" | xargs -n 1 git branch -d

I could think of:

 $ git branch -d --merged # no need to specifiy a branch iff --merged is given with -d
 $ git branch --delete-merged # comes as an new extra option, doesn't clutter other commands
 $ git branch -d keyword-for-all-merged-branches

Before starting such a feature, I'd like to hear input of others.

+2 votes

Let's say I have two identical branches: master and topic. In master I remove some code, i.e. function bar(). In topic I do the same (commit) and after some time I realize I need bar() and revert previous commit
with removal.

So I end with master with no bar() and topic with bar() in its original state. When I merge I get code without bar() and no merge conflict (recursive or resolve strategies). Is it possible to detect such situations as conflicts? When bar() is C++ virtual there is no possibility to catch this with compiler.

0 votes

We have a situation where a few folks don't use --reintegrate option when performing SVN merge, while others do.
Whats
1- the consequence of not using --reintegrate option; can the feature branch continue to svn merge to trunk the 2nd time and thereafter ?
2- the impact on those feature branches that do use --reintegrate option; from what we read in the manual, that one cannot use this feature branches anymore.

+5 votes

Are there side effects from applying the same svn merge --record-only on the same revision number and a new commit each time it is applied ?

Would there be issues with SVN mergeinfo and/or SVN in general if one keeps applying svn merge --record-only on a revision number repeatedly and commit in a svn merge --record-only followed by commit followed by svn merge --record-only followed by commit and the next cycle begins ? Its not an infinite loop svn merge; it would stop at some point.

...