[darcs-users] [darcs-devel] [issue861] make hash matching work for the new hashed repo patch file names
Lele Gaifax
lele at nautilus.homeip.net
Sun May 18 17:45:48 UTC 2008
On Sun, 18 May 2008 16:57:10 -0000
Ben Coburn <bugs at darcs.net> wrote:
> For example, take a patch with a traditional darcs hash of
> '20080513112149-05dcb-4c273a98eae16cc9d273f18af9907f9f2e567224'
> and a new hashed file name of
> '0000012256-2f91882e2149f43e2463fb9ee80edd67e379734ab0e395ae6cf36655a595bff0'.
>
> The command "darcs2 changes --match 'hash ...'" should be smart
> enough to match either hash type. Currently it only matches the old
> hash.
Beware, I'm just trying to understand/solve issue859, that in turn
lead me to understand the "new hash", so...
While the *hash* of a patch is a constant thing, being computed from
the patch *metadata* such as date, author, name and log, the *name* of
a patch, in the new hashed format, is computed from the *actual*
contents of the patch itself, and it is actually
length_of_the_whole_patch-sha256sum_of_the_whole_patch
Now, I am *not* sure, but AFAIK the actual contents of a given patch
*may* change, when darcs commutes it with other patches, and thus
both the length and the sha256 checksum is not constant, and cannot be
used to identify a patch.
Looking forward to be corrected,
ciao, lele.
--
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
lele at nautilus.homeip.net | -- Fortunato Depero, 1929.
More information about the darcs-users
mailing list