Skip to contentSkip to conversation

More problems...

PATCH New Russell King 10 participants 24 messages Jun 15, 2016 Kbuild

lore
Share & tools
lore
#0 lore raw

Ok. cogito-0.8.

rmk@dyn-67:[linux-2.6-rmk]:<1049> cg-update origin
../linux-2.6/.git/refs/heads/master' -> .git/refs/heads/origin' ../linux-2.6/.git/objects/00/78aeb85737197a84af1eeb0353dbef74427901' -> .git/objects/00/78aeb85737197a84af1eeb0353dbef74427901'
cp: cannot create link .git/objects/00/78aeb85737197a84af1eeb0353dbef74427901': File exists ../linux-2.6/.git/objects/01/ca31cc7bfdd18d6f72288915021730442f386d' -> `.git/objects/01/ca31cc7bfdd18d6f72288915021730442f386d'
cp: cannot create link .git/objects/01/ca31cc7bfdd18d6f72288915021730442f386d': File exists ../linux-2.6/.git/objects/04/17820d15efac837a84f9ade46f56339016a282' -> `.git/objects/04/17820d15efac837a84f9ade46f56339016a282'
cp: cannot create link .git/objects/04/17820d15efac837a84f9ade46f56339016a282': File exists ../linux-2.6/.git/objects/07/da010b67d4d715b5e97dfb824eb70433776a20' -> `.git/objects/07/da010b67d4d715b5e97dfb824eb70433776a20'
cp: cannot create link .git/objects/07/da010b67d4d715b5e97dfb824eb70433776a20': File exists ../linux-2.6/.git/objects/07/5d3961a119e8f27294cd77193f8fee7908a521' -> `.git/objects/07/5d3961a119e8f27294cd77193f8fee7908a521'
...
cp: cannot create link .git/objects/fc/1428905472a61e8e51057a4237acab5d8594d8': File exists ../linux-2.6/.git/objects/fc/373c483e62dc1bbc5c3915f2d3c795fb316ec5' -> `.git/objects/fc/373c483e62dc1bbc5c3915f2d3c795fb316ec5'
cp: cannot create link .git/objects/fc/373c483e62dc1bbc5c3915f2d3c795fb316ec5': File exists ../linux-2.6/.git/objects/ff/c3be3dff7e20e2ad5367fa8d6d0d2f0baa8a24' -> `.git/objects/ff/c3be3dff7e20e2ad5367fa8d6d0d2f0baa8a24'
cp: cannot create link .git/objects/ff/c3be3dff7e20e2ad5367fa8d6d0d2f0baa8a24': File exists ../linux-2.6/.git/objects/ff/8b49966a9f6ed23f6489bb986de87a14d4b783' -> `.git/objects/ff/8b49966a9f6ed23f6489bb986de87a14d4b783'
cp: cannot create link `.git/objects/ff/8b49966a9f6ed23f6489bb986de87a14d4b783': File exists
cg-pull: rsync error

rmk@dyn-67:[linux-2.6-rmk]:<1052> md5sum .git/objects/ff/8b49966a9f6ed23f6489bb986de87a14d4b783 ../linux-2.6/.git/objects/ff/8b49966a9f6ed23f6489bb986de87a14d4b783 194b70d0eed786807e14e97dd0a5ad8d .git/objects/ff/8b49966a9f6ed23f6489bb986de87a14d4b783
194b70d0eed786807e14e97dd0a5ad8d ../linux-2.6/.git/objects/ff/8b49966a9f6ed23f6489bb986de87a14d4b783
rmk@dyn-67:[linux-2.6-rmk]:<1053> vdir .git/objects/ff/8b49966a9f6ed23f6489bb986de87a14d4b783 ../linux-2.6/.git/objects/ff/8b49966a9f6ed23f6489bb986de87a14d4b783 -rw-rw-r-- 1 rmk rmk 3070 Apr 28 10:43 .git/objects/ff/8b49966a9f6ed23f6489bb986de87a14d4b783
-rw-r--r-- 1 rmk rmk 3070 Apr 29 16:50 ../linux-2.6/.git/objects/ff/8b49966a9f6ed23f6489bb986de87a14d4b783

