git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Strange large push operation.
@ 2008-12-26 12:23 Brice Figureau
  2008-12-26 14:48 ` Sitaram Chamarty
  0 siblings, 1 reply; 2+ messages in thread
From: Brice Figureau @ 2008-12-26 12:23 UTC (permalink / raw)
  To: git

Hi,

I'm a git user since about a year, but I can't say I'm really familiar 
with its internals. I am using git v 1.5.6.5

I have a quite large bare remote repository (around 1GiB, about 86k 
objects), and I have a clone on my development computer (which was 
cloned a long time ago). I use ssh to push/pull between those repositories.

About 2 months ago, we created a remote branch (let's call it 'branch') 
and pursued development on this branch and also on master, with a few 
regular merge points from master to 'branch'.

Two days ago, I wanted to start developping a new feature, and as such 
created a local branch from this branch, which we'll call 'newbranch'. I 
cherrypicked a couple of old (4 months) commits  that were in another 
local branch, and then added more small commits (about 10 sloc of 
changes on it) on top of these.

Then I wanted to push this newbranch as a remote branch with:
$ git push origin newbranch:refs/heads/newbranch

and obtained the following output:
Counting objects: 12767, done.
Compressing objects: 100% (3816/3816), done.
writing objects:   8% (935/11682), 2.40 MiB | 324 KiB/s
^C

I stopped the push because I don't get why there are so much objects to 
send while the diff between newbranch and branch is only 5 small commits 
  (and it obviously wants to push a large part of the history).

Is there a way to check what objects are sent to origin and why?
What could be the cause of the issue?
What's wrong with those repositories?

I tried to git gc both repositories, I also git fsck both repositories 
(and found 5 unreachables objects in the local one, should I care?). I 
also upgraded the remote git to latest 1.6.0.6 but this didn't change 
anything. I also tried --thin but that didn't change anything.

So what should I do to push only the changes between branch and newbranch?

Many thanks for any answer,
--
Brice Figureau

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Strange large push operation.
  2008-12-26 12:23 Strange large push operation Brice Figureau
@ 2008-12-26 14:48 ` Sitaram Chamarty
  0 siblings, 0 replies; 2+ messages in thread
From: Sitaram Chamarty @ 2008-12-26 14:48 UTC (permalink / raw)
  To: git

On 2008-12-26, Brice Figureau <brice+git@daysofwonder.com> wrote:

> Then I wanted to push this newbranch as a remote branch with:
> $ git push origin newbranch:refs/heads/newbranch

I'd have just said "git push origin newbranch" :-)

> and obtained the following output:
> Counting objects: 12767, done.
> Compressing objects: 100% (3816/3816), done.
> writing objects:   8% (935/11682), 2.40 MiB | 324 KiB/s
> ^C

> I stopped the push because I don't get why there are so much objects to 
> send while the diff between newbranch and branch is only 5 small commits 
>   (and it obviously wants to push a large part of the history).

Yes but you didn't actually say that the master has "branch"
-- perhaps it isn't as uptodate as you thought it was...?
Or perhaps there was a rebase or something that changed a
*lot* of stuff.

Try "git log -n 1 branch" on both machines to see if they
point to the same hash.

[Additionally, I'm not really sure if that progress is a
worst case estimate or a real estimate...]

> Is there a way to check what objects are sent to origin and why?

My all-time favourite git command is "bundle" [which should
tell you I work a lot with disconnected repos!]

Try "git bundle create /tmp/temp.bdl branch..newbranch" then
see how big that temp file is.  That'll be about what goes
to the other side (assuming the other side has the same hash
for "branch").

You could even take it to the other side and do the
following:
    git ls-remote temp.bdl  # shows refs in bundle
    git fetch temp.bdl one-of-the-refs-in-the-bundle
    git merge FETCH_HEAD # merge it into current branch

> What could be the cause of the issue?

can't say.  Try the following commands also to get a birds
eye view of the various branches on both sides
    git fetch   # update your idea of what's on remote
    git branch -a -v

I also like
    git log --graph --pretty=oneline --abbrev-commit --decorate --all
which I've aliased to "lg"

> (and found 5 unreachables objects in the local one, should I care?). I 

Nope.  Lots of reasons to have unreachable objects...

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-12-26 14:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-26 12:23 Strange large push operation Brice Figureau
2008-12-26 14:48 ` Sitaram Chamarty

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).