Libraries in the repo

Simon Marlow marlowsd at
Fri Aug 28 06:42:00 EDT 2009

On 28/08/2009 10:05, Simon Marlow wrote:
> On 27/08/2009 11:37, Sittampalam, Ganesh wrote:
>> Simon Marlow wrote:
>>>>>> Simon Marlow wrote:
>>>>>>>> I suggest if we stick with the independent repo approach that we
>>>>>>>> have some automation to check that changes are indeed getting
>>>>>>>> pushed upstream.
>> [snip unhelpful suggestion from me]
>>> Yes, it tells you that you've screwed up, rather than telling you
>>> that you're about to screw up, which would be much more convenient.
>>> After you've screwed up it might be too late to fix it, due to
>>> conflicts with upstream.
>> Can you arrange that the only way that patches can get into the branch
>> is via darcs pull --intersection<upstream repo> ?
> That's an interesting idea, I'd forgotten about --intersection.

I have a script that works as a prehook (below).  Unfortunately it 
doesn't work on, I think because we only have darcs 
1.0.9 there, and it is ignoring my prehook.

Can anyone think of a good reason not to upgrade darcs to 2.3.0 on  I can think of 3 reasons to do so:

  - this script, for preventing accidental divergence from upstream
  - faster pushes, due to transfer-mode
  - hide those annoying "Ignore-this: xxxxx" messages


#!/bin/sh -e


# Only allow applying of patches that are also in this upstream repository:


# Take $DARCS_PATCHES_XML and turn it into a list of patch hashes
# suitable for looping over.
hashes=`echo $DARCS_PATCHES_XML | sed 's|</patch>|</patch>\n|g' | sed -n 
'/hash/p' | sed "s|^.*hash='\([^']*\)'.*$|\1|"`

# echo hashes: $hashes

# For each patch, try pulling the patch from the upstream repo.  If
# the patch is not upstream, then fail.
for p in $hashes; do
   if darcs pull --match="hash $p" $UPSTREAM --xml --dry-run | grep "$p" 
 >/dev/null; then
       echo "Patch $p is upstream; ok"
       echo "Patch $p is not upstream!"
       exit 1

exit 0

More information about the Glasgow-haskell-users mailing list