[darcs-users] Preserving timestamps etc

Anthony Towns aj at azure.humbug.org.au
Fri Oct 1 07:06:46 UTC 2004


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. :)

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. That wouldn't work for permissions or ownership though.

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, though that doesn't work with find so well:

	read_these: perl -MPOSIX -lne 'chomp; @f = stat($_); printf "%s %s\n", $_, strftime("%Y%m%d%H%M.%S", gmtime($f[9]));'

> 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.

Cheers,
aj

-- 
Anthony Towns <aj at humbug.org.au> <http://azure.humbug.org.au/~aj/>
Don't assume I speak for anyone but myself. GPG signed mail preferred.

``Like the ski resort of girls looking for husbands and husbands looking
  for girls, the situation is not as symmetrical as it might seem.''
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : http://lists.osuosl.org/pipermail/darcs-users/attachments/20041001/94f49f37/attachment.pgp 


More information about the darcs-users mailing list