[darcs-devel] darcs patch: added postget to prefs (and 2 more)

Jason Dagit dagit at codersbase.com
Mon Aug 1 23:58:53 PDT 2005


On Aug 1, 2005, at 10:17 AM, dagit at eecs.oregonstate.edu wrote:

> Quoting David Roundy <droundy at abridgegame.org>:
>
>
>> $ cat /home/droundy/.darcs/defaults
>> send --edit-description
>>
>
> I will certainly try this.  Thanks for the tip.
>
>
>> ...
>>
>>> Finally, the rationale for this feature is that now I can have a
>>> "central" repository with a special test defined (one that sends out
>>> email notification for successful patches), and I can use postget to
>>> set a different test for the copies of the repository.  So, when
>>> someone gets a copy of the repo, the postget command will be run and
>>> it will modify test so that it no longer sends out email  
>>> notification.
>>>
>>
>> I'd rather support this feature with a hook to apply than with a  
>> hook to
>> get.  In spite of the fact that I created it, I don't care for the  
>> whole
>> prefs and setprefs mechanism--it has too many potentially confusing
>> features (see, for example, my response to your doc fix).
>>
>> I'd like most hooks (and get here is a special exception, since the
>> repository in question doesn't exist until after the command is  
>> run) to be
>> implemented as simple command-line flags that would normally be  
>> specified
>> in either _darcs/prefs/defaults or ~/.darcs/defaults.  Thus a post- 
>> hook
>> in apply would quite naturally allow you to do your email  
>> notifications in
>> the central repo.

I've been trying to store this postget setting in either _darcs/prefs/ 
defaults or ~/.darcs/defaults.  I'm having a very hard time fitting  
this into the current framework.  Following the example set by  
show_motd, I have a function (untested) that I think will grab the  
(possibly) remote _darcs/prefs/defaults file and return it as an IO  
String.  I want to then process that the normal way (the way  
get_default_flag would do it).  Any ideas?  I've just spent quite a  
bit of time on it and I'm stumped as to a simple way of doing it.   
Looking at things I don't think a remote path such as URL can be used  
with 'ReadableDirectory m'.

Thanks,
Jason




More information about the darcs-devel mailing list