[darcs-devel] adding feature: patch origins

Ganesh Sittampalam ganesh at earth.li
Sat Feb 23 23:14:50 UTC 2013


Hi Sebastian,

I'm impressed with how simple darcs-history is!

I think the use of record is fine as it is - I've had a quick scan
through the "normal" wrapper code and can't spot anything that matters here.

Do you think it should be integrated with darcs?

I guess I would be inclined against, given that it's not very
inconvenient to have it outside. The usual downside with maintaining
code outside darcs is our lack of a stable API, but hopefully that won't
be too much of a pain given the limited amount it actually needs to do.

Regarding the two problems with posthooks you mention, I think both
should be changed:

 - The behaviour of get won't be backwards compatible but I'd be
surprised if many people are using it, and they have strictly more
information now (if they actually want the old behaviour they can just
cd .. at the start).

 - adding DARCS_PATCHES to record/amend-record is useful, makes things
more consistent, and is highly unlikely to break anything. I certainly
can't see any good reason for it being omitted.

So (in my view) feel free to make tickets for these and/or fix them.

Cheers,

Ganesh

On 21/02/2013 10:04, Sebastian Fischer wrote:
> 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
> 
> 
> _______________________________________________
> darcs-devel mailing list
> darcs-devel at darcs.net
> http://lists.osuosl.org/mailman/listinfo/darcs-devel
> 



More information about the darcs-devel mailing list