🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.git
Article #1536

[PATCH 1/3] t5516: record redundant blobs after rebasing

#1536
From: "Marc Strapetz via GitGitGadget"
Date: Mon, 26 Oct 2026 15:46
76 lines
13078 bytes
From: Marc Strapetz <marc.strapetz@syntevo.com>

A forced push of a rebased branch can resend an unchanged blob even
though the receiver has it through the advertised old tip.

Add object-count tests for --force, --force-with-lease and forced
refspecs. Confirm that the blob is unchanged by the rebase and record
the current three-object pack: the rebased commit, its tree and the
unchanged blob. Disable push bitmaps to exercise normal enumeration.

Also cover local replacement refs, which must not cause objects
missing from the receiver to be omitted.

Assisted-by: GPT-6 Astra, GPT-6.1 Sol
Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
---
 t/t5516-fetch-push.sh | 43 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh
index b982b209bf..a46ba91ba0 100755
--- a/t/t5516-fetch-push.sh
+++ b/t/t5516-fetch-push.sh
@@ -193,6 +193,49 @@ grep_wrote () {
 	grep 'write_pack_file/wrote.*"value":"'$1'"' $2
 }
 
+for push_args in \
+	"--force origin topic" \
+	"--force-with-lease origin topic" \
+	"origin +topic"
+do
+	test_expect_success "push of rebased branch with $push_args" '
+		mk_test testrepo heads/main &&
+		test_when_finished "rm -rf rebased rebased-push-event" &&
+		git clone testrepo rebased &&
+		(
+			cd rebased &&
+			git checkout -b topic &&
+			test_commit feature &&
+			git push origin topic &&
+			git checkout main &&
+			test_commit upstream path1 &&
+			git push origin main &&
+			git checkout topic &&
+			git rebase main &&
+			test_cmp_rev feature:feature.t HEAD:feature.t &&
+			GIT_TRACE2_EVENT="$D/rebased-push-event" \
+			git -c push.useBitmaps=false push $push_args
+		) &&
+		grep_wrote 3 rebased-push-event # 1 commit, 1 tree, 1 blob
+	'
+done
+
+test_expect_success 'forced update ignores replacement for old tip' '
+	mk_test testrepo heads/main &&
+	test_when_finished "rm -rf replaced" &&
+	git clone testrepo replaced &&
+	(
+		cd replaced &&
+		test_commit old &&
+		git push origin main &&
+		old_tip=$(git rev-parse HEAD) &&
+		git reset --hard HEAD^ &&
+		test_commit new &&
+		git replace "$old_tip" HEAD &&
+		git push --force origin main
+	)
+'
+
 test_expect_success 'push without negotiation' '
 	mk_empty testrepo &&
 	git push testrepo $the_first_commit:refs/remotes/origin/first_commit &&
-- 
gitgitgadget
Technical Details
Message-ID: <84157f543eebc2ed347dd2165ed6046305e9226b.1793029565.git.gitgitgadget@gmail.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-73349-linux-kernel-git=dewy.ru
References: <pull.2281.git.1793029565.gitgitgadget@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-73349-linux-kernel-git=dewy.ru
From: gitgitgadget@gmail.com ("Marc Strapetz via GitGitGadget")
Newsgroups: linux.kernel.git
Subject: [PATCH 1/3] t5516: record redundant blobs after rebasing
Date: Mon, 26 Oct 2026 15:46:03 +0000
Organization: Usenet Network
Message-ID: <84157f543eebc2ed347dd2165ed6046305e9226b.1793029565.git.gitgitgadget@gmail.com>
References: <pull.2281.git.1793029565.gitgitgadget@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1340518"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:nimcoACF1lIwekUfYzvW894ssvI= sha256:vYbn+kFMpjST1Oe5P+DrwvQVtUbuk4+IpgqITLuPs+Q=
	sha1:v588ooVGrzp6SR9xFRnj89V/lF4= sha256:U+umYxmFxby2JZm8Znw0Ej+Q0Xl2hY6nLApwQc7JFRo=
