[ann/rfc] bzr-diff-revid

John Arbash Meinel john at arbash-meinel.com
Fri Jan 16 19:13:52 GMT 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Benjamin Jansen wrote:
> On Jan 16, 2009, at 12:02 AM, Colin D Bennett wrote:
> 
> <snip>
> 
>> However, I would not want to see it replace the current, standard diff
>> output format.  I consider it an enormously important feature that
>> 'bzr diff' produces output compatible with Unix diff.  Non-bzr users
>> would certainly be confused by seeing the 'revid:...' if you send them
>> the diff, even it the 'patch' command accepted it.
> 
> Yeah, I assumed changing the default output would not be acceptable.
> 
>> I think a plugin is the proper location for this feature.
> 
> Okay, that's fine.
> 

I think it would be reasonable to have "bzr diff --show-ids" include the
revision ids as part of its output. Though I would also have it do so on
"comment" lines, rather than in the timestamp field.

>>> [2]
>>> In one specific case, the revision's date was "2008-12-30 13:24:25".
>>> To actually see the new file contents for the revision, I had to ask
>>> bzr for date:"2008-12-31 08:32:32".
>>
>> That is weird.  Could it be caused by differing time zones?  I think
>> this should be looked into.  Could it be a bzr bug?
> 
> As you say, time zones are an issue. Based on my, admittedly limited,
> experience, ``bzr diff'' outputs UTC timestmaps, or at least always
> includes an offset. However, when I pass a date: revspec to bzr, it
> seems to want timestamps in local time and ignores the offset field.
> Maybe I am doing something wrong. In any case, I patched Review Board to
> work with those constraints. The real problem came when date: did
> something nonsensical.
> 

I would guess that "date:" doesn't use the offset field, and should
probably be updated to do so.

> In this case, I don't think it is a zone problem, since the minute &
> second fields are completely different than the "real" timestamp. I
> asked about this on #bzr, and was told that date: revspecs have never
> been perfect in bzr. I didn't look into it any further.
> 
> - Ben
> 

Yeah, date: suffers a bit. Generally because you don't want an exact
match, but instead want the one "just before" or "just after" the actual
date that you give. Even further, though, matching by revision id can
always be really fast, while matching by date requires us to do a lot of
searching, and if we want to speed up that searching, we have to assume
that revisions are in "date-sorted" order, which isn't entirely true
given clock-skew between machines, etc.

So revision-id is the right way to go, and I would certainly consider a
patch that adds "bzr diff --show-ids" which can then print out exact
revision ids. In fact you could have it add the line:

bzr diff -r revid:revision-id-1..revid:revision-id-2
=== diff X..Y

Which could be good for a lot of things.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAklw3HAACgkQJdeBCYSNAAOOnQCgwup8s9YFLAdU1jNbaZznmMWV
73EAn1+l7NPiOMl+RYXR+skpGTw3Q7gw
=zuX7
-----END PGP SIGNATURE-----



More information about the bazaar mailing list