<div dir="ltr">Dear all,<div><br></div><div>I have written a program darcs-history that can be used as a posthook to track darcs commands. For now, it is availabe via</div><div><br></div><div>    darcs get <a href="http://www.informatik.uni-kiel.de/~sebf/darcs/darcs-history" target="_blank">http://www.informatik.uni-kiel.de/~sebf/darcs/darcs-history</a></div>


<div><br></div><div>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:</div><div><br></div><div>    <a href="http://www.informatik.uni-kiel.de/~sebf/darcs/darcs-history/README.html" target="_blank">http://www.informatik.uni-kiel.de/~sebf/darcs/darcs-history/README.html</a></div>

<div><br></div><div>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.)</div>

<div><br></div><div>I noticed two problems with posthooks when implementing darcs-history. They might be worth looking into independently.</div>
<div><br></div><div>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?</div>



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

<div><br></div><div class="gmail_extra">Best regards,</div><div class="gmail_extra">Sebastian</div></div>