What seems to be happening is that I create changes in my tree, rsync them out to kernel.org. Linus pulls them into his tree. I pull them back into my reference tree, and then try and update my working tree.

By that time, the object files in the reference tree appear to have a newer timestamp than the corresponding ones in my local tree, and cp -lua fails.

Which means cogito fails to work for me... Help.

Signature · 1 line
Russell King
#1 lore raw
Quoted 34 lines · Russell King

Ok. cogito-0.8.

rmk@dyn-67:[linux-2.6-rmk]:<1049> cg-update origin
../linux-2.6/.git/refs/heads/master' -> .git/refs/heads/origin' ../linux-2.6/.git/objects/00/78aeb85737197a84af1eeb0353dbef74427901' -> .git/objects/00/78aeb85737197a84af1eeb0353dbef74427901'
cp: cannot create link .git/objects/00/78aeb85737197a84af1eeb0353dbef74427901': File exists ../linux-2.6/.git/objects/01/ca31cc7bfdd18d6f72288915021730442f386d' -> `.git/objects/01/ca31cc7bfdd18d6f72288915021730442f386d'
cp: cannot create link .git/objects/01/ca31cc7bfdd18d6f72288915021730442f386d': File exists ../linux-2.6/.git/objects/04/17820d15efac837a84f9ade46f56339016a282' -> `.git/objects/04/17820d15efac837a84f9ade46f56339016a282'
cp: cannot create link .git/objects/04/17820d15efac837a84f9ade46f56339016a282': File exists ../linux-2.6/.git/objects/07/da010b67d4d715b5e97dfb824eb70433776a20' -> `.git/objects/07/da010b67d4d715b5e97dfb824eb70433776a20'
cp: cannot create link .git/objects/07/da010b67d4d715b5e97dfb824eb70433776a20': File exists ../linux-2.6/.git/objects/07/5d3961a119e8f27294cd77193f8fee7908a521' -> `.git/objects/07/5d3961a119e8f27294cd77193f8fee7908a521'
...
cp: cannot create link .git/objects/fc/1428905472a61e8e51057a4237acab5d8594d8': File exists ../linux-2.6/.git/objects/fc/373c483e62dc1bbc5c3915f2d3c795fb316ec5' -> `.git/objects/fc/373c483e62dc1bbc5c3915f2d3c795fb316ec5'
cp: cannot create link .git/objects/fc/373c483e62dc1bbc5c3915f2d3c795fb316ec5': File exists ../linux-2.6/.git/objects/ff/c3be3dff7e20e2ad5367fa8d6d0d2f0baa8a24' -> `.git/objects/ff/c3be3dff7e20e2ad5367fa8d6d0d2f0baa8a24'
cp: cannot create link .git/objects/ff/c3be3dff7e20e2ad5367fa8d6d0d2f0baa8a24': File exists ../linux-2.6/.git/objects/ff/8b49966a9f6ed23f6489bb986de87a14d4b783' -> `.git/objects/ff/8b49966a9f6ed23f6489bb986de87a14d4b783'
cp: cannot create link `.git/objects/ff/8b49966a9f6ed23f6489bb986de87a14d4b783': File exists
cg-pull: rsync error

rmk@dyn-67:[linux-2.6-rmk]:<1052> md5sum .git/objects/ff/8b49966a9f6ed23f6489bb986de87a14d4b783 ../linux-2.6/.git/objects/ff/8b49966a9f6ed23f6489bb986de87a14d4b783 194b70d0eed786807e14e97dd0a5ad8d .git/objects/ff/8b49966a9f6ed23f6489bb986de87a14d4b783
194b70d0eed786807e14e97dd0a5ad8d ../linux-2.6/.git/objects/ff/8b49966a9f6ed23f6489bb986de87a14d4b783
rmk@dyn-67:[linux-2.6-rmk]:<1053> vdir .git/objects/ff/8b49966a9f6ed23f6489bb986de87a14d4b783 ../linux-2.6/.git/objects/ff/8b49966a9f6ed23f6489bb986de87a14d4b783

