On Wed, Mar 18, 2015 at 7:03 PM, Graham Hay <grahamr...@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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to