darcs

Patch 749 resolve issue1812: follow emacs convention for backup ...

Title resolve issue1812: follow emacs convention for backup ...
Superseder Nosy List miguel.pagano
Related Issues
Status accepted Assigned To
Milestone

Created on 2012-03-09.22:05:16 by miguel.pagano, last changed 2012-03-12.18:40:49 by gh.

Files
File name Status Uploaded Type Edit Remove
patch-preview.txt miguel.pagano, 2012-03-09.22:05:16 text/x-darcs-patch
resolve-issue1812_-follow-emacs-convention-for-backup-files.dpatch miguel.pagano, 2012-03-09.22:05:16 application/x-darcs-patch
unnamed miguel.pagano, 2012-03-09.22:05:16
See mailing list archives for discussion on individual patches.
Messages
msg15249 (view) Author: miguel.pagano Date: 2012-03-09.22:05:16
1 patch for repository http://darcs.net/screened:

Fri Mar  9 19:01:49 ART 2012  miguel.pagano+darcs@gmail.com
  * resolve issue1812: follow emacs convention for backup files
Attachments
msg15257 (view) Author: kerneis Date: 2012-03-10.06:44:35
On Fri, Mar 09, 2012 at 10:05:16PM +0000, miguel.pagano wrote:
> Fri Mar  9 19:01:49 ART 2012  miguel.pagano+darcs@gmail.com
>   * resolve issue1812: follow emacs convention for backup files

The patch looks correct but I’m still not convinced issue1812 is relevant.
Why should darcs use emacs convention? Darcs is not Emacs!

>  import System.Posix.Files ( createLink )
> -import System.Directory ( createDirectoryIfMissing )
> -import System.FilePath.Posix ( (</>), takeDirectory, normalise )
> +import System.FilePath.Posix ( (</>), normalise )
>  
>  import Darcs.Flags ( DarcsFlag( SignAs, Sign, SignSSL,
>                                  Verify, VerifySSL )
> hunk ./src/Darcs/External.hs 126
>  backupBy backup f =
>             do hasBF <- doesFileExist f
>                hasBD <- doesDirectoryExist f
> -              when (hasBF || hasBD) $ helper (0::Int)
> +              when (hasBF || hasBD) $ helper 0
>    where
> hunk ./src/Darcs/External.hs 128
> +  helper :: Int -> IO ()
>    helper i = do existsF <- doesFileExist next
>                  existsD <- doesDirectoryExist next
>                  if (existsF || existsD)

Even if it is rejected, this clean-up part might be worth recording as a
separate patch anyway.

Thanks,
-- 
Gabriel
msg15259 (view) Author: stephen Date: 2012-03-10.17:33:03
Gabriel Kerneis writes:
 > On Fri, Mar 09, 2012 at 10:05:16PM +0000, miguel.pagano wrote:
 > > Fri Mar  9 19:01:49 ART 2012  miguel.pagano+darcs@gmail.com
 > >   * resolve issue1812: follow emacs convention for backup files
 > 
 > The patch looks correct but I’m still not convinced issue1812 is relevant.
 > Why should darcs use emacs convention? Darcs is not Emacs!

Wrong way to think about it.  The right question is not "why should
darcs use emacs convention?" but rather "why should darcs be
different?"

If darcs is not going to be different (and I think that is the
appropriate decision, but admit I haven't thought about it carefully),
then emacs convention is as good as any, though no better than most.

Cheers!
msg15273 (view) Author: gh Date: 2012-03-12.17:48:43
Stephen, see http://bugs.darcs.net/msg15171 .
msg15275 (view) Author: gh Date: 2012-03-12.18:40:49
The change is trivial and all tests pass, I'm pushing the patch.
History
Date User Action Args
2012-03-09 22:05:16miguel.paganocreate
2012-03-10 06:44:35kerneissetmessages: + msg15257
2012-03-10 17:33:04stephensetmessages: + msg15259
2012-03-12 17:48:43ghsetmessages: + msg15273
2012-03-12 18:40:49ghsetstatus: needs-screening -> accepted
messages: + msg15275