* is git-unpack-objects now redundant for 'git-push' and friends?
@ 2006-10-10 13:23 Sam Vilain
2006-10-10 16:14 ` Shawn Pearce
2006-10-10 17:44 ` Junio C Hamano
0 siblings, 2 replies; 3+ messages in thread
From: Sam Vilain @ 2006-10-10 13:23 UTC (permalink / raw)
To: git
When pushing or pulling to/from a repository, why unpack the objects?
Why not just fsck and then throw the pack into $GIT_DIR/objects/pack?
If you're pushing the entire repository, for instance, currently you
might create 10,000's of files, which will just be thrown away later
when you `git-repack -d'.
I suspect that this was never changed, because there never used to be
more than one packfile allowed, correct?
If the server *does* send us duplicates of objects we already have for
some reason, well that's what `git-repack -a -d' is for.
I'm just wondering if there are any good reasons to do this any more.
Sam.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: is git-unpack-objects now redundant for 'git-push' and friends?
2006-10-10 13:23 is git-unpack-objects now redundant for 'git-push' and friends? Sam Vilain
@ 2006-10-10 16:14 ` Shawn Pearce
2006-10-10 17:44 ` Junio C Hamano
1 sibling, 0 replies; 3+ messages in thread
From: Shawn Pearce @ 2006-10-10 16:14 UTC (permalink / raw)
To: Sam Vilain; +Cc: git
Sam Vilain <sam@vilain.net> wrote:
> When pushing or pulling to/from a repository, why unpack the objects?
> Why not just fsck and then throw the pack into $GIT_DIR/objects/pack?
>
> If you're pushing the entire repository, for instance, currently you
> might create 10,000's of files, which will just be thrown away later
> when you `git-repack -d'.
>
> I suspect that this was never changed, because there never used to be
> more than one packfile allowed, correct?
>
> If the server *does* send us duplicates of objects we already have for
> some reason, well that's what `git-repack -a -d' is for.
>
> I'm just wondering if there are any good reasons to do this any more.
There's still a few good reasons to unpack things, even though I
hate sitting through 5000 objects unpacking on a Windows system,
or a very slow NFS system (one NFS based system I work with unpacks
small <1KiB objects at a rate of about 1 every 15 seconds).
- We don't completely trust the remote peer. If the remote sends
us an object we already have we want to use the bytes we have
and not the bytes they are sending. That way even if the remote
were able to generate a hash collision and produce a replacement
byte sequence with the same hash, our known good byte sequence
is not affected.
- Packs sent over the network can be thin packs. A think pack
may not contain the object used as the delta base for a delta
within that pack. This is done to save network bandwidth when
both sides already have the delta base for an object that is
being transferred.
- Local packs cannot access delta base objects not in the same
pack. This limitation simplifies the pack access code in a
lot of the system. It also means that you can in a worst case
scenario obtain everything in that pack back when all you have
is the pack file itself.
I'm sure there's more reasons than that, but those are the major
ones.
--
Shawn.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: is git-unpack-objects now redundant for 'git-push' and friends?
2006-10-10 13:23 is git-unpack-objects now redundant for 'git-push' and friends? Sam Vilain
2006-10-10 16:14 ` Shawn Pearce
@ 2006-10-10 17:44 ` Junio C Hamano
1 sibling, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2006-10-10 17:44 UTC (permalink / raw)
To: Sam Vilain; +Cc: git
Sam Vilain <sam@vilain.net> writes:
> When pushing or pulling to/from a repository, why unpack the objects?
> Why not just fsck and then throw the pack into $GIT_DIR/objects/pack?
>...
> I suspect that this was never changed, because there never used to be
> more than one packfile allowed, correct?
We've supported more than one packs at the same time from the
day we supported packs.
Primary reason that push never keeps the pack is that explosion
into loose objects hurts you only at the first round and later
pushes are supposed to be much smaller, so changing it to keep
the pack for the initial one has a very small value making it a
very low priority change. Not keeping the pack on push makes it
possible to always use --thin for pushing if we wanted to.
On the fetch side you could use --keep option when you know the
fetch will be huge.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-10-10 17:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-10 13:23 is git-unpack-objects now redundant for 'git-push' and friends? Sam Vilain
2006-10-10 16:14 ` Shawn Pearce
2006-10-10 17:44 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox