[RFC][PATCH] New style of revision id

Alexander Belchenko bialix at ukr.net
Fri Oct 27 07:57:42 BST 2006


Goffredo Baroncelli пишет:
> On Thursday 26 October 2006 10:54, Erik Bågfors wrote:
>> On 10/26/06, Alexander Belchenko <bialix at ukr.net> wrote:
>>> Goffredo Baroncelli пишет:
> [...]
>>>> The new revision-id is in the form:
>>>>
>>>> <user>@<host>-<yyyymmddhhmmss>-<sha1sum>
>>> After discussion with git folks I think it's better to use form:
>>>
>>> <sha1sum>-<user>@<host>-<yyyymmddhhmmss>
>>>
>>> In this case unique id can be easily autocompleted or shortened to (say
>>> so) 10 chars ;-). And this could be useful to using in visualisation
>>> tools like bzrtools' graph-ancestry plugin.
> I like the idea of a short revid for the selection( when passed to command 
> line interactively ). But I don't like the short revision-id for automatic 
> tool.... I fear about hash collision
> 
>> I think this is better, but I'd also like all commands to be able to
>> take the shortest unique identifier to each command.  So if the revid
>> is
>>
>> 9f472a5cfbc5fc77de3a39c5cecc0d09326d3e86-ghigo at venice-20061025202916

Length of this revid is 68 chars. It's may cause problems on Windows.

>>
>> I would like to be able to run
>> bzr branch -r revid:9f472a5c for example
>>
>> Better yet, if -r finds a revision number that isn't a number, it
>> could assume that it's a revid, so
>>
>> bzr branch -r 15 would use revno 15
>> bzr branch -r 9f472a5c would use the revid that matches...

I like the idea.


> I think that if an hash is composed only by numberm the euristic logic which 
> you suggest can cause problem. I prefer to use a option like -R | --Revision 
> for the revid; so

I don't think it's a REAL issue. Per example, if you are use short hash
with 8 hex chars you can get collision only with revision number started
from 10 millions. This is something fantastic.

When you have short hash started from zero, you never got collision with
revno (I assume that no one use revno:00000010)

> 
> -r | --revision= 	if a specifier isn't used, the default is revno:
> -R | --Revision=	if a specifier isn't used, the default is revid:

Though also looks good.

> 
> Moreover for the revid we can accept a revision-id shorter. But the revision 
> specifier have to verify the non collision.
> 
> I checked, and today in bazaar the switch -R isn't used at all.

--
Alexander





More information about the bazaar mailing list