darcs

Issue 2558 common file name format for patches, inventories, pristine

Title common file name format for patches, inventories, pristine
Priority wishlist Status unknown
Milestone Resolved in
Superseder Nosy List bfrk
Assigned To
Topics

Created on 2017-10-21.16:09:41 by bfrk, last changed 2017-10-28.14:26:29 by gh.

Messages
msg19776 (view) Author: bfrk Date: 2017-10-21.16:09:39
Is there any sane reason why we use different hashes for

(1) user display of patches and
(2) patch file names?

I had always assumed that these are the same things but a while ago I
realized that this is not so. This makes it hard to find a patch file
(for debugging).
msg19777 (view) Author: bfrk Date: 2017-10-21.16:27:20
Oh, never mind, I figured it out on my own: the 'user level' hash is
supposed to be invariant under commutation, that's the idea of this sort
of hash. Whereas the file name of a patch must be different for each
'variant' of the patch, i.e. it must change when the patch gets modified
due to commutation.
msg19778 (view) Author: gh Date: 2017-10-22.14:34:17
Indeed.

Since we are on this topic, I recently was thinking that it is a pity
that patches, inventories and pristine files do not have the same file
name format of just being the hash of their contents.

Patches and inventories have a prefix that indicate the size of the
uncompressed contents. I reckon this is for verification reasons, but we
could as well do without it, no?

The global cache would just be a big pool of hashed files, no matter if
they are patches, inventories or pristine. Well, even the contents of
_darcs could be unificated this way.
msg19784 (view) Author: bfrk Date: 2017-10-26.19:22:17
gh: I agree on all accounts. Have you thought about  an upgrade path /
compatibility?

I have renamed the issue and marked as wishlist.
msg19793 (view) Author: gh Date: 2017-10-28.14:26:27
* for simplicity sake, the cache and the contents of _darcs need to
handle the same file names

* changing the contents of _darcs means breaking backwards
compatibility, ie, older versions of darcs would not be able to read
common repositories

* however hub.darcs.net could be useful to maintain some backwards
compatibility with older darcs versions to some point

* in the light of what happened with the darcs 1 to darcs 2, my personal
opinion is that it is not worth it to allowing several incompatible
upgrades in parallel. I think we should rather wait to have a new (and
correct) darcs-3 patch kernel and update to such new repo format with
all of the changes at once.
History
Date User Action Args
2017-10-21 16:09:41bfrkcreate
2017-10-21 16:27:21bfrksetpriority: invalid
messages: + msg19777
2017-10-22 14:34:18ghsetmessages: + msg19778
2017-10-26 19:22:22bfrksetpriority: invalid -> wishlist
messages: + msg19784
title: darcs uses different hashes for patch files and display -> common file name format for patches, inventories, pristine
2017-10-28 14:26:29ghsetmessages: + msg19793