On Fri, 29 Apr 2005, Russell King wrote: > On Fri, Apr 29, 2005 at 02:07:29PM -0700, Junio C Hamano wrote: > > >>>>> "LT" == Linus Torvalds <torvalds@osdl.org> writes: > > LT> Absolutely. I use the same "git-pull-script" between two local directories > > LT> on disk... > > LT> Of course, I don't bother with the linking. But that's the trivial part. > > > > Would it be useful if somebody wrote local-pull.c similar to > > http-pull.c, which clones one local SHA_FILE_DIRECTORY to > > another, with an option to (1) try hardlink and if it fails > > fail; (2) try hardlink and if it fails try symlink and if it > > fails fail; (3) try hardlink and if it fails try copy and if it > > fails fail? > > What would be nice is if it finds an existing file for the one it's > trying to hard link, it compares the contents (maybe - is this actually > necessary?) and if identical, it removes the original file replacing > it with a hard link. Unless I have completely misunderstood things, you never need to compare the file contents. Just compare the file names. If they match, i.e. the SHA1 is the same, the contents must match by definition. So you only need a stat(), rather than read&decompress&compare. > This means that you'll always be trying to maintain the hard linked > structure between various working trees in the background. > > But maybe this should have an option to enable this behaviour. There should definitely be an option to either enable or disable this as there are legitimate cases for not wanting hard links or indeed using file systems which do not support them. Best regards, Anton -- Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @) Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/ - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.htmlReceived on Sat Apr 30 07:59:15 2005
This archive was generated by hypermail 2.1.8 : 2005-04-30 07:59:16 EST