HACKER Q&A
📣 wcerfgba

Is anyone using lock-based version control?


Hi all,

I am just curious if anyone is using any lock-based approaches to version control for collaborative production of software or other digital assets. It seems like the merge model, exemplified by Git, is ubiquitous to the point that nobody is experimenting with any other workflows.

I think lock-based version control would would very well with trunk-based development. Separate devs branch from mainline, files get locked for everyone else as they are edited, and so it is necessary to work in very tight iterations and merge back to mainline very frequently.

Is anyone working with a lock-based approach to version control, either for personal projects, or in an organisational setting?

Thanks :)


  👤 dexwiz Accepted Answer ✓
This would never work. If someone checked out a file, locked it, and then went on vacation, this would block everyone else. Imagine if some breaking bug was in the checked out file, now you have to find some admin to remove the lock. You could put a timer on the lock, but how would this be different from git?

Perforce does trunk based development and checkouts involve talking to the server (depot). This allows you to see who else has a file checked out, but doesn't block you from editing. I have used Perforce for multiple years in a thousand+ developer org, and have never actually needed to see who else has a file checked out.


👤 heywire
We still use Microsoft Visual Source Safe for some projects :)

We have a main trunk, and a branch for each major version released, upon which we apply fixes and occasionally small feature updates as requested by customers.

We’re a small team, so it works pretty well for us. We’ve worked this way for 15+ years.


👤 zwieback
Yes, we use locking checkout in certain situations but not for traditional source code, more for CAD files or documents. It's a fairly rare situation, though, mostly helpful for non-coders that don't understand the concept of a merge.

👤 samwillis
Not software development, but most CAD version control systems are lock based. You checkout your model or assembly, lock the parts/drawings/assembly you are working on and that prevents others from working on the same bit. Some allow a level of collaboration where two people can be working on different components within the same assembly at once.

Most of these version control systems are part of a larger software package call a PLM system (Product Lifecycle Management) designed to help manage all aspects of product development from concept through to manufacturing.

https://en.m.wikipedia.org/wiki/Product_lifecycle


👤 helph67
I used to work for a firm creating software for handling patient's data in hospitals. Mainly using Xenix, all software source was controlled via the Revision Control System, part of the OS. R.C.S allowed earlier versions of source to be generated easily, when required. All devs using R.C.S accepted it and used it easily, many times each day.

👤 Matthias247
Didn't we had the lock based model when a lot of software development was using svn earlier on?

I also still experience it on Wiki edits, and for office document management systems. My experience there is that it works for a tiny amount of users, but once you start hitting the lock things get painful.


👤 kazinator
> exemplified by Git

The predecessors, SVN and CVS, also do not use a locked checkout model. The "C" in CVS is "concurrent": people working at the same time in multiple checked-out sandboxes (of a central repo), picking up changes with "cvs up", which merges.

Nobody in their right mind used version control with central locking in the last 35 years.