Friday, January 29. 2010DVCSs and Changeset NumberingTrackbacks
Trackback specific URI for this entry
No Trackbacks
Comments
Display comments as
(Linear | Threaded)
You know that doing this is basically impossible to get right, though. The numbers will be different in everyone's repo and just screw things up. Using an unambiguous hash prefix is much easier in the long run. If you want version numbers, the "right way" is tags and git describe Yea, it's impossible to get right in the general case. But for some (I would postulate fairly common) use cases, it could be very helpful. And it doesn't make the general case any worse (unless, I suppose, it's misleading… I don't know how bad that would be). I agree with Stephen. It seems like a "nice to have" on the surface, but I imagine down the line it would bring mayhem, slaughter, and the uprising of angry robots or possibly zombies. "6899 and 02a9. Which one is more recent?" What does recency mean? How can you tell it apart if it comes from different remote branches? What you're effectively asking for is some identifier of which machine the commit came from and when it was committed -- but you have that. That's the commit metadata which includes the timestamp and user who made the commit. My name is in there, with my email address, etc. If you want, you could give different identifiers to each machine that you work on, though I don't see the purpose (since they're all work from me). But embedding anything like that into a "unique identifier string" that is supposed to identify a commit across all repositories is kind of beside the point and potentially poisonous. I applaud git for being all unadulterated and shi--stuff. Yes it might be a bit less user friendly, but it's up-front and honest. Transparency makes it easier to understand what's going on underneath and helps you use the tool properly. I will let mercurial slide for their aliased incrementing and truncated hash, but I consider bzr to be blasphemous for hiding the hashes altogether. Knowledge is power!
You're right - if you're talking about comparing things across branches, or something that is fundamentally "really tricky" without access to the entire graph, no crazy scheme is going to help. But in the general case - which is, I'm going to postulate, you know what branch you're dealing with - knowing "approximately" where a particular revision lies is often a useful thing. And I disagree - there's nothing inherantly good about git's "up-front honesty". Just for example, it's much (MUCH!) easier to remember a small integer (ie, Mercurial's aliases) than a friggen huge hash… Which means I can store it in my short term memory, instead using my computer's copy-paste buffer, or some other such. I agree that Mercurial's compromise is a reasonable one, but I think git's decision of honesty > bzr's decision of deceit. Give me some use scenarios when you're dealing with revision numbers? I almost always copy/paste regardless. If I'm dealing with revisions, I'm most likely trying to fix a stupid mistake I already made and don't want to introduce more mistakes by relying on mere mortal memory (especially when you get into +4 digits as bigger projects do). If it's not a mistake then I have tags and branch names and everything is honkey dorey. A small note, Andrey: you can have a fairly good notion of recency if you use the longest distance to any root that is an ancestor or your commit. For example, this guarantees that if commit A is a revision of commit B, then A will have a bigger number. I also prefer git's method, but I think it would be harmless to prepend a number like this to commit hashes in some cases, and for the utilities to simply ignore or verify that number when they see it. |
QuicksearchArchivesLinksCategories |