[darcs-devel] darcs ohloh_scm/openhub support, "darcs show contents"

Ben Franksen ben.franksen at online.de
Sun Feb 22 21:47:06 UTC 2015


Andreas Wagner wrote:
> Darcs support on openhub is almost here!
> 
> https://github.com/blackducksw/ohloh_scm/pull/23
> 
> https://github.com/blackducksw/ohloh_scm/pull/10
> 
> AFAIK there's just one remaining problem described in pull/23. Maybe some
> of you know something about it?

The flags to select a specific patch (the one you use is --hash) don't make 
sense for this command!

This is the relevant part of the help output:

Usage: darcs show contents [OPTION]... [FILE]...
Outputs a specific version of a file.

Options:
             --match=PATTERN       select a single patch matching PATTERN
  -p REGEXP  --patch=REGEXP        select a single patch matching REGEXP
  -h HASH    --hash=HASH           select a single patch with HASH
  -t REGEXP  --tag=REGEXP          select tag matching REGEXP
  -n N       --index=N             select one patch

The only option that is useful here is --tag, because only a tag gives you a 
"specific version" of a file.

Assume patch A adds file F, then patch B makes a completely unrelated change 
to some other file. That means Darcs is free to re-order the two patches. If 
the patches are in order [A, B], then "darcs show contents F -h 
hash_of_patch_A" will give you the content of f. But if the order is [B, A], 
then you get nothing.

In Darcs, patches are *not* the same as revisions.

A good way to fix this would be to replace the nonsense options with 
semantically correct ones: --to-match or --to-patch (there is no --to-hash 
currently, but --to-match 'hash HASH' would do the trick). These forms 
explicitly refer to the set of patches up to (including) a given patch, 
where "up to" means "in the order in which they are currently stored in the 
repository".

I will make an entry in the bug tracker.

Cheers
Ben
-- 
"There are two ways of constructing a software design: One way is to
make it so simple that there are obviously no deficiencies and the other
way is to make it so complicated that there are no obvious deficiencies.
The first method is far more difficult."   ― C.A.R. Hoare




More information about the darcs-devel mailing list