[darcs-users] review darcs patch: Simplify EXAMPLE.sh.

Trent W. Buck twb at cybersource.com.au
Mon Sep 21 02:34:58 UTC 2009

Kamil Dworakowski <kamil at dworakowski.name> writes:

> Tue Aug 25 16:25:31 BST 2009  Eric Kow <kowey at darcs.net>
>   * Simplify EXAMPLE.sh.
>   1. Don't clean up.  When you're working on just one test, it's easier
>      to figure out if the test is correct if you have access to the
>      repository.  Pre-flight cleanup by all test scripts is now essential.
> I agree.

I reluctantly agree, though I'd prefer the outermost setup and teardown
operations to be done by cabal rather than each test (issue1283).

>   2. Don't rely on --repo except for init (where it saves some boilerplate)
>      a) Makes test scripts more natural and straightforward to write.
>      b) Reduces the number of variables that we are testing, ie.
>         ensuring that --repo path handling is working correctly at all times.
> Good point. The --repo way is too verbose.

The reason I initially added it was because $PWD is implied state, and
FP teaches us that state is bad.  Specifically, it means that when
copy-and-pasting parts of a test into a shell, if you forget the cd, it
all breaks.  I also find it less confusing when working with >1 repo.

Given the apparently widespread preference for cd, I'll give up on this.

Also, the rationale for using one-letter directories and files (instead
of the older "temp1" convention) is that they're shorter and about as
meaningful.  The implied convention is:

    repositories: R, S, ...
    directories: d, e, ...
    files: f, g, ...

One bug in this convention is that you can't express 3 dirs and a file
in a single dir.

More information about the darcs-users mailing list