Re: Questions about git-push for huge repositories

2015-09-08 Thread Jeff King
On Tue, Sep 08, 2015 at 11:24:06AM -0700, Junio C Hamano wrote: > Jeff King writes: > > > If you turn on reachability bitmaps, git _will_ do the thorough set > > difference, because it becomes much cheaper to do so. E.g., try: > > > > git repack -adb > > > > in repo A to build a single pack

Re: Questions about git-push for huge repositories

2015-09-08 Thread Junio C Hamano
Jeff King writes: > If you turn on reachability bitmaps, git _will_ do the thorough set > difference, because it becomes much cheaper to do so. E.g., try: > > git repack -adb > > in repo A to build a single pack with bitmaps enabled. Then a subsequent > push should send only a single object (

Re: Questions about git-push for huge repositories

2015-09-07 Thread Jeff King
On Tue, Sep 08, 2015 at 09:30:09AM +0800, Levin Du wrote: > Take kernel source code for example: > > # Clone the kernel to A and B > $ git --version > git version 2.3.2 > $ git clone --bare ../kernel/ A > $ git clone --bare ../kernel/ B OK, two repos with the same source. > # Create the orpha

Re: Questions about git-push for huge repositories

2015-09-07 Thread Jeff King
On Mon, Sep 07, 2015 at 09:05:41AM +0800, Levin Du wrote: > > Instead, the object transfer is optimized by comparing what commits > > each side has and sending trees and blobs that are reachable from > > the commits that the receiving side does not have. > > The sender A sends all the commits tha

Re: Questions about git-push for huge repositories

2015-09-07 Thread Levin Du
I consider 'git push' need further optimization. Take kernel source code for example: # Clone the kernel to A and B $ git --version git version 2.3.2 $ git clone --bare ../kernel/ A $ git clone --bare ../kernel/ B # Create the orphan commit and check $ cd A $ git branch test Switched to a new

Re: Questions about git-push for huge repositories

2015-09-06 Thread Levin Du
I try to use 'git replace --graft' to work aroud this. Here's the process: cd A fetch ../B master:master_b git replace --graft master_b master_a # now master_b's parent is master_a # do a filter-branch to make the stone solid git filter-branch --tag-name-filter cat -- master_a..master_

Re: Questions about git-push for huge repositories

2015-09-06 Thread Levin Du
> Instead, the object transfer is optimized by comparing what commits > each side has and sending trees and blobs that are reachable from > the commits that the receiving side does not have. The sender A sends all the commits that the receiver B does not have. The commits contains trees and blobs.

Re: Questions about git-push for huge repositories

2015-09-06 Thread Junio C Hamano
Levin Du writes: > Since A & B share many common files, to save disk space, I'd like to merge > them: > (note: branch of A & B are independent, i.e. have no common ancestor.) Not having any shared history is exactly the cause. If the optimization were to exchange list of all the commits, blobs

Questions about git-push for huge repositories

2015-09-06 Thread Levin Du
Hi all, I meet with a strange problem: I've two repositories, with sizes: - A: 6.1G - B: 6G Both A & B have been 'git gc' with: git reflog expire --expire=now --all git gc --prune=now --aggressive Since A & B share many common files, to save disk space, I'd like to merge them: (note: