[darcs-users] Using hash(es) for selecting one or more patches
Guillaume Hoffmann
guillaumh at gmail.com
Mon Aug 25 19:51:31 UTC 2014
Hi Gian Piero
> 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`[0] option that aliases to
> `--match 'hash ...'`.
I think it's a good idea.
I wouldn't even mind using -h (currently used as --help). Some
programs use it as a --help alias (svn, hg), others don't (git, ghc).
> 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.
>
> advantages:
> - much shorter patch
I'm not sure I understand. You mean shorter flag?
> - no options inflating
>
> disadvantages:
> 1. no hash prefix matches: too many chances for false positives.
Yeah I would also make this choice.
> 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 ...'`
Yes that's a concern.
> 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, ...
Indeed. I wonder if people out there use hashes as patch names?
Guillaume
More information about the darcs-users
mailing list