public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Graham Hay <grahamrhay@gmail•com>
Cc: git@vger•kernel.org
Subject: Re: Fwd: Seems to be pushing more than necessary
Date: Thu, 19 Mar 2015 11:36:26 -0700	[thread overview]
Message-ID: <xmqq3850kf6d.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <CAABECY1_L34sq0VPmD9UwRcwb3Fuh95OFcF26LM2eX1z-+8vkQ@mail.gmail.com> (Graham Hay's message of "Wed, 18 Mar 2015 10:55:26 +0000")

Graham Hay <grahamrhay@gmail•com> writes:

> We have a fairly large repo (~2.4GB), mainly due to binary resources
> (for an ios app). I know this can generally be a problem, but I have a
> specific question.
>
> If I cut a branch, and edit a few (non-binary) files, and push, what
> should be uploaded? I assumed it was just the diff (I know whole
> compressed files are used, I mean the differences between my branch
> and where I cut it from). Is that correct?

If you start from this state:

 (the 'origin')                    (you)
    ---Z---A         clone ->    ---Z---A

and edit a few files, say, a/b, a/c and d/e/f, and committed to make
the history look like this:

 (the 'origin')                    (you)
    ---Z---A                     ---Z---A---B

i.e. "git diff --name-only A B" would show these three files, then
the next push from you to the origin, i.e.

 (the 'origin')                    (you)
    ---Z---A---B    <- push      ---Z---A---B

would involve transferring from you to the origin of the following:

 * The commit object that holds the message, authorship, etc. for B
 * The top-level tree object of commit B (as that is different from
   that of A)
 * The tree object for 'a', 'd', 'd/e' and the blob object for
   'a/b', 'a/c', and 'd/e/f'.

However, that assumes that nothing is happening on the 'origin'
side.

If the 'origin', for example, rewound its head to Z before you
attempt to push your B, then you may end up sending objects that do
not exist in Z that are reachable from B.  Just like the above
bullet points enumerated what is different between A and B, you
can enumerate what is different between Z and A and add that to the
above set.  That would be what will be sent.

If the 'origin' updated its tip to a commit you do not even know
about, normally you will be prevented from pushing B because we
would not want you to lose somebody else's work.  If you forced such
push, then you may end up sending a lot more.

  parent reply	other threads:[~2015-03-19 18:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAABECY3HbZ4q3uo82outUmCyQLXO39H+Fd2m8bLwkaubE9gJCw@mail.gmail.com>
2015-03-18 10:55 ` Fwd: Seems to be pushing more than necessary Graham Hay
2015-03-18 11:14   ` Duy Nguyen
2015-03-18 11:26     ` Graham Hay
2015-03-18 11:42       ` Duy Nguyen
2015-03-18 12:03         ` Graham Hay
2015-03-18 12:26           ` Duy Nguyen
2015-03-18 12:34             ` Duy Nguyen
2015-03-18 13:16               ` Graham Hay
2015-03-18 13:33                 ` Duy Nguyen
2015-03-18 15:14                   ` Graham Hay
2015-03-19 10:59                     ` Duy Nguyen
     [not found]                       ` <CAABECY063__YDW2jXPSnuvxp0kj=jB+k09mOEW3suEn5syAyXQ@mail.gmail.com>
2015-03-23 10:05                         ` Duy Nguyen
2015-03-23 10:35                           ` Graham Hay
2015-03-23 10:41                             ` Duy Nguyen
2015-03-23 10:56                               ` Graham Hay
2015-03-19 18:36   ` Junio C Hamano [this message]
2015-03-20  9:20     ` Fwd: " Graham Hay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq3850kf6d.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=grahamrhay@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox