On 06/06/2011 02:39 PM, Miles Gould wrote:
On Sat, Jun 4, 2011 at 12:12 PM, Steffen Schuldenzucker
<[email protected]> wrote:
More traditional DVCSs like mercurial or git
As Stephen points out, "more traditional" isn't the right term here:
darcs pre-dates most of the DAG-based DVCSes :-)
Uh, yeah, right. This was from my very personal point of view; I'd been
working with mercurial for some time before I met darcs. :D
[...]
Do you use tags?
What, tag every patch to force a linear history (at least within
repos)? At that point, you might as well give up on darcs, and use a
system that was designed for that model.
No, I was thinking of tags like feature_X_working to define at least one
set of patches where X is known to work. If one patch = one feature,
this gets absurd, of course.
I'm not aware of a standard solution to your problem, but here's a
somewhat hacky possibility:
- add a prehook to darcs-record that looks through any added hunks
for any references to theorems, citations, etc, and any newly-added
definitions. Store these away somewhere.
- add a posthook to darcs-record that adds lines of the form
ADDED THEOREM: p!=np
ADDED CITATION: euler1735
to your commit message, then reads out the list of referenced
definitions, invokes `darcs changes` to determine the commit in which
each referenced definition was added, and then calls `darcs
amend-record` to add the newly-found dependencies.
Oh, hang on, amend-record doesn't support --ask-deps. How odd. So that
won't work. Let's try ratcheting up the hackiness.
Instead of using hooks, invoke `darcs record` from within an expect
script (I think we were going to have to use expect anyway, since I
can see no non-interactive way of specifying additional dependencies)
that
1. Calls `darcs whatsnew` to see what's changed.
2. Searches the diff for any new definitions and references to
existing definitions.
3. Calls `darcs changes --matches` to find the patches that added
these definitions.
4. Interacts with `darcs record --ask-deps` to add the additional
dependencies, and adds the "ADDED THEOREM" lines to the bottom of your
commit messages.
Anyone got any better ideas?
Do we need the ADDED THEOREM lines? Couldn't we just, for any added
\ref{x} in the current `darcs whatsnew`, depend on `darcs changes
--matches='hunk "+.*\label{x}"'` (modulo regex escaping)?
Things get more complicated if labels can be removed and added later
again, then we may want to depend on the - uhm - earliest match?
-- Steffen
_______________________________________________
darcs-users mailing list
[email protected]
http://lists.osuosl.org/mailman/listinfo/darcs-users