You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Does git media push need to be optimized for new branches? #144
My branch only added zip/Octocats.zip, but it's still pushing the other assets. Now, the server already has them, so they should not have been re-uploaded.
@rubyist: I assume this is because it's comparing the branch HEAD against 0000000. Ideally we should find a common ancestor between the current branch and other branches on the same remote.
Yeah, if I remember right it's because at the points that we can hook into git, that's what the client sends when it starts negotiating with the server. The common ancestor/what does the server already have stuff is figured out by the server and we can't see any of that from the pre-push hook. I think in order to reliably calculate a common ancestor we'll have to make some remote calls.
Although it's logged as push_asset from the tracer, that happens before the OPTIONS call, so it shouldn't actually push data twice.
If we are willing to trust that the asset server contains all of the objects whose pointer files are reachable from the remote-tracking branches for the corresponding remote repository, then we could limit ourselves to sending assets in
If the remote has very many remote references, you could limit the number of remote references that have to be transferred while probably get almost as good a result by adding --branches to the git ls-remote invocation.
In all of these cases, if multiple branches are being pushed, then all of the branches' new SHA-1s should be inserted where $BRANCH_NEW_SHA1 appears, though avoiding command-line-length limitations would probably require the SHA-1s to be passed to stdin in this case.
Activity
rubyist commentedon Jan 9, 2015
Yeah, if I remember right it's because at the points that we can hook into git, that's what the client sends when it starts negotiating with the server. The common ancestor/what does the server already have stuff is figured out by the server and we can't see any of that from the pre-push hook. I think in order to reliably calculate a common ancestor we'll have to make some remote calls.
Although it's logged as
push_assetfrom the tracer, that happens before theOPTIONScall, so it shouldn't actually push data twice.mhagger commentedon Jan 12, 2015
If we are willing to trust that the asset server contains all of the objects whose pointer files are reachable from the remote-tracking branches for the corresponding remote repository, then we could limit ourselves to sending assets in
; e.g., in your case,
This doesn't require a remote call.
If we don't want to trust the remote-tracking branches, then I think the best we can do is
If the remote has very many remote references, you could limit the number of remote references that have to be transferred while probably get almost as good a result by adding
--branchesto thegit ls-remoteinvocation.In all of these cases, if multiple branches are being pushed, then all of the branches' new SHA-1s should be inserted where
$BRANCH_NEW_SHA1appears, though avoiding command-line-length limitations would probably require the SHA-1s to be passed to stdin in this case.