List-ID: <git.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 72F2D125BB0; Mon, 26 Oct 2026 18:49:20 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: 0.511
X-Spam-Status: No, score=0.511 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_SBL_CSS=3.558,
	SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001]
	autolearn=no autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 2k_m3RyW0oDU;
	Mon, 26 Oct 2026 18:49:17 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=git+bounces-73349-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 67EEF125BAE; Mon, 26 Oct 2026 18:49:09 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 62A9A2A375; Mon, 26 Oct 2026 15:46:11 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1793029571;
	b=DxBEBIw4nkfiGcMXea7c2ozAU6kY5iLQ0oNz0EoC2Q5pa7BRfaFppP/7RoAN4et61M9n
	 c7ynPLT+LRiQ1SYA6iBocx2fE/1zl/cWOCcyo2KsZjTjRzmR4ktvS7cARMoefFNv3BAFc
	 URDsU5fhungyGJ2QiJ3xq2DnaAV0eUaOCGZbUiliRcyIlM1ojy/YOq1DE4hQEDEwCrtkq
	 wm/hvRm1g8UqWSR3hlxOp8H7Nqm/YPdEdUxNE9Kc3sYcovaVic5zsGIhiiL4+KzxBBC9h
	 Hd6huYpLofVPY126e/SH4hchiSKNIC7/k45vpHtH7eQsXKQIDJVINOYLUpgoK/Ezzgw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793029571;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
	 Received:Message-Id:In-Reply-To:References:From:Date:Subject:Fcc:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version:To:Cc;
	bh=Io6olrFpWm3VR9CKRHylxTxnyxAZwzgWOusEfeW8LAE=;
	b=YalN41UhQYHaHm4o8NDCyy2mg2KF60fh2UKDdlZGhHPAPgCdPPmguLml2gIn/vWLw2+x
	 AlUTagBOMBgNJQ18iX6oxXR27SKMBvpY1nUXogUVwSsGucg+roEhaQ7iy5hEfcytUnJUU
	 +SHj/hDMha0Wu5WPyk92rSPunV1JPdmm7zjChpARCAeeLFxhAhO9uasRc6z12F3pAyTUD
	 tEmfOlXjIa7bMQIiNACdS2ZdBAyJBDkhDtNP1faYGYA3W1+Y6+LI7Xmc1Z/+KH61yLBOh
	 p4jTA/wssJG+IkzTqqQyzoPWPz0eHbRz0O4VozjxfivwagIB6yi7LZQMb+oew2FZ44A==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=ehgmGgCR;
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 37BE4606A333;
	Mon, 26 Oct 2026 15:46:11 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=ehgmGgCR
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.171
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793029569;
	b=0BFKZpZhWRIZ6Kb5us1JOWYyjDthehczbRRFHg1h0B4S8R4s15kY7bTZlgCELNm8z1jv
	 j9RA3Oten1iLZpAcaP66dAMtx/eNAcjsag8UofsEHLLjikapiVreRdxoKTORKhjL78bwl
	 pFaxw7aw8UgIEPU7RPm5Aal7GltvISwlFmffpUszmIwwyYTPpiWKEiwT63UnZUNGtPkfK
	 Y2IX8Y0xbJbkEfR6eb/Q0s1qXN8y/LrKiqMOWdNhDhpTKb5e3WR7mnLidB+CtVM1TPBs5
	 LKNbVnL+Mi9Rir9J9F9uI4foNGfC+w0k1PyPQkI3UYLSKhiYChh6XP5/gXfm7tV5RAA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793029569;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Gm-Message-State:X-Gm-Gg:X-Received:Received:Message-Id:In-Reply-To:
	 References:From:Date:Subject:Fcc:Content-Type:
	 Content-Transfer-Encoding:MIME-Version:To:Cc;
	bh=Io6olrFpWm3VR9CKRHylxTxnyxAZwzgWOusEfeW8LAE=;
	b=pmY0xwDkC+eSsHO7ZMc5MrhIjONgIs9SQjTba6tUoifu9U4iyXP2jt3J3dP6l/7NCepA
	 +AMIu1hqMcvSfLh6UjqZOacbKdmx4E8N9UVJh6n5eWuNQkKRmgKo46ZZF146apnkmcKy5
	 Diy2bQbAvsGbbIIPU4S7l8qAntTKtgSh/Jmg2VsMWpSbyV5TItpt7n64HhwnVyZp2zuDo
	 LeHkGXwJ1MAyQ1eedSxjPVymq7kS8I4rEo+yoxYCMcn8UFLIooQWH02ppC/AitsJx8erw
	 CdpF3U+GmNOfmq1o8558UsBz97N9pqZ5f1pKjaD93F4NskXH/CQMRrRVLkwNLBsCZ1Q==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=ehgmGgCR;
	arc=none smtp.remote-ip=209.85.210.171
X-Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id DE870606A31D
	for <git@vger.kernel.org>; Mon, 26 Oct 2026 15:46:08 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org DE870606A31D
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-8a06c60065fso2418146b3a.1
        for <git@vger.kernel.org>; Mon, 26 Oct 2026 08:46:08 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1793029568; x=1793634368; darn=vger.kernel.org;
        h=cc:to:mime-version:content-transfer-encoding:content-type:fcc
         :subject:date:from:references:in-reply-to:message-id:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=Io6olrFpWm3VR9CKRHylxTxnyxAZwzgWOusEfeW8LAE=;
        b=ehgmGgCRgf4IRsEHULAK3sBvp7aeo7J3ieIa5QTOjqinzqfnwHaCTxsqSMPMzN1RHm
         RWuUEEgqqoxmsRj7pX77HaVH7qDckjHkHybyGPeroFV6yQxZ76CazKaHZa+Db6BmmwUk
         XmK0WPv0VjgO+smuer9zSwa/T6SancFdM04QszruUL8wCnALUHHY79ktnyNWJjkqMGzJ
         khWUHjo41Gs0mrbxsGngZc0zDg4cLveeyo8V93jnn4Cz69OJI8znju5/Cvx5rNCFOeQF
         10WD0b4TYN6aCS5QT6/STjUM/XuDP/nOCPZ5qrJNwofvZZE7rzZDncy0Rq6nRrs9UDbq
         H9yA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1793029568; x=1793634368;
        h=cc:to:mime-version:content-transfer-encoding:content-type:fcc
         :subject:date:from:references:in-reply-to:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=Io6olrFpWm3VR9CKRHylxTxnyxAZwzgWOusEfeW8LAE=;
        b=h3eOdMwcRYTacMt0PsjRWRQneoU6U57qd3LdQcEI2OOSNQDeshVFqBj7okZ0TR34lS
         2G2IMOl7AayVkLkqOarLn/MudHD7MWp/mGdHwVOjCdIj6mBCC+zmAN57udX8PkFFGsZO
         GNw3E6pgjyWveILZfq9uZtH6gyFB7XqoeHf7Zz2j8bJsZSdnLCHSVmwzqz1lPU2YBJmx
         8sJxrnAOlepIN5fGjnoFkvY4FKmQLKd5SL0BKPDtJLkDRzqPZ3QXqN9YnVVNOlFw8fJI
         5alnvqr8Bh2coM+Li6+dux9quvD0absG6ZKTGWg5jboy0SCwmgeIE9EyX0U/iPq21xgy
         35Sg==
X-Gm-Message-State: AFq9FYLEXZHiSmPMkyfZmjjUTwKxFYRD3Byt0usNwI8hIHKNygVGmXxD
	h6VvCnGHG8O3iwfk/t6GgOxSWciPJ28VgvT1OQ7PlfbLM+aiE7+BxsyHxJQm2CGh
X-Gm-Gg: AYBFou37NBwS+PZZIT2vapxJePRR0QUYUNl3bKl75HidR/p1eyxvdcHz4dZ5JSK/L0M
	UmFOVjkXSGC6HjYfh2aiS6L6HceB6wh7ItoaedXfgtRDQwrMcOhgFS79LRWNSjZ5NC/7aszmR/i
	M7WpF7YsUkXa7RiylSXNtZcjsr9YYV8rl7YUrgZuqYp29N/TFzPwNX3VF5jjAGGsbZUs3w+I04b
	hA/y8eoo5e7jPEFwqQL8hXwFxAeWanFlrpdo7pBeADA17qyEv7YTjjLKM8NiMnhPepmDIsRupSb
	ymXDPiePZmFsQ6PW1lD3cxdjLNfBzPE7T/sPRetmlDQIl+b6D4b5BElk/WTCIDiSs41Hx+fY2xf
	47NGy4RubudGt/EfjW1STLNXXvlpI5HY7aLGJ5x+cKbZteLAhgnyLJTXPpcTtvoyTvYAlXYyoB9
	nBYRxdjMEtSZrnmCx1BCVL7vIAbAGhZtiCxqWBbMvsaI83GZ1juqM34Ah/OCaE4+c7i1OriQA5V
	zkj2ZdZ1B7RynKRsgiQDkW30yzas+Jj8Y69kD4+V3SSwy1eIMyRANEMy5EM8r9I3tS4UXFZFB4m
	QJVDN9JVLdLEX8kXuA1DkYun9IKqqyY=
X-Received: by 2002:a05:6a21:3981:b0:3e3:1013:4651 with SMTP id adf61e73a8af0-3e7bfc13c06mr5084204637.61.1793029568159;
        Mon, 26 Oct 2026 08:46:08 -0700 (PDT)
X-Received: from [127.0.0.1] ([20.171.34.166])
        by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8a5863826c4sm1137316b3a.41.2026.10.26.08.46.07
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Mon, 26 Oct 2026 08:46:07 -0700 (PDT)
X-In-Reply-To: <pull.2281.git.1793029565.gitgitgadget@gmail.com>
X-Fcc: Sent
X-Mailing-List: git@vger.kernel.org
X-List-Post: <mailto:git@vger.kernel.org>
X-List-Help: <mailto:git+help@vger.kernel.org>
X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:git+owner@vger.kernel.org>
X-Precedence: list
X-Cc: Marc Strapetz <marc.strapetz@syntevo.com>,
    Marc Strapetz <marc.strapetz@syntevo.com>