First, this patch affects not only the output of "darcs changes" (log)
but also of every command that shows patches (push/pull/obliterate/...).
Second, I'm open to showing the patch hash in the UI. However, people
may find it quite "un-darcs-y", since we don't often match on hashes,
but rather on patch names.
So, here's what we have with your patch:
-----------8<--------------
Fri Jun 20 14:41:44 ART 2014 jrm3000@gmx.com
20140620174144-9e968-ae264ec6b4dfc874cccc7cc273bc0886fcab42c0
* Show a unique patch identifier in 'darcs changes'.
Mon Jul 21 10:19:56 ART 2014 Guillaume Hoffmann <guillaumh@gmail.com>
20140721131956-5ef8f-e10e31c9878c7a1382d3ff1815f96ccf84709b7e
* document pull --reorder
[...]
------------->8-------------
It's quite hard to read, because the hash is big and also the date and
author name are on the same line (while git/hg put them on separate lines).
Note that the metadata-hash shown above is *not* the contents-hash used as
name of a patch in `_darcs/patches/`. This is because the contents-hash can
change when the context changes (eg, when patch is pulled to another
repository), while the metadata-hash never changes. (See
<http://darcs.net/Internals/Hashes>).
The metadata-hash is generated by Darcs.Patch.Info.makePatchname. It has
3 parts: A-B-C, with A the patch date, B the author hash (prefix) and C
a hash of the whole metadata (also including patch date and author date).
So A-B-C does not "contain" more information than C alone, except if we
want the date and author to be easily read by humans.
The metadata-hash is never written on disk by darcs itself, except
in two cases: a) in the patch index and b), in the marksfile generated
by `darcs convert export`. Both features are absent of any official
release yet.
So I think we can drop A-B and just use C as the metadata-hash. This hash
has already changed in the past (see patch "Remove the .gz suffix") without
much hassle since it was already observed that it was never written on disk.
I've made changes to make the output a little more git-tish, this is what
I get with the alternative patch I'm sending now:
-----------------8<--------------
patch a264ec6b4dfc874cccc7cc273bc0886fcab42c0
Author: jrm3000@gmx.com
Date: Fri Jun 20 14:41:44 ART 2014
* Show a unique patch identifier in 'darcs changes'.
patch e10e31c9878c7a1382d3ff1815f96ccf84709b7e
Author: Guillaume Hoffmann <guillaumh@gmail.com>
Date: Mon Jul 21 10:19:56 ART 2014
* document pull --reorder
[...]
------------------>8--------------
Note that the metadata-hash is not robust against forgery. You can make
a patch by hand that has the same metadata as another patch, but with
distinct contents. OTOH, with Git, the hash shown in "git log" is
directly the contents-hash.
We could solve this by never using the metadata-hash, but I'm not sure
of the implications yet.
1 patch for repository http://darcs.net:
patch 502a8ddd98f74a62cd9dded47df0fcf5f1813cb6
Author: Guillaume Hoffmann <guillaumh@gmail.com>
Date: Mon Jul 21 12:09:49 ART 2014
* show metadata hash in UI and put author and date on separate lines
Attachments
|