Who we are

We are the developers of Plastic SCM, a full version control stack (not a Git variant). We work on the strongest branching and merging you can find, and a core that doesn't cringe with huge binaries and repos. We also develop the GUIs, mergetools and everything needed to give you the full version control stack.

If you want to give it a try, download it from here.

We also code SemanticMerge, and the gmaster Git client.

Move detection – advanced bits

Wednesday, December 21, 2011 Pablo Santos 1 Comments

Move detection is one of the big features in 4.0, as I’m sure you’re already aware of.

It has been implemented on top of the same underlying technology we use for Xdiff and Xmerge.

The point is: you just move a file on your workspace without issuing a “cm mv” operation (command line, GUI or through a plugin), and later Plastic is able to “detect” the move happened.

How it works

The principles of move detection are quite easy: Plastic has a list of the files (stored under .plastic/plastic.wktree file on the workspace) that are “controlled” under the workspace. Then you decide to look for changes:
  • If a file on the workspace is not on the list: then it is proposed as an “added” candidate
  • If a file is on the list but not on the workspace: then it is proposed as a “deleted” candidate

    How the “moves” are detected? The “added candidates” are matched with the “deleted candidates” and if they’re “similar enough” then they’re proposed as “moved”.

    Let’s make it more complicated

    What if foo.c is something like the following?

    And we rename it to bar.c and modify it this way:

    The file was so small that this little change will make the two versions less than 90% different, so “pending changes” view will look like this:

    As you can see plastic detects a “potential add” and a “potential delete”.

    Matching manually

    Right click on the “potentially added” file and select “search matches”:

    And then the “matching” dialog will show up. You can slide the similarity bar until the candidate appears:

    And once you “accept the selected match”, the “pending changes view” will reflect the move:
    Pablo Santos
    I'm the CTO and Founder at Códice.
    I've been leading Plastic SCM since 2005. My passion is helping teams work better through version control.
    I had the opportunity to see teams from many different industries at work while I helped them improving their version control practices.
    I really enjoy teaching (I've been a University professor for 6+ years) and sharing my experience in talks and articles.
    And I love simple code. You can reach me at @psluaces.
  • 1 comment:

    1. > "less than 90% different"
      Shouldn't that be reversed since the changes was to different to be detected as a move?

      ReplyDelete