16

Simple question perhaps, but one I'm having a hard time finding the answer to. I often work at a client that uses TFS as source control and they completely avoid using the baseless merge feature of TFS source control

In part because in the past it required a command line tool to do it, but possibly more important because when you do it now in the interface it shows you a yellow exclamation warning symbol that you are indeed performing a baseless merge.

This sort of scares them off and makes them avoid it altogether. I've been searching around to figure out if there are any specific risks involved in baseless merges but I'm unable to find that out (or details on how baseless merges work underneath the hood)

Robba
  • 7,684
  • 12
  • 48
  • 76
  • 1
    Let me turn this question around: why are you suggesting that they use a baseless merge? What does their branch structure look like that makes this is a common operation for them? – Edward Thomson Mar 03 '15 at 12:45
  • Well, this customer uses a structure of branching from Main to Dev to Patches where it happens pretty often that several patches are in development at the same time but are not ready yet to be merged back up to Dev, but can sometimes be nice to share between the various patch branches as they are being developed. Just thought I'd use baseless merges for this. – Robba Mar 04 '15 at 11:29

1 Answers1

18

Baseless merges should be avoided if at all possible. When you do a baseless merge, unlike a merge, you are disregarding the history of either side. Indeed you can merge two branches that are totally unrelated—and that can be dangerous.

The key is to create a branching strategy that allows you to not have to use that feature.

  • Yeah, I noticed when I tried to do a baseless merge that pretty much all (if not just plain all) changes result in a 'merge conflict' and should be manually resolved, even if it's just the one branch that has all the changes... Seems like another win for Git if you ask me... – Robba Mar 04 '15 at 11:30
  • 3
    A "baseless merge", that is a three-way merge of two files without a common ancestor (or "base"), means that you can't identify what regions of a file are new and what are common. So it is going to produce conflicts in any system, be it Git or TFVC. – Edward Thomson Mar 04 '15 at 12:54
  • 3
    "means that you can't identify what regions of a file are new and what are common. So it is going to produce conflicts in any system, be it Git or TFVC" Not exactly true. The problem is it needs to be a parent in TFSVC whereas git it can really be any ancestor. – Mike Haas Mar 31 '16 at 19:25
  • 4
    FYI for anyone confused by "three-way merge of two files" as I was, it refers to user Alice’s code, user Bob’s code and the base code on which both of them made changes. So if the default TFS merge tool, diffmerge, cannot determine the base, it will do a merge without a base i.e., baseless. – Dennis T --Reinstate Monica-- May 03 '19 at 19:33
  • There is no way around it when you have to do feature isolation. Feature toggle is far worse. – Jordan Jan 06 '20 at 21:41