[darcs-users] Post-hook freeze under darcs-unstable mingw compile

Kurt Granroth darcs-users at granroth.org
Sun May 27 05:34:29 UTC 2007


Max Battcher wrote:
> On 5/26/07, Kurt Granroth <darcs-users at granroth.org> wrote:
>> Er.. but that would assume that the posthook was started *inside* of the
>> repo directory.  Is the posthook command given any parameters?  Like say
>> the name of the repo working directory?
> 
> The posthook should have the same working directory as the repo
> working directory, I believe.  The posthook is given no parameters
> right now.  There have been some ideas for parameters to pass and I
> believe the general idea was to pass any and all posthook parameters
> as environment variables.

Looks like that is not working, at least for 'get'.  Here's an example:

kurt at home:~/Source/darcs> pwd
/home/kurt/Source/darcs
kurt at home:~/Source/darcs> darcs get --posthook=pwd --run-posthook
repos/test test-working
Copying patch 1 of 1... done.
Finished getting.
/home/kurt/Source/darcs

(The 'darcs get' line wraps)

I would expect that the 'pwd' in the posthook be
/home/kurt/Source/darcs/test-working but instead its in the same
directory that I called 'darcs' from.

> Don't forget that you can use ``darcs query manifest`` to get the list
> of darcs-controlled files, and I'd recommend not touching anything
> under _darcs or you'll risk repository corruption.

Yeah, that might work a lot better than my 'find' command.  Much more
specific.  Thanks!

Although.. it would take some sed work to really clean up:

$ darcs query manifest
./subdir/hello.cpp
./subdir/hello.c
./Directory\32\With\32\Spaces/File\32\With\32\Spaces.txt
./file.c

$ darcs query manifest | xargs file
./subdir/hello.cpp:                               ASCII C program text
./subdir/hello.c:                                 ASCII C program text
./Directory32With32Spaces/File32With32Spaces.txt: cannot open
`./Directory32With32Spaces/File32With32Spaces.txt' (No such file or
directory)
./file.c:                                         ASCII C program text

$ darcs query manifest | sed -e 's,\\32\\, ,g' | tr \\n \\0 | xargs -0 file
./subdir/hello.cpp:                           ASCII C program text
./subdir/hello.c:                             ASCII C program text
./Directory With Spaces/File With Spaces.txt: ASCII text
./file.c:                                     ASCII C program text



More information about the darcs-users mailing list