Package com.google.gerrit.server.git
Class HackPushNegotiateHook
- java.lang.Object
-
- com.google.gerrit.server.git.HackPushNegotiateHook
-
- All Implemented Interfaces:
org.eclipse.jgit.transport.AdvertiseRefsHook
public class HackPushNegotiateHook extends Object implements org.eclipse.jgit.transport.AdvertiseRefsHook
Advertises part of history to git push clients.This is a hack to work around the lack of negotiation in the send-pack/receive-pack wire protocol.
When the server is frequently advancing master by creating merge commits, the client may not be able to discover a common ancestor during push. Attempting to push will re-upload a very large amount of history. This hook hacks in a fake negotiation replacement by walking history and sending recent commits as
".have"
lines in the wire protocol, allowing the client to find a common ancestor.
-
-
Constructor Summary
Constructors Constructor Description HackPushNegotiateHook()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
advertiseRefs(org.eclipse.jgit.transport.BaseReceivePack rp)
void
advertiseRefs(org.eclipse.jgit.transport.UploadPack us)
-
-
-
Method Detail
-
advertiseRefs
public void advertiseRefs(org.eclipse.jgit.transport.UploadPack us)
- Specified by:
advertiseRefs
in interfaceorg.eclipse.jgit.transport.AdvertiseRefsHook
-
advertiseRefs
public void advertiseRefs(org.eclipse.jgit.transport.BaseReceivePack rp) throws org.eclipse.jgit.transport.ServiceMayNotContinueException
- Specified by:
advertiseRefs
in interfaceorg.eclipse.jgit.transport.AdvertiseRefsHook
- Throws:
org.eclipse.jgit.transport.ServiceMayNotContinueException
-
-