[darcs-devel] adding feature: patch origins

Sebastian Fischer mail at sebfisch.de
Thu Feb 21 10:04:55 UTC 2013


Dear all,

I have written a program darcs-history that can be used as a posthook to
track darcs commands. For now, it is availabe via

    darcs get http://www.informatik.uni-kiel.de/~sebf/darcs/darcs-history

This is only a preliminary location. I will find a permanent one if we
decide to keep the program separate from darcs. There is a README file too:

    http://www.informatik.uni-kiel.de/~sebf/darcs/darcs-history/README.html

The program can be used both for "repository history" (local to the working
directory) and for "branch history" (by checking in the history file).
Reading in clones and writing only in a dedicated repository avoids merge
problems. To avoid changing the history file when recording it,
darcs-history has an option to automatically record the history file after
changing it without calling a posthook. I'm not sure whether I am using the
darcs library correctly here, although it works as expected (I might miss
some checks that are usually performed and my use of the FixFilePath option
resulted from a little bit of guesswork.)

I noticed two problems with posthooks when implementing darcs-history. They
might be worth looking into independently.

1. Usually, darcs posthooks are executed in the root directory of the
repository (even if darcs was executed in a subdirectory). This is good,
but there is an exeption: darcs get. The posthook for get is executed in
the directory where get is executed. For darcs-history it would be better
to execute the posthook in the newly created repository, so darcs-history
knows where it is and can write history information in the right place.
Would this be useful for other uses of posthooks too? Should we avoid
changing the directory to not disturb existing posthooks?

2. Posthooks for 'record' and 'amend-record' are not given the environment
variable DARCS_PATCHES. Is this intended or should it be fixed?

Best regards,
Sebastian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osuosl.org/pipermail/darcs-devel/attachments/20130221/94d92530/attachment-0001.html>


More information about the darcs-devel mailing list