darcs

Issue 1768 Add "darcs show patch filename" command

Title Add "darcs show patch filename" command
Priority feature Status duplicate
Milestone Resolved in
Superseder wish: mechanism for 3rd party tools to get patch file name (hashed repositories; file hash)
View: 859
Nosy List darcs-devel, dmitry.kurochkin, jaredj, kowey, twb
Assigned To
Topics Documentation, Hashed, ProbablyEasy

Created on 2010-03-15.18:51:28 by igloo, last changed 2010-03-26.15:22:56 by kowey.

Messages
msg10226 (view) Author: igloo Date: 2010-03-15.18:51:26
Given a patch hash, e.g.
hash = 20100315093256-12142-a516943c813e404e0fb11d85e68131fb5e823e2f.gz
with old-fashioned repositories we could make a URL to the patch with
.../_darcs/patches/$hash
but this doesn't work with the hashed (or darcs2) format.

Can you please add a command, e.g. "darcs show patch filename", so we
can use e.g.
.../_darcs/patches/`darcs show patch filename -p $hash`
(regardless of repo format)


Thanks
Ian
msg10233 (view) Author: kowey Date: 2010-03-16.10:53:04
This shouldn't be too difficult to do for somebody to do.  I would
recommend working on at least one other ProbablyEasy bug though.

It's probably a good idea to call it something else, or maybe make a
darcs show patch and add a flag for concise/quiet output? 
Alternatively, we could make darcs show patch display the filename and
darcs show patch --verbose display the patch contents (eww, that seems a
bit unintuitive)
msg10234 (view) Author: kowey Date: 2010-03-16.11:00:54
Two other notes: you may need to be prepared for a UI discussion on this
on the list.  I would suggest implementing one of the options below (or
something better), and only then start the discussion:

 - darcs show patch filename (introduces a precedent of sub^N-commands;
needs modifications to the command line parsing)
 - darcs show patch --quiet (seems a little yucky to overload quiet in
this manner?)
 - darcs show filehash (shows the file contents hash for *any* object:
darcs show hash src/foo.c and darcs show hash -p bar might do different
things)
 - darcs show patch (shows the file contents hash followed by the patch
contents, so darcs show patch | head -n 1 would do what Ian wants)

Also, one documentation point you will want to make is that the command
is repository-local, in the sense that if you run this command in a
repository where the patch has been commuted to a different
representation, you'll get a different result.
msg10532 (view) Author: kowey Date: 2010-03-26.15:22:54
Steve Keuschel was working on this during the 2010-03 sprint.  We went
through several iterations of the UI.  On Sunday, I finally suggested
that maybe it makes sense to put it in darcs changes --xml after all (so
hash="PATCHINFO-HASH" filehash="FILEHASH).  

In the past I had argued against doing this, but what made me changed my
mind is the fact that we show the patch contents, which change during
commutation anyway.  So I now consider this to be a duplicate of the
previously wont-fixed issue859
History
Date User Action Args
2010-03-15 18:51:29igloocreate
2010-03-16 10:53:08koweysetpriority: feature
status: unknown -> needs-implementation
topic: + ProbablyEasy
messages: + msg10233
nosy: + kowey, jaredj
2010-03-16 10:53:26koweysettopic: + Hashed
2010-03-16 11:01:04koweysettopic: + Documentation
nosy: + twb
messages: + msg10234
2010-03-26 15:22:56koweysetstatus: needs-implementation -> duplicate
superseder: + wish: mechanism for 3rd party tools to get patch file name (hashed repositories; file hash)
messages: + msg10532