From: Duy Nguyen <pclouds@gmail.com>
To: Graham Hay <grahamrhay@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: Seems to be pushing more than necessary
Date: Wed, 18 Mar 2015 19:26:38 +0700 [thread overview]
Message-ID: <CACsJy8AFi8-EgUJNr+KTOngeUaGfi_O5f_=qba08qJs1jcEj=w@mail.gmail.com> (raw)
In-Reply-To: <CAABECY2_A83tWaqb_6YzXwr0Tv5AYVq0KW70j+EHqrx69k2P_A@mail.gmail.com>
On Wed, Mar 18, 2015 at 7:03 PM, Graham Hay <grahamrhay@gmail.com> wrote:
> Are there any commands that I can use to show exactly what it is trying to push?
It's a bit more than a command. If you push when GIT_TRACE is set to
2, you'll see it executes "git pack-objects" command with all its
arguments. This command expects some input from stdin. If you can
capture that, you can run it by yourself to create the exact pack that
is transferred over network. Run that pack through "git index-pack
--verify-stat" will show you SHA-1 of all sent objects.
It's quite a lot of work :) I created this script named "git" and put
it in $PATH to capture input for pack-objects. You'll need to update
"/path/to/real/git" to point to the real binary then you'll get
/tmp/stdin
-- 8< --
#!/bin/sh
if [ "$1" = pack-objects ]; then
exec tee /tmp/stdin | /path/to/real/git "$@"
else
exec /path/to/real/git "$@"
fi
-- 8< --
The remaining steps may be this (may need tweaking)
git pack-objects '--all-progress-implied' '--revs' '--stdout' '--thin'
'--delta-base-offset' '--progress' < /tmp/stdin | git index-pack
--fix-thin --stdin
pack 708538afeda8eb331858680e227f7713228ce782 <-- new pack
git verify-pack --verbose
.git/objects/pack/pack-708538afeda8eb331858680e227f7713228ce782.pack
d75631bd83ebdf03d4b0d925ff6734380f801fc6 commit 567 377 12
dd44100a7cdad113b23d31876e469b74fbe21e1b tree 15069 10492 389
8f4bbccea759d7a47616e29bd55b3f205b3615c2 tree 3869 2831 10881
3db0460935bc843a2a70a0e087222eec61a0ff0d blob 12379 3529 13712
Here we can see this push of mine sends four objects, 1 commit, 2
trees and 1 blob.
--
Duy
next prev parent reply other threads:[~2015-03-18 12:27 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 [this message]
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
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='CACsJy8AFi8-EgUJNr+KTOngeUaGfi_O5f_=qba08qJs1jcEj=w@mail.gmail.com' \
--to=pclouds@gmail.com \
--cc=git@vger.kernel.org \
--cc=grahamrhay@gmail.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).