News for hackers. Stuff that matters.
Re:Aha Moments When Learning Git by yxhuvud on Monday June 13, 2011 @02:08AM (#2648283)
"Easily merge changes with the original (changes tracked and never applied twice)"

Heh, guess he never tried to merge two things that was a series of commits that both contained renaming of something to something else. Lets see if I can visualize the situation:

Original branch A with file foobar.foo and contents z. branch B from A with one commit with foobar.foo renamed to foobar.foo.in and contents changed to z'. branch C from A with two commits. The first commit changes the contents of foobar.foo to z''. The second changes the name of foobar.foo to foobar.foo.in.

z' and z'' generate a merge conflict.

Have fun merging...

Re:Aha Moments When Learning Git by fr0sty on Monday June 13, 2011 @02:54AM (#2648335)
Can you point to a version control system that won't fall all over itself in this case?

Also, what would an "ideal" VCS do in such a situation? Btw, have you tried this with git? What happens?

Re:Aha Moments When Learning Git by yxhuvud on Monday June 13, 2011 @03:42PM (#2650417)
No, I was replying to the claim that merging works and that stuff is never applied twice. Which it was. Specifically git suggested that I had a deletion of the new file unmerged.

Thinking back on it, this doesn't make sense. I think the situation involved rebase as well. That is, rebasing a rename onto a branch that already has done the rename in question turns the second one into a deletion. (Or at least adds the deletion of the second file to the list of unmerged changes).

Re:Aha Moments When Learning Git by fr0sty on Monday June 13, 2011 @11:28AM (#2649347)
I just tried this btw,

If you merge B and C you will only have a conflict if the changes in B and C touch the same regions of the file.

If not the merge is made automatically and the changes from both branches are reflected in the new file.

Re:Aha Moments When Learning Git by fr0sty on Monday June 13, 2011 @11:29AM (#2649356)
> Have fun merging...

I just did. As long as the changes in branches B and C are to different regions of the file the merge is completed automatically. If not, conflict markers are places in foobar.foo.in for you to resolve there.

Not sure what more you could ask of your Version Control System...

Re:Aha Moments When Learning Git by yxhuvud on Monday June 13, 2011 @03:44PM (#2650426)
I might have misrepresented the case a bit. It involved a rebase, and rebase + parallel renaming makes for strange things to happen.