(quoted diff) +0 -2
-rw-rw-r--  1 rmk rmk 3070 Apr 28 10:43 .git/objects/ff/8b49966a9f6ed23f6489bb986de87a14d4b783
-rw-r--r--  1 rmk rmk 3070 Apr 29 16:50 ../linux-2.6/.git/objects/ff/8b49966a9f6ed23f6489bb986de87a14d4b783

What seems to be happening is that I create changes in my tree, rsync them out to kernel.org. Linus pulls them into his tree. I pull them back into my reference tree, and then try and update my working tree.

Quoted 5 lines

By that time, the object files in the reference tree appear to have a newer timestamp than the corresponding ones in my local tree, and cp -lua fails.

Which means cogito fails to work for me... Help.

I've worked around it by doing:

$ rm -rf .git/objects/*
$ cg-update origin

Not particularly nice, but very necessary, and apparantly the only way to get this to work. Grumble. Why am I seemingly the only one running into all these blocking problems.

Signature · 1 line
Russell King
#2 lore raw
Quoted 4 lines · Russell King

Not particularly nice, but very necessary, and apparantly the only way to get this to work. Grumble. Why am I seemingly the only one running into all these blocking problems.

Well, I suspect not a lot of people are actually using cogito for kernel stuff.

I still use my old "git-pull-script" to update stuff. I know how it works, and it does at least these things right (as long as "merge-base" works right, of course - which so far it has for me since the re-write).

Linus

#3 lore raw
In reply to Russell King

Dear diary, on Fri, Apr 29, 2005 at 06:01:27PM CEST, I got a letter where Russell King <[email protected]> told me that...

Quoted 7 lines

rmk@dyn-67:[linux-2.6-rmk]:<1049> cg-update origin ../linux-2.6/.git/objects/00/78aeb85737197a84af1eeb0353dbef74427901' -> .git/objects/00/78aeb85737197a84af1eeb0353dbef74427901'
cp: cannot create link `.git/objects/00/78aeb85737197a84af1eeb0353dbef74427901': File exists

By that time, the object files in the reference tree appear to have a newer timestamp than the corresponding ones in my local tree, and cp -lua fails.

I'm now away ,unfortunately, and no immediate idea stems to my mind on how to fix it. Ideas welcomed - I need to hardlink missing entries from one tree to another; it would be enough to be able to just tell cp to ignore already present files.

Could you please try to give cp the -f flag?

Signature · 3 lines
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor
#4 lore raw
Quoted 10 lines · Petr Baudis

Dear diary, on Fri, Apr 29, 2005 at 06:01:27PM CEST, I got a letter where Russell King <[email protected]> told me that...

Quoted 7 lines

rmk@dyn-67:[linux-2.6-rmk]:<1049> cg-update origin ../linux-2.6/.git/objects/00/78aeb85737197a84af1eeb0353dbef74427901' -> .git/objects/00/78aeb85737197a84af1eeb0353dbef74427901'
cp: cannot create link `.git/objects/00/78aeb85737197a84af1eeb0353dbef74427901': File exists

By that time, the object files in the reference tree appear to have a newer timestamp than the corresponding ones in my local tree, and cp -lua fails.

Quoted 6 lines

I'm now away ,unfortunately, and no immediate idea stems to my mind on how to fix it. Ideas welcomed - I need to hardlink missing entries from one tree to another; it would be enough to be able to just tell cp to ignore already present files.

Could you please try to give cp the -f flag?

Why not just use "rsync" for both remote and local synchronization, and provide a "relink" command to scan two .git/objects/ repositories and hardlink matching files together?

With the SHA1 hash, you can even have a --unsafe option that just compares the has names and does a link based purely off of that and the stat(2) results of both files. (I'd expect that a ... safer variant would extract both files and compare them, but the --unsafe should be sufficient, in practice, I would think.)

Signature · 2 lines
Ryan Anderson
  sometimes Pug Majere
#5 lore raw

Hello,

Quoted 3 lines

Why not just use "rsync" for both remote and local synchronization, and provide a "relink" command to scan two .git/objects/ repositories and hardlink matching files together?

That came to my mind, too. And it is actually the only thing that makes sense. - In matters of KISS. :-)

Thomas

#6 lore raw
In reply to Ryan Anderson

Dear diary, on Fri, Apr 29, 2005 at 09:50:55PM CEST, I got a letter where Ryan Anderson <[email protected]> told me that...

Quoted 3 lines

Why not just use "rsync" for both remote and local synchronization, and provide a "relink" command to scan two .git/objects/ repositories and hardlink matching files together?

No. This completely misses the point, which is to avoid useless I/O when doing this local stuff; also, it saves disk space to a degree, but it is wildly fluctuating.

I like Junio's local-pull solution much more (from the conceptual standpoint; I didn't look at the code yet).

Signature · 3 lines
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor
#7 lore raw
In reply to Ryan Anderson
Quoted 4 lines · Ryan Anderson

Why not just use "rsync" for both remote and local synchronization, and provide a "relink" command to scan two .git/objects/ repositories and hardlink matching files together?

Absolutely. I use the same "git-pull-script" between two local directories on disk. The only issue there is that you have to give the ".git" directory, ie you should do

git-pull-script ~/by/other/repository/.git

instead of pointing to the other repo's root.

Of course, I don't bother with the linking. But that's the trivial part.

Quoted 5 lines

With the SHA1 hash, you can even have a --unsafe option that just compares the has names and does a link based purely off of that and the stat(2) results of both files. (I'd expect that a ... safer variant would extract both files and compare them, but the --unsafe should be sufficient, in practice, I would think.)

I don't think there is any point to unsafe. The assumption is that if you do things this way, the "unlinked" files will the the uncommon case, so what you do is

- remember the list of files you copied when you did the pull (you had to have this list at some point anyway). Sort by name,
- create a list of names of both repositories, sorted by name
- do the union of those three lists (cheap, thanks to the sorting)
- stat each name to see if it's already linked (which it will be, most of the time), continue to the next one..
- if they aren't linked, just do a "cmp" on them, and warn if they aren't the same, continue to the next one.
- else link them.

And if you want to, you can skip the first stage, and just relink two trees without looking at a list of "known new" files - it's going to be expensive to link two big repositories the _first_ time, but hey even the "expensive" part is likely to be pretty cheap in the end. If it takes an hour or two to relink some years of history, big deal. Do it overnight, you only need it once.

Linus

#8 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"LT" == Linus Torvalds <[email protected]> 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?

Then from a source repository that contains good stuff plus throwaway experimental commits you can prepare pruned for-public tree. Of course you can do it today by copying and then running git-prune in the destination, though.

#9 lore raw
Quoted 6 lines · Junio C Hamano
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"LT" == Linus Torvalds <[email protected]> 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.

Quoted 6 lines

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.

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.

Signature · 1 line
Russell King
#10 lore raw
Quoted 13 lines · Russell King
Quoted 11 lines · Junio C Hamano
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"LT" == Linus Torvalds <[email protected]> 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?

Quoted 4 lines

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.

Quoted 4 lines

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

Signature · 4 lines
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/
#11 lore raw

Dear diary, on Fri, Apr 29, 2005 at 11:57:53PM CEST, I got a letter where Anton Altaparmakov <[email protected]> told me that...

Quoted 3 lines

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.

Are there legitimate cases for not wanting hard links when you are able to create them? (Same filesystem, filesystem supports them...)

Signature · 3 lines
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor
#12 lore raw
Quoted 8 lines · Petr Baudis

Dear diary, on Fri, Apr 29, 2005 at 11:57:53PM CEST, I got a letter where Anton Altaparmakov <[email protected]> told me that...

Quoted 3 lines

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.

Are there legitimate cases for not wanting hard links when you are able to create them? (Same filesystem, filesystem supports them...)

Cloning a different user's repo?

Signature · 2 lines
David Kleikamp
IBM Linux Technology Center
#13 lore raw

Hello,

Quoted 1 line

Cloning a different user's repo?

it isn't my quota. :-) So that's a feature. :-)

Thomas

#14 lore raw
In reply to Petr Baudis
Quoted 8 lines · Petr Baudis

Dear diary, on Fri, Apr 29, 2005 at 11:57:53PM CEST, I got a letter where Anton Altaparmakov <[email protected]> told me that...

Quoted 3 lines

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.

Are there legitimate cases for not wanting hard links when you are able to create them? (Same filesystem, filesystem supports them...)

I would say yes. For example, I want to update my git tools to the latest and greatest development version. Do I really want to let it loose on all the repositories? Probably not. So I would want to make a clone of the repository that is not connected in any way with the old one and then try the new tools. If there were hard links involved working on the cloned repository could potentially damage the original one.

Yes, yes, I know all tools are perfect and never have bugs but I am paranoid. (-;

Best regards,

Anton

Signature · 4 lines
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/
#15 lore raw
Quoted 3 lines · Anton Altaparmakov

Yes, yes, I know all tools are perfect and never have bugs but I am paranoid. (-;

I do agree.

I think hardlinks are wonderful for

- "git farms" (ie something like what kernel.org does, but in a more controlled manner - right now kernel.org is really just a standard location for different people putting their own files in).

In this environment, doing hard-linking should also imply

- mounting the filesystem "noatime"
- using a different UID for the hardlinked objects

ie the "farm administrator" does the hardlinking automatically, and chown()'s them to himself, so that different git trees cannot screw each other up. The "noatime" thing is there because having different users means that git's internal "O_NOATIME" optimization no longer works, and you really want to avoi dgetting lots of write-backs just for "atime".

- people who have lots of trees. I think Jeff Garzik has something like 20+ BK trees. At that point, hardlinking just makes sense, and your work patterns are likely to be aware of the different trees anyway.

But for "normal" situations, where you have a tree or two, the hardlinking win might not be big enough to warrant the maintenance headache. With hardlinking, you _do_ need to "trust" the other trees to some degree.

Linus

#16 lore raw

Dear diary, on Tue, May 03, 2005 at 12:19:16AM CEST, I got a letter where Linus Torvalds <[email protected]> told me that...

Quoted 3 lines

But for "normal" situations, where you have a tree or two, the hardlinking win might not be big enough to warrant the maintenance headache. With hardlinking, you _do_ need to "trust" the other trees to some degree.

As long as the trees aren't yours and you aren't doing something really horrible with them...

$ time git-local-pull -a -l $(cat ~/git-devel/.git/HEAD) ~/git-devel/.git/
real    0m0.332s
$ time git-local-pull -a $(cat ~/git-devel/.git/HEAD) ~/git-devel/.git/
real    0m4.306s

And this is only 13M Cogito objects database. I think one of the important things is to encourage branching, therefore it must be fast enough; that's why I really wanted to do hardlinks. The disk space is important, but the speed hit probably equally (if not more) so.

BTW, the object database files should have 0444 or such; they really _are_ read-only and making them so mode-wise could help against some mistakes too.

It's clear that Cogito should have a way to choose whether to hardlink or copy; the question is which one should be the default one and how should it be specified. I thought about using file:// vs. just local path to differentiate between copy and hardlinking, but that'd be totally non-obvious, therefore bad UI-wise.

BTW, I've just committed support for pulling from remote repositories over the HTTP and SSH protocols (http://your.git/repo,
git+ssh://[email protected]/srv/git/mars) (note that I was unable to test the SSH stuff properly now; success reports or patches welcome). Also, the local hardlinking access is now done over git-local-pull, therefore the cp errors should go away now.

I'm not yet decided whether locations like

kernel.org:/pub/scm/cogito/cogito.git

should invoke rsync, rpull, throw an error or print a fortune cookie.

Signature · 3 lines
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor
#17 lore raw
Quoted 6 lines · Petr Baudis

BTW, I've just committed support for pulling from remote repositories over the HTTP and SSH protocols (http://your.git/repo,
git+ssh://[email protected]/srv/git/mars) (note that I was unable to test the SSH stuff properly now; success reports or patches welcome). Also, the local hardlinking access is now done over git-local-pull, therefore the cp errors should go away now.

Before you get too far with the SSH version, I have some protocol changes which (1) allow transmission of things other than objects; (2) allow the pushing side to report that it doesn't have something without killing the connection; (3) send refs. (1) and (2) are needed to make the protocol extensible; (3) takes advantage of (1) to make it possible to maintain a remote repository without doing anything other than rpush to it.

This goes with my patches from the weekend to enable git-*-pull to transfer refs/ files in the same process.

Quoted 5 lines

I'm not yet decided whether locations like

kernel.org:/pub/scm/cogito/cogito.git

should invoke rsync, rpull, throw an error or print a fortune cookie.

Probably not rpull, which requires a login, at least not unless the others fail. I think that http-pull is going to be nicer in the long run than rsync, since the remote repository could have a bunch of mingled heads and http-pull will get exclusively the interesting stuff. If you're trying to push, then rpush, since that's the only push.

Personally, I've been using http://... for http-pull, rsync://... for rsync, and //... for rpull/rpush (which is somewhat justified wrt the URI standard for using the program's default method).

-Daniel
*This .sig left intentionally blank*

#18 lore raw
In reply to Petr Baudis

I am just soft-linking objects/ in the branched tree. I can live with dangling objects, branching is extremly fast, and diskspace is cheap anyway. The only downside is that it doesn't work too well with rsync as network protocol, but I use only http-pull and rpush anyway.

Andreas

Quoted 52 lines · Petr Baudis

Dear diary, on Tue, May 03, 2005 at 12:19:16AM CEST, I got a letter where Linus Torvalds <[email protected]> told me that...

Quoted 3 lines

But for "normal" situations, where you have a tree or two, the hardlinking win might not be big enough to warrant the maintenance headache. With hardlinking, you _do_ need to "trust" the other trees to some degree.

As long as the trees aren't yours and you aren't doing something really horrible with them...

$ time git-local-pull -a -l $(cat ~/git-devel/.git/HEAD) ~/git-devel/.git/
real    0m0.332s
$ time git-local-pull -a $(cat ~/git-devel/.git/HEAD) ~/git-devel/.git/
real    0m4.306s

And this is only 13M Cogito objects database. I think one of the important things is to encourage branching, therefore it must be fast enough; that's why I really wanted to do hardlinks. The disk space is important, but the speed hit probably equally (if not more) so.

BTW, the object database files should have 0444 or such; they really _are_ read-only and making them so mode-wise could help against some mistakes too.

It's clear that Cogito should have a way to choose whether to hardlink or copy; the question is which one should be the default one and how should it be specified. I thought about using file:// vs. just local path to differentiate between copy and hardlinking, but that'd be totally non-obvious, therefore bad UI-wise.

BTW, I've just committed support for pulling from remote repositories over the HTTP and SSH protocols (http://your.git/repo,
git+ssh://[email protected]/srv/git/mars) (note that I was unable to test the SSH stuff properly now; success reports or patches welcome). Also, the local hardlinking access is now done over git-local-pull, therefore the cp errors should go away now.

I'm not yet decided whether locations like

kernel.org:/pub/scm/cogito/cogito.git

should invoke rsync, rpull, throw an error or print a fortune cookie.

Signature · 7 lines
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#19 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"AG" == Andreas Gal <[email protected]> writes:

AG> I am just soft-linking objects/ in the branched tree. I can live with AG> dangling objects, branching is extremly fast, and diskspace is cheap AG> anyway. The only downside is that it doesn't work too well with rsync as AG> network protocol,...

I usually do not symlinks myself, but doesn't "rsync -L" work for you?

#20 lore raw
In reply to Junio C Hamano
Quoted 6 lines · Junio C Hamano
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"LT" == Linus Torvalds <[email protected]> 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.

Quoted 6 lines

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?

If someone does this, they should make a pull.c out of http-pull and rpull; the logic for determining what you need to copy, given what you have and what the user wants to have, should be shared.

(Note that some usage patterns only require the latest commit, or at least can deal with fetching other stuff only when needed.)

-Daniel
*This .sig left intentionally blank*

#21 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"DB" == Daniel Barkalow <[email protected]> writes:

DB> If someone does this, they should make a pull.c out of http-pull and DB> rpull; the logic for determining what you need to copy, given what you DB> have and what the user wants to have, should be shared.

I agree with your analysis. I was hoping that that someone would be you, knowing where http-pull originated ;-).

#22 lore raw

PATCH 1/1 Split out "pull" from particular methods

The method for deciding what to pull is useful separately from any of the ways of actually fetching the objects.

Split out "pull" functionality from http-pull and rpull

Makefile (mode:100644 sha1:87fe8fef5ebd315f370af882bd3172632b850c02) renamed from Makefile (mode:100644 sha1:ef9a9fae88a1ac438c22beb50790f0f0e37ffc3c) +2 -2
Index: Makefile
===================================================================
@@ -82,9 +82,9 @@
 git-export: export.c
 git-diff-cache: diff-cache.c
 git-convert-cache: convert-cache.c
-git-http-pull: http-pull.c
+git-http-pull: http-pull.c pull.c
 git-rpush: rsh.c
-git-rpull: rsh.c
+git-rpull: rsh.c pull.c
 git-rev-list: rev-list.c
 git-mktag: mktag.c
 git-diff-tree-helper: diff-tree-helper.c
http-pull.c (mode:100644 sha1:d877c4abe3ff7766d858bfeac5c9a0eaf1385b65) renamed from http-pull.c (mode:100644 sha1:192dcc370dee47c52c72915394bb6f2a79f64e12) +9 -71

126 lines not on this page · raw message

pull.c (mode:100644 sha1:86a7b6901fe69a82c12c3470b456982ef52cebd0) renamed from dev/null (tree:8602fe7cb4bf668fd021ab3bfb2082ac7d535e57) +77 -0

77 lines not on this page · raw message

pull.h (mode:100644 sha1:314bc7e95ab1a73634f6a96a8a3782fda91ea261) renamed from dev/null (tree:8602fe7cb4bf668fd021ab3bfb2082ac7d535e57) +18 -0
Index: pull.h
===================================================================
@@ -0,0 +1,18 @@
+#ifndef PULL_H
+#define PULL_H
+
+/** To be provided by the particular implementation. **/
+extern int fetch(unsigned char *sha1);
+
+/** Set to fetch the target tree. */
+extern int get_tree;
+
+/** Set to fetch the commit history. */
+extern int get_history;
+
+/** Set to fetch the trees in the commit history. **/
+extern int get_all;
+
+extern int pull(char *target);
+
+#endif /* PULL_H */
rpull.c (mode:100644 sha1:6624440d5ad24854e1bd1a8dff628427581198e0) renamed from rpull.c (mode:100644 sha1:c27af2c2464de28732b8ad1fff3ed8a0804250d6) +8 -81

