[darcs-users] Preserving timestamps etc

Andrew Pimlott andrew at pimlott.net
Fri Oct 1 21:16:39 UTC 2004


On Fri, Oct 01, 2004 at 05:06:46PM +1000, Anthony Towns wrote:
> On Thu, Sep 30, 2004 at 08:56:37PM +0200, Juliusz Chroboczek wrote:
> > Not necessarily.  I think it would be reasonable to request that
> > people use |darcs chmod| (or whatever) when they want a change of
> > metadata to get into the repo.  Chmod, touch etc. would only affect
> > the working dir.
> 
> That'd suck, though! You don't have to do "darcs vi", why should I use
> darcs to modify the contents of a symlink when I don't use it to modify
> the contents of a regular file? IMHO. :)

Agreed--I think it's worth doing right.

> On Thu, Sep 30, 2004 at 07:48:00PM -0400, Andrew Pimlott wrote:
> > On Thu, Sep 30, 2004 at 07:09:49AM -0400, David Roundy wrote:
> > > file-data-hook-add timestamp
> > >  read: find "$1" -printf "%TY%Tm%Td%TH%TM.%TS\n" -maxdepth 0
> > This is a fine design in principle, but it would make operations like
> > whatsnew a bit heavy.  
> 
> Well, darcs already checks timestamps; so you could make it only run
> the find when the timestamp actually changed, which wouldn't be so
> heavy.

In which case you might as well just do it directly in darcs.

> Alternatively, you could have a "read_all" command like:
> 
> 	read_all: find . -printf "%p %TY%Tm%Td%TH%TM.%TS\n"
> 
> and have darcs select the files that are actually in the archive (and
> ignore anything that hasn't changed). Or you could have a "read_these"
> command where darcs passes the files it thinks are interesting via
> stdin

That might work.  I guess it depends on how much file metadata people
really want to manage with darcs.  This scheme is overkill if it's only
going to be used for +x bits and timestamps.

> > It's probably be orders of magnitude faster to do
> > this in darcs itself.  If you were clever, you might create a Haskell
> > plug-in interface for getting/setting file metadata....
> 
> At least my version of darcs is compiled; wouldn't having a Haskell
> interface be pretty awkward -- you'd have to install a Haskell compiler
> or interpretor to use it? Having Haskell hooks for commuting or conflict
> resolution might make sense, but would seem tricky to get right.

There exists a plug-in library (which I haven't used) that allows
loading compiled Haskell, but this is probably too complicated.

Andrew




More information about the darcs-users mailing list