Posted Apr 5, 2010 17:21 UTC (Mon) by iabervon (subscriber, #722)
[Link]
You can, in theory do everything with a DVCS that you can with a centralized system; you just can't do everything with the current crop of DVCSes. There's no fundamental reason a DVCS can't have an integrated lock manager, where you can negotiate with some server in advance to prevent anyone but you from changing a particular branch to have a different file at a particular path than you have there, and have the repository configured to advise users to get this kind of lock on certain files before working on them. They can, of course, ignore that, and a DVCS means they are able to track their changes locally while still not being able to get their work into the official location, but that's not really different from someone using "Save As..." to avoid getting the lock. (And having an API for getting the versions for a merge in process means that, in theory, your CAD program could have support for performing the merge, and people who really want to work while someone else has the lock could potentially get started early and do more work total but spend less time waiting if they merged.)
Also, a DVCS could, in theory, know where to get all the big uninteresting files instead of actually storing them on the client. That is, for files that aren't useful to compare aside from identity, it would be perfectly reasonable for the DVCS to store on the client "hash xyz is available at (location)", and only actually get the content when needed. For that matter, a DVCS could store the content of large binary files in bittorrent (or a site-internal equivalent) and beat a centralized distribution point.
So far, we haven't seen any DVCSes that do either of these things, but there's not reason they couldn't, aside from the fact that there aren't developers who want to work on those particular problems. That is, version control programs are written in environments with merging and files that compress well against each other and other versions of the same file; this means that "eating your own dogfood" isn't sufficient to motivate developers of version controls systems to fix these problems, and centralized systems, by and large, tend to just happen to work for these cases by default or with very little design effort.
Subversion considered obsolete
Posted Apr 5, 2010 17:46 UTC (Mon) by Msemack (guest, #65001)
[Link]
A central server to do locking? How about that!
Subversion considered obsolete
Posted Apr 5, 2010 18:01 UTC (Mon) by iabervon (subscriber, #722)
[Link]
In all version control environments, there's a central location that is where different participants find each other. In distributed systems, this is just a social convention (and subject to change), and not a necessary part of the architecture, and not critical to all operations. In any case, every branch, whether it is the main branch on the official server that the release will be made from or just the representation of the present state on a developer's workstation, could have locks available; it's just that nobody would try getting a lock somewhere other than the interesting branch, which is the de facto central location.
Subversion considered obsolete
Posted Apr 6, 2010 19:07 UTC (Tue) by vonbrand (subscriber, #4458)
[Link]
Why all this locking nonsense? You have complete control over your clone of the central repo (as a bonus, nobody sees any dumb experiments you try). Use something like gitolite to provide finer-grained access to a shared repo.
And have a real person as a gatekeeper for changes. Call them QA or something.
Subversion considered obsolete
Posted Apr 6, 2010 20:01 UTC (Tue) by iabervon (subscriber, #722)
[Link]
The use case for locking is when your development effort consists of files that can't be merged effectively (CAD is a common example) that various different people work on at different times. Locking is used as a machine-readable alternative to telling everybody in the company "I'm working on the fenders right now, don't work on them until I'm done" and "I'm done with the fenders" and trying to get everyone to notice when people have made these requests.
It's only relevant to projects where merge conflicts can't be resolved (and if you get a merge conflict, someone's work has to be thrown away and redone from scratch), where you want the person whose work would be wasted to do something else or take the afternoon off instead of wasting their time, but these are important cases in a number of industries that aren't software development.
Subversion considered obsolete
Posted Apr 7, 2010 1:10 UTC (Wed) by vonbrand (subscriber, #4458)
[Link]
The git way to handle this is to have everybody work in their own area (no "I step on your toes" possible), and merge the finished products when the developer say it is done. As everybody can also freely take versions from anybody, this doesn't restrict work based on not-yet-accepted changes in any way (sanctioning a change as official is an administrative decision, as it should be, not one forced by the tool).
Subversion considered obsolete
Posted Apr 7, 2010 2:13 UTC (Wed) by iabervon (subscriber, #722)
[Link]
But the thing is that there is no point in working on a part when someone else is working on it, because merging the results is harder than just starting over. I've dealt with situations where every time a hardware schematic changed, the engineer had to spend half a day rerouting the traces so they would fit, and if two people changed the schematic at the same time and rerouted the traces, neither of their layouts would be helpful in routing the merged schematics. Your version control system can't solve problems that your development environment can't solve, and the solution is to have locks such that the second engineer can work on something else instead of spending a day on work that doesn't contribute to the final result.
Subversion considered obsolete
Posted Apr 7, 2010 20:21 UTC (Wed) by vonbrand (subscriber, #4458)
[Link]
OK, but this is a problem that no VCS can solve (because there is no reasonable way to merge separate modifications). Locking doesn't help either, in any case this requires administrative (workflow) coordination between people.
Subversion considered obsolete
Posted Apr 7, 2010 20:32 UTC (Wed) by foom (subscriber, #14868)
[Link]
Maybe you don't understand what is meant by locking?
The advisory locking in SVN *is the implementation of* the administrative (workflow) coordination
between people.
Subversion considered obsolete
Posted Apr 6, 2010 19:03 UTC (Tue) by vonbrand (subscriber, #4458)
[Link]
Locking is not needed in git, all changes are atomic by design. Sure, if several people mess around commiting stuff at random into the same repo, caos could ensue (but "lock for a commit" won't help here anyway). A solution is to have a real person as a gatekeeper for changes. Or use something like gitolite to provide finer-grained access to a shared repo.
"Large files can't be handled"? That I don't see where it comes from. Sure, early git versions did handle everything by keeping (compressed) copies of each file contents they came across, but that is long gone now.
Subversion considered obsolete
Posted Apr 6, 2010 23:16 UTC (Tue) by dlang (✭ supporter ✭, #313)
[Link]
git currently requires that any file it manipulates get mmapped, this limits the file size to your memory size.
git's pack file format uses 32 bit offsets, which limits the largest pack size to ~4G (I believe it uses unsigned 32 bit values, if it's signed values then the limit is 2G) I think that it is always pointing to the beginning of a file, so a file larger than 4G can exist in a pack, but would be the only thing in the pack.
Size limit in git objects?
Posted Apr 7, 2010 1:02 UTC (Wed) by vonbrand (subscriber, #4458)
[Link]
Wrong. From Documentation/tecnical/pack-format.txt for current git (version v1.7.0.4-361-g8b5fe8c):
Observation: length of each object is encoded in a variable
length format and is not constrained to 32-bit or anything.
Size limit in git objects?
Posted Apr 7, 2010 3:23 UTC (Wed) by dlang (✭ supporter ✭, #313)
[Link]
the length of the object isn't contrained, but the offset to the start of the object is.
so you can have up to 4G in a pack file, plus however much the last object runs off the end of it.
Subversion considered obsolete
Posted Apr 7, 2010 22:56 UTC (Wed) by cmccabe (guest, #60281)
[Link]
> git currently requires that any file it manipulates get mmapped, this
> limits the file size to your memory size.
You can mmap(2) files that are bigger than your memory size.
Of course, if you're on 32-bit, there are some size limitations because of the limited size of virtual memory.
Subversion considered obsolete
Posted Apr 7, 2010 20:21 UTC (Wed) by tialaramex (subscriber, #21167)
[Link]
The locking people are talking about isn't locking for a commit
What happens in many proprietary systems, and in subversion if you choose, is that you need a lock to be "authorised" to edit a file, not to commit the change. The procedure looks like:
1 The lockable files start off read-only
2. You _tell the VCS_ that you want to work on file X
2.1 The VCS contacts a central server, asking for a lock on file X
2.2 If that's granted file X is set read-write
2.3 Optionally your program for working on file X is started automatically
3. You do some work, maybe over the course of hours or even days
4. You save and check in the new file X, optionally releasing the lock
The VCS can't strictly _enforce_ the locking rule, of course you could copy file X, or set it read-write manually, then start working on it, and only try to take the lock a day later. But, when you complain to your boss that someone changed file X after you'd started work on it, of course he won't have much sympathy.
The locking model has lots of problems, but some people have convincing arguments for why its appropriate to their problem. The only options for Git are (1) not appealing to those users (2) persuading them all that they're wrong or (3) offering some weird hybrid mode where there can be a central locking server for a subset of files. If you accept that (1) could be the right option, then the continued existence of Subversion is justified for those users already.
Subversion considered obsolete
Posted Apr 8, 2010 20:56 UTC (Thu) by vonbrand (subscriber, #4458)
[Link]
In centralized systems (especially those that don't handle merges decently) this is really the only way to work, true. (RCS works this way, for example). But with decentralized systems with reasonable branching and merging this isn't required. And locking a file doesn't really make sense in a decentralized system (there is no single "file" to lock!), so it is left out of the tool. If the workflow requires some sort of "don't touch some file(s) for a while" synchronization, it has to be handled outside.
I believe this requirement's importance is way overblown. How many projects do you work on, where it is really a requirement (not an artifact of shortcommings in integrating changes by the tool)?
Subversion considered obsolete
Posted Apr 8, 2010 21:56 UTC (Thu) by foom (subscriber, #14868)
[Link]
Subversion's locking is purely a workflow management tool: it *is* simply a way to say "don't touch this file for a while".
Being a distributed VCS doesn't make this workflow management tool any less necessary. And it's convenient to have it integrated with the VCS so that "status" shows the status, and "commit" checks and releases the locks, and so on.
I wish I didn't have to keep defending subversion: git is really nice. But come on people, just be honest about what it can't do, and stop claiming those things are unnecessary!
Subversion considered obsolete
Posted Apr 9, 2010 16:07 UTC (Fri) by vonbrand (subscriber, #4458)
[Link]
As I said, the workflow might require it. But in a decentralized environment there simply can't be any "common rallying point" for all developers handled by the DVCS, so the tool itself can't help you here.
Not by a design flaw, but by fundamental reasons: The "locking" idea only makes sense if there is one master copy shared by all.