Click here to Skip to main content
15,900,461 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: Yet another Subversion rant Pin
Nemanja Trifunovic19-Apr-13 6:48
Nemanja Trifunovic19-Apr-13 6:48 
GeneralRe: Yet another Subversion rant Pin
robocodeboy29-Apr-13 22:28
robocodeboy29-Apr-13 22:28 
GeneralRe: Yet another Subversion rant Pin
DaveAuld19-Apr-13 6:14
professionalDaveAuld19-Apr-13 6:14 
GeneralRe: Yet another Subversion rant Pin
Brisingr Aerowing19-Apr-13 7:36
professionalBrisingr Aerowing19-Apr-13 7:36 
GeneralRe: Yet another Subversion rant Pin
PIEBALDconsult20-Apr-13 18:08
mvePIEBALDconsult20-Apr-13 18:08 
GeneralRe: Yet another Subversion rant Pin
Stuart Dootson22-Apr-13 11:09
professionalStuart Dootson22-Apr-13 11:09 
GeneralRe: Yet another Subversion rant Pin
Stefan_Lang23-Apr-13 4:54
Stefan_Lang23-Apr-13 4:54 
GeneralRe: Yet another Subversion rant Pin
Stuart Dootson23-Apr-13 5:56
professionalStuart Dootson23-Apr-13 5:56 
I stated that badly, I think. What I meant really, is that when you branch in SVN, you're effectively copying the trunk (or whatever branch you're on) to a new location in the SVN repository (although, of course, it's all done with links, really). With Mercurial or Git, you're just adding a label to the current state of the repository that says what branch the revision is at the tip of.

And to be honest, the number of merges doesn't really matter so much - it's how well the system can track the changes you've made that's at issue.

With SVN, when you do a merge, the merge code in SVN looks at what files each directory sub-tree contains and tries to merge their current states.

With Mercurial (or Git), when you do a merge, the merge code looks for the nearest common ancestor changeset between the two revisions you're merging, then (in effect) replays the changes that give the 'other' revision onto the revision you're merging into. And this extends to other repositories - Hg/Git can easily find common changesets between different repositories, because each changeset is identified by a hash (SHA-1, IIRC). The best description I can find of why DVCS's are better at merging than a centralized VCS like SVN is in Eric Sink's book Version Control By Example[^]:

  • They’re built on a DAG (see Section 4 in Chapter 4). Merge algorithms need good information
    about history and common ancestors. A DAG is a better way to represent that kind of information
    than the techniques used by most centralized tools.
  • They keep the developer’s intended changes distinct from the merge she had to do in order to get
    those changes committed. This approach is less error-prone at commit time, since the developer’s
    changes are already cleanly tucked away in an immutable changeset. The only thing that needs to
    be done is the merge itself, so it gets all the attention it needs. Later, when tracking down a
    problem, it is easy to figure out if the problem happened during the intended changes or the merge,
    since those two things are distinct in the history
  • They deal with whole-tree branches, not directory branches. The path names in the tree are
    independent of the branch. This improves interoperability with other tooling.


To show that, try this:

1) Create an empty repository and create a file called a on the trunk (in SVN) or default branch (in Hg).
2) Create a branch called test_branch and make it the current branch.
3) Rename the file a to b (using svn rename/hg mv).
4) Merge test_branch back into the trunk/default branch.

With SVN (version 1.7.8), this resulted in two files on the trunk, a and b. With Hg, the merge resulted in one file on the default branch - b. Now, it seems to me that Mercurial's done the right thing because it tracked the changes that I'd made, *not* the current state of a set of files...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

CodeProject MVP for 2010 - who'd'a thunk it!

GeneralRe: Yet another Subversion rant Pin
Stefan_Lang23-Apr-13 22:21
Stefan_Lang23-Apr-13 22:21 
GeneralRe: Yet another Subversion rant Pin
Stuart Dootson23-Apr-13 23:30
professionalStuart Dootson23-Apr-13 23:30 
GeneralRe: Yet another Subversion rant Pin
Stefan_Lang24-Apr-13 4:25
Stefan_Lang24-Apr-13 4:25 
GeneralRe: Yet another Subversion rant Pin
Stuart Dootson24-Apr-13 4:43
professionalStuart Dootson24-Apr-13 4:43 
GeneralRe: Yet another Subversion rant Pin
Stefan_Lang24-Apr-13 5:25
Stefan_Lang24-Apr-13 5:25 
GeneralRe: Yet another Subversion rant Pin
Trajan McGill24-Apr-13 11:35
Trajan McGill24-Apr-13 11:35 
GeneralRe: Yet another Subversion rant Pin
Stefan_Lang24-Apr-13 21:41
Stefan_Lang24-Apr-13 21:41 
GeneralRe: Yet another Subversion rant Pin
Trajan McGill25-Apr-13 5:28
Trajan McGill25-Apr-13 5:28 
GeneralRe: Yet another Subversion rant Pin
Stefan_Lang25-Apr-13 21:22
Stefan_Lang25-Apr-13 21:22 
GeneralRe: Yet another Subversion rant Pin
Trajan McGill26-Apr-13 4:57
Trajan McGill26-Apr-13 4:57 
GeneralRe: Yet another Subversion rant Pin
Stefan_Lang24-Apr-13 23:16
Stefan_Lang24-Apr-13 23:16 
GeneralRe: Yet another Subversion rant Pin
Stuart Dootson24-Apr-13 23:30
professionalStuart Dootson24-Apr-13 23:30 
GeneralRe: Yet another Subversion rant Pin
Stefan_Lang25-Apr-13 1:32
Stefan_Lang25-Apr-13 1:32 
GeneralRe: Yet another Subversion rant Pin
Stefan_Lang25-Apr-13 21:50
Stefan_Lang25-Apr-13 21:50 
GeneralRe: Yet another Subversion rant Pin
Member 376360822-Apr-13 13:07
Member 376360822-Apr-13 13:07 
GeneralRe: Yet another Subversion rant Pin
EdReel22-Apr-13 14:45
EdReel22-Apr-13 14:45 
GeneralRe: Yet another Subversion rant Pin
BobJanova22-Apr-13 23:55
BobJanova22-Apr-13 23:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.