Using hash(es) for selecting one or more patches
Gian Piero Carrubba <gpiero <at> rm-rf.it>
2014-08-14 19:42:20 GMT
now that `log` shows the hash of the patches, I would like to use it for
selecting patches as `log (or whatever) -p` is not much handy where
there are similar- or same-named patches. On the other hand, typing
`--match 'hash` is boring, so I've added a `-H/--hash` option that
aliases to `--match 'hash ...'`.
Then I've changed idea and instead thought that I would prefer to
continue using `-p` and darcs should discriminate if I've provided a
regex or a hash. So I've modified `-p` (and the related `--from-patch`
and `--to-patch`) in order to consider its argument as a hash if it's 40
chars long and only composed by hex digits.
- much shorter patch
- no options inflating
1. no hash prefix matches: too many chances for false positives.
2. lack of correctness if your regex happens to be a 40 digits long hex.
In this case you would have to resort to `--match 'name ...'`
If we had (or will have in the future) a short-id like other VCSs, we
could use both full and short versions for alleviate 1, but this would
OTOH aggravate 2.
While I consider the chances for 2. pretty limited, the drawbacks seem
serious: user's surprise, breakage of sw that automatically names
patches using hashes, possible kittens injuries, ...