darcs

Issue 1541 point out when filenames differ only by case during backup

Title point out when filenames differ only by case during backup
Priority feature Status given-up
Milestone Resolved in
Superseder Nosy List campbell, darcs-devel, dmitry.kurochkin, jaredj, kowey
Assigned To
Topics ProbablyEasy, UI

Created on 2009-08-18.19:00:30 by campbell, last changed 2017-07-30.23:54:38 by gh.

Messages
msg8262 (view) Author: campbell Date: 2009-08-18.19:00:26
The last couple of times I ran `darcs pull' in my local copy of the
repository at <http://darcs.net/unstable/>, in which I have never done
anything but `darcs pull' and non-destructive commands such as `darcs
changes', Darcs made some backup files.  When I pulled some weeks ago,
it made Setup.hs-darcs-backup0 and tests/EXAMPLE.sh-darcs-backup0;
when I pulled few minutes ago, it made src/Preproc.hs-darcs-backup0.

At <http://paste.lisp.org/display/85602> is a transcript of my recent
update.  I ran `darcs revert' after I saw the original backup files,
and wanted to ensure that any edits I had made were reverted before I
pulled (although I am pretty sure that I had never edited any files in
the repository).

Eric Kow suggested that this was because those files had been renamed,
but with changes only to the case of the characters in their names,
and I am using Darcs on a case-insensitive file system (HFS+).  Thus
Darcs saw that there already was a file by the target name and backed
it up before writing the same file again.  So this seems harmless,
although slightly confusing.  Perhaps Darcs could detect this
situation and either not back up the file on case-insensitive file
systems, or, to be safer, just check whether the two names are
equivalent under case-folding, and if they are, say so when emitting a
message about backing the file up.
msg8263 (view) Author: kowey Date: 2009-08-18.19:10:40
> just check whether the two names are
> equivalent under case-folding, and if they are, say so when emitting a
> message about backing the file up.

This is actually very easy to do in Darcs since we already require such a check
in Darcs.IO

Consider this patch:

Fri Jun 13 08:02:13 BST 2008  Eric Kow <E.Y.Kow@brighton.ac.uk>
  * Fix a backup bug on case-insensitive file systems.
  
  Avoids this scenario.  The task: move foo to FOO and modify FOO
  1. FOO (foo) already exists, so I'll back it up
     (moves FOO [foo] to FOO.darcs-backup0)
  2. Now I can move foo to FOO
     foo no longer exists, but that's ok
     (nothing happens)
  3. Now I can FOO
     hey, where did FOO go?
     (crash!)

So pretty much everything is in place, we need only do a little IO or perhaps
extend the backup functions' IO
History
Date User Action Args
2009-08-18 19:00:30campbellcreate
2009-08-18 19:10:47koweysetstatus: unread -> needs-implementation
priority: feature
title: Darcs is confused slightly by file renaming that changes only case, on case-insensitive file systems -> point out when filenames differ only by case during backup
nosy: + jaredj
messages: + msg8263
topic: + ProbablyEasy, UI
2009-08-25 18:15:39adminsetnosy: + darcs-devel, - simon
2009-08-27 14:27:14adminsetnosy: kowey, darcs-devel, thorkilnaur, jaredj, dmitry.kurochkin, campbell
2010-04-04 09:21:49koweysetnosy: - thorkilnaur
2017-07-30 23:54:38ghsetstatus: needs-implementation -> given-up