On Wed, Dec 10, 2008 at 12:08:44AM +1100, Trent W. Buck wrote:
> Well, the expectation (for me, at least) is that --patch matches *a*
> patch (the latest match), and --to-patch matches a *set* of patches,
> up to and including the latest match.
> 
> I suppose that therefore --patch is still susceptible to --reorder,
> but I think it's less likely to happen than --to-patch.

Well, 'latest' has a miss-leading association to time (darcs is
not history-based), so 'last' is slightly better, although still
not very good.

Both --patch and --tag are susceptible to --reorder. They always
get the last matching item, where last refers to the inventory
order, which is the order in which all the patches in the repo
are (currently) applied to form the pristine tree, and is the
reverse order in which Changes lists patches.

But --to-tag and --from-tag are, unlike --to-patch and
--from-patch, not susceptible to --reorder, because they do the
commute dance to get the minimal dependency patch set (which is
the purpose of tags).

So, --from-patch and --to-patch, --from-match and --to-match,
--last, and --index select a *range* of patches from the
inventory. --from-tag and --to-tag selects a *<invent word
here>* of patches that fulfill the required dependencies.
--patches, and --tags both select *sets* of patches. --patch,
and --tag both select a single patch. Sometimes a single patch
is used to pick a set or range of patches, e.g., darcs get --tag
foo, which would be the same as darcs get --to-tag foo, but
--from-tag would make no sens with get (hm, with --lazy it
actually would...)

All expressions for patches are always matched against the last
matching patch (in inventory order), so it can sometimes be
tricky to get the right start and end of a patch range. This can
be made insanely complicated with e.g. --from-match 'date "10
days ago"' --to-match 'date "2 days ago"'. This will traverse
the inventory backwards to find the last patch (A) with a date 2
days ago, and the last patch (B) with a date 10 days ago, and if
(and only if) B comes after A in the inventory it will select
all patches that happen to be in the range A,B in the inventory,
regardless of these patches' dates. Amazing, isn't it. ;-)

I hope I .. erh ... cleared this out. Well, most of the darcs
options most of the time does exactly what one needs and
expects, so the interface is good even if it can be complicated
to give a formal explanation of how it "really" works. The show
contents command's options are not completely clear to me
though. --from-foo wouldn't make any sens, so that's probably
why the --to-foo options are not available, so the --foo options
serve as --to-foo instead. But the --index option violates this
"model". Perhaps the --index option should be split into an
--index=n, and a --range=n,m option? Or it could have two
different internal representations, so that one of them requires
a single index, whereas the other would accept a range too, but
they both would be called --index (-n), just like -p is
sometimes --patch and sometimes --patches.


-- 
Tommy Pettersson <[email protected]>
_______________________________________________
darcs-users mailing list
[email protected]
http://lists.osuosl.org/mailman/listinfo/darcs-users

Reply via email to