From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62262C433E0 for ; Wed, 3 Jun 2020 20:39:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4170C207D3 for ; Wed, 3 Jun 2020 20:39:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=pobox.com header.i=@pobox.com header.b="fbCLpZhj" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726236AbgFCUjf (ORCPT ); Wed, 3 Jun 2020 16:39:35 -0400 Received: from pb-smtp21.pobox.com ([173.228.157.53]:50758 "EHLO pb-smtp21.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725985AbgFCUje (ORCPT ); Wed, 3 Jun 2020 16:39:34 -0400 Received: from pb-smtp21.pobox.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id E946FE0CA1; Wed, 3 Jun 2020 16:39:32 -0400 (EDT) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=uL12XI9tpoUcGgo7mfSuKryLv4g=; b=fbCLpZ hj+B6ZzLi5GbJb0tLAGCFFNWhm4S4ia1I+P62xeDCMpzqZdlD5V+Ow3ifOunaHAd 7gpbeTCJc9K8omQB1JKBagVSyMokojZGzjrLRn3sdKR8AWTzNbx5qCR5zBYbPvix 7woj76m7FsnLBSaeymC+sbaMR4YtcUs2JG76o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=ImZTHxkAMO6D01UBywCtokanBcY3dAdR nLFza3aTQ1yUHOeZxGYYq/pQ28sbs291td+O/SzyZgmeQn0d7AegQEuYWZlgwh6J v5SGdYo2Tol3fRuH9tH3oeKbf0ob57GlAxiGEicrn1OT20/I2da2T/UewQTrh5Q4 ycJ4uF3TyhA= Received: from pb-smtp21.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id E13C9E0CA0; Wed, 3 Jun 2020 16:39:32 -0400 (EDT) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [35.231.104.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp21.pobox.com (Postfix) with ESMTPSA id 2B222E0C9E; Wed, 3 Jun 2020 16:39:30 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: Jonathan Nieder Cc: Elijah Newren , Git Mailing List , Derrick Stolee , Jonathan Tan , Minh Thai Subject: Re: Huge push upload despite only having a tiny change References: <20200603015314.GA253041@google.com> Date: Wed, 03 Jun 2020 13:39:28 -0700 In-Reply-To: <20200603015314.GA253041@google.com> (Jonathan Nieder's message of "Tue, 2 Jun 2020 18:53:14 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 52FC4C8E-A5DA-11EA-B973-8D86F504CC47-77302942!pb-smtp21.pobox.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Jonathan Nieder writes: > There is one trick a server can use to mitigate this: advertise some > refs that don't exist! If you advertise a ref ".have", then Git > will understand that the server has that object but it is not an > actual ref. Gerrit uses this trick in its HackPushNegotiateHook[1] > to advertise a few recent commits. > ... > Summary: (1) try fetching first (2) let's improve > HackPushNegotiateHook#advertiseRefs (3) let's improve "git push" > protocol to make this a problem of the past. In the meantime, perhaps we can teach receive-pack the same "let's advertise a few recent commits as if they exist as tips of refs" as well?