121 lines not on this page · raw message

#23 lore raw

PATCH 1/1 Add git-relink-script, a tool to hardlink two existing repositories.

In reply to Linus Torvalds

Add git-relink-script, which will find common objects in two git repositories and replace one copy with a hardlink.

---
commit a3bcc763d71bdb91a3b48e9105fbaa5e79abb807
tree 2553e2d8befbe0cda3e413616fd4cc7bf04157ad
parent a31c6d022e2435a514fcc8ca57f9995c4376a986 author Ryan Anderson <ryan@mythryan2.(none)> 1115185675 -0400 committer Ryan Anderson <[email protected]> 1115185675 -0400

Makefile (mode:100644 sha1:a99665e252a2342caa84238e886a80a5f27ac3c8) renamed from Makefile (mode:100644 sha1:99b4753d34879842b972da9b68694c9d0485f216) +1 -1
Index: Makefile
===================================================================
@@ -13,7 +13,7 @@
 AR=ar
 
 SCRIPTS=git-apply-patch-script git-merge-one-file-script git-prune-script \
-	git-pull-script git-tag-script
+	git-pull-script git-tag-script git-relink-script
 
 PROG=   git-update-cache git-diff-files git-init-db git-write-tree \
 	git-read-tree git-commit-tree git-cat-file git-fsck-cache \
git-relink-script (mode:100644 sha1:78c954edcc370d8be951c856bfbfd38975d08348) renamed from dev/null (tree:51a882a2dc62e0d3cdc79e0badc61559fb723481) +115 -0

115 lines not on this page · raw message

Signature · 2 lines
Ryan Anderson
  sometimes Pug Majere