[darcs-users] applying patches on windows
Juliusz Chroboczek
Juliusz.Chroboczek at pps.jussieu.fr
Fri Nov 4 19:42:02 UTC 2005
> Update, I just pulled another copy of the repo onto my windows box and
> applied the patch to that copy and it worked!
> Any reason why it wouldn't work on a repo that darcs check says is
> consistent?
I'm guessing here, but I suspect that while the repo was mangled, it
was mangled consistently: all the patch files in the repo had their
LFs replaced with CR/LF pairs. If only some of the patch files were
mangled, Darcs would notice that something is amiss; if all of them
were, there's nothing technically wrong with the repo.
Darcs is pretty paranoid about in-transit patch bundles (a checksum is
included), but it's very trusting with on-disk files. Which is a
problem in environments that perform user-friendly conversion behind
the program's back[1].
I believe that this lack of end-to-end validation is a serious limi-
tation of Darcs. It's difficult to fix, though, due to the need to
commute patch files around.
> Any way to make the failing repo work properly?
You could try doing the inverse conversion, but it's tricky and
error-prone. I'd rather suggest you regenerate the repo from scratch.
Juliusz
[1] Don't take me wrong: it's performing the conversion *behind the
program's back* that's wrong, not performing the conversion in itself.
Cygwin performs the conversion by default, and requires explicit
program action to disable the conversion (using the O_BINARY flag),
which means that whenever you use a program that was ``ported'' to
Cygwin without including all the necessary O_BINARY flags, you will
corrupt your data.
The right thing to do would be to require all calls to open to
require one of O_BINARY or O_TEXT, or at least making O_BINARY the
default (it might make your files unusable with native applications,
but at least it avoids losing data). This sort of laziness is at the
root of my distaste for Cygwin.
More information about the darcs-users
mailing list