git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Graham Hay <grahamrhay@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: Fwd: Seems to be pushing more than necessary
Date: Fri, 20 Mar 2015 09:20:18 +0000	[thread overview]
Message-ID: <CAABECY1vOre+RbXKCnZqHr4rZSHHpYA=tnRK6fSnkjeyFv2ZAg@mail.gmail.com> (raw)
In-Reply-To: <xmqq3850kf6d.fsf@gitster.dls.corp.google.com>

That all seems quite reasonable, and is what I would expect to happen.

However at the moment, if I create a branch from master and edit one
line in one file,
with no other changes on the remote, it takes me over an hour to push
the new branch.

On 19 March 2015 at 18:36, Junio C Hamano <gitster@pobox.com> wrote:
> 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.

      reply	other threads:[~2015-03-20  9:20 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   ` Fwd: " Junio C Hamano
2015-03-20  9:20     ` Graham Hay [this message]

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='CAABECY1vOre+RbXKCnZqHr4rZSHHpYA=tnRK6fSnkjeyFv2ZAg@mail.gmail.com' \
    --to=grahamrhay@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).