From patchwork Tue Mar 12 21:55:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Lindee X-Patchwork-Id: 13590649 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2137.outbound.protection.outlook.com [40.107.93.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7EC6614372D for ; Tue, 12 Mar 2024 21:55:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.137 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710280516; cv=fail; b=ijtkZc7tH3fgsEWbXWJ41G35Mvr60RlYGP9QEwX7zcKgEfWiilMItWx4MuVMQvEHMyptZ/qUhKY0Uvclgn93nSScpV77aeNQJKQnaKHuxUafw/m7CTOuGJ6pC41xcrXN5TAct5ft1pFPSWVm8HdaHtRs0vSHW21Fmjj6g20vZJM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710280516; c=relaxed/simple; bh=2aIV0N0cZU/a5Q0gR0ACyfbByNsDubx/ctnkCzMlXSo=; h=From:To:CC:Subject:Date:Message-ID:Content-Type:MIME-Version; b=MU7eMabbYfj7JjAaZZM8J+jxMItwSFJiBuDlPCTcQ3s7drCKXKcWNlSO3H7nrI0aq9x9SwsgOK9GpR+EMLPC8Vgtszr5jnqyYV5Aa07BTAwCkbiJT5/ZK3dwMFDzytq+9SacdtkTnoroygtNf7LG3a80hHc31yxnKS8uDYcqBwo= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=webpros.com; spf=pass smtp.mailfrom=webpros.com; dkim=pass (2048-bit key) header.d=webpros.com header.i=@webpros.com header.b=myRiqBcI; arc=fail smtp.client-ip=40.107.93.137 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=webpros.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=webpros.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=webpros.com header.i=@webpros.com header.b="myRiqBcI" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iIqAvBWqev5u8H6XM2j+YV8FrxQPcyk4pbuCSFzpXP3T/aQDeF1Kb+6BU69Bdz8+klAesdtVhOJYoLjO+N/INCo++hg/C9Mk5xMDI8PhBx8UOwxWRTzYYBQoEreapsVdf8X2xys6dQzP01ZrZK+mdbVr3wASWqv4KV+TgnpLDFsfKWyDLrdtKknmZYCnk5p58g20jgHJh92E+jKvvx3LHiUfp6WXZ3QZXF15Of/39uEXHUyP0tVyBeE0SQocOfyOIN6VN702iHhjPJCazeG0fi3w3IVj1THggU3HwmhYr1YBbID6ikaV8vvMYkBZvjv3M3kphHrTdbIjdVy3L+ToLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7eDx9o01ChBORscTQDEftVNbQsQ83XACMWWWaZe5wzE=; b=A02LCL/ntY1PBtEW92dm1HtvZdb3oGp+yM7OISSQ0wYgTrXJ3p2lGTGSjbiwnO+5BYY3qO6rXM2m5pVigLnOGduM0iNFfrwsUsKdRZ2fvraeG2eitfjsjV+AO1fNPJj8QEzPuAlGgUwOopO7DuHquSYrVBDhz1z5o2RJWt7hQ5vyQTfa55x0DWJAGB9qV+Plj1tWIm/AgvYn5VnXiWPgif/YHGYrPAjcb7szw2lafDtuC2eOoY4Ze5JqlxUX+iQxVDBHZO+j3NnJ6ceD4JLQa5wFfVnOluoQp1ouo2TK1U4hrW8/4gYJd7jzo8M/Uy2tA9Jk0RxJUZf2ELug1hu8rw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=webpros.com; dmarc=pass action=none header.from=webpros.com; dkim=pass header.d=webpros.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=webpros.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7eDx9o01ChBORscTQDEftVNbQsQ83XACMWWWaZe5wzE=; b=myRiqBcIjBoU0PI6XvKOJnW/HOhjfZV27dMuRVWfthW/gZigM1EhHeVFBxMFAdB2k7aGCA9ZJ4IPpcQh9tESo+i7xP7sG3FdeOCx5CYdT4RzXob62SmkSEariNmIXnscd4HjenMBOLwvqiogDNkirv1v858r0GA5xxImx0pnKlFSTQON6a8xrvvM1q2dXTwXaDeFgWVTR2xZRkO1W4EkRJ/c5KaL85YzsIrhTaEyoYHjmT/789cBTs31a6yILsz7V2o3HAjQ2vvvMA8m/4CO6VwmeFXd/6aVJMXUJNZqmxHBGOkk060HHV2GEn/CUNEGvAJQdmHt/U9tWHs/mk6mwQ== Received: from SA1PR14MB4691.namprd14.prod.outlook.com (2603:10b6:806:196::11) by SJ0PR14MB4252.namprd14.prod.outlook.com (2603:10b6:a03:2eb::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.36; Tue, 12 Mar 2024 21:55:12 +0000 Received: from SA1PR14MB4691.namprd14.prod.outlook.com ([fe80::acf2:4ab7:1c71:e00]) by SA1PR14MB4691.namprd14.prod.outlook.com ([fe80::acf2:4ab7:1c71:e00%6]) with mapi id 15.20.7386.017; Tue, 12 Mar 2024 21:55:12 +0000 From: Christopher Lindee To: "git@vger.kernel.org" CC: Christopher Lindee Subject: [PATCH 1/2] Teach send-pack & push to --send-up-to-date refs Thread-Topic: [PATCH 1/2] Teach send-pack & push to --send-up-to-date refs Thread-Index: AQHadMdLLrOfHThu5EeIsu1MpASt+Q== Date: Tue, 12 Mar 2024 21:55:12 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=webpros.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SA1PR14MB4691:EE_|SJ0PR14MB4252:EE_ x-ms-office365-filtering-correlation-id: 2222dc8f-d47e-4941-a8da-08dc42df17f5 x-ms-exchange-atpmessageproperties: SA x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 4tvQLvgudh1f6IJAkRIoJNeoe51muWZUVuD2/Q4Y1QfeRfYAErB5udcJ4+agj8Mq60D/BC7UVmFX6Cjb98WJQ5RmVwGPdKA3eDRZDlGRND6xiPES/qDnzfD63WMwExbh2/yvy9dqZJh2og3jac1Pc2LQqdk1oCHNMYYpzaoJ9tsNK/tUoHbbg91ZrqDl+equYjRRfbdPX8k+wR+f31igw7V6fiKtGR2CFl7xBA9oHdWSoVH2dxu3IFUsZ+cUhHnoFNNKN1sB90BIrAWwSpp+0DuQO6FnZzU929zp7WltKBsJ9/uncW0zJdjq+ZSF2Zlx2qQ82+Sxv4fVYS8/M50hHiU2HUfQwJ1GmSHQ3pcGW7CIkLYepSUeg1nUnTxyX4YxZlGVAVBAOyARSMn+SsJDFKmaezguITnx1W6FdDfGjgupCpoB6mZdWdbUqNkVYNRoiuxwcxvxbbsTFjnfJ2nQbjFyZV86p/I4a9ZIW0Puun1kDLtbUUuD8nHO1hqPgF9U7Xg1X4Ab8tl5AIXbnLQcPiia+eazqVvQffp3g8L6lJgeUpvBvHk6BgY9gisoRbEpP40E+pe1GaI/ar6EvBPl9f2ZRvP+TrTB622S2+DbLkcZQW7pZYM0zcXOyKiwF82BsDKPCs1X2aYzdM25ahfNVad4Z9SULfSgttOmWjl5uDGrKw7FHjgMcDQIYG5m3gs53VbzUSPnHNOVDJsOPeud3A== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA1PR14MB4691.namprd14.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(1800799015)(38070700009);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?or0mTCPYtdpWVIm1IlEmiX6?= =?iso-8859-1?q?rXwPo5KyVX371f8GhhWmwcfd8Ss2ZIkXiqhl78CPdm9YAxjWlUZ4aeBH3jLE?= =?iso-8859-1?q?WFpl2dApwv/1czKTmgsKa02CKfFq6aPP1a/YOziFOiLw4ku+cPv1WeFU3FgP?= =?iso-8859-1?q?h7Ju9v02WA02ffgxkjLNnr+RieQSGr5fGfHFOPXlOLHOl1uR9R4H3u5+05U5?= =?iso-8859-1?q?sHJceQJa21uzIhX2PDFiwrgdZsw9AEY9pKI8uYNaXbYlF5TyZYyr/gGbht0I?= =?iso-8859-1?q?vXxDo6A0giT8KjvKjyXemxt178REbvqTYptcUdQkYUeLYlyPnCn249MOrYI+?= =?iso-8859-1?q?cm18c+tJ8BBTX7BahHyFIqv4qcZZvJpdVSEPGJWufPFCVLcG2+S8GKFoEttU?= =?iso-8859-1?q?50WHe/DM2Clg+rxNzoV2RzbruKTXH5IUXbGBjWK7mAuUowFGSB+JCedNGN6D?= =?iso-8859-1?q?CATwgx1fir3dVGBgxsupgGOZW7Bbk9RZr/2e3erbsBloY2SArs8udLbPymAE?= =?iso-8859-1?q?HpLnPLyZGyfGdZEVKdEdgnXvB164HiW3dB+LiOvWFUWBcRNBPrkHDsveGg7z?= =?iso-8859-1?q?FPT+Y+ocG0megKImcCDhs+SFPZmK4V42EmDnlpfJRLwLgyfefhU0uie5ekDx?= =?iso-8859-1?q?uPVDfPdUyw7SM9s+rBRKxMxS7wNM+8uOzVWxWy3XlotWD1ErTMVDfogeRoSd?= =?iso-8859-1?q?ZtoLbEy2uRuvg8PVigY3cRWeaMFIkxp1QP/c9OfT0Tx12b20bfMg22FqMsjF?= =?iso-8859-1?q?cUNOh63bHFokfTwrAHGmLrF0BMBXpYurNSlw5BI+4Efld4Qej42POO2+oixd?= =?iso-8859-1?q?qsymklpRrM3LUZfMZVzzV5b3oZhei5LzszBJIIXRu5Z1FafHfJ25v0U41VG3?= =?iso-8859-1?q?b8Zz+/qmOdL0gEJVp0EwBQlxGhDF0E12k6D8CS64OF32lJFHfQEyFWUg8XPw?= =?iso-8859-1?q?+3qsToUxPQyYvSBO9iAO/Ny+Oyp9HfLM0jfsH6+Rigzf4jBmkce9704Lx76I?= =?iso-8859-1?q?JlCLZSCoIvoYvBJdcd/wdmzfV/QrMBF7tL7kPsrsnVGSB6ZTnopv9gTVUSI7?= =?iso-8859-1?q?nMH+/bOm89oGeupjeNW96K+fqsmtkcljYLn0FvUB63QuTstBAjtJTLuSDPGN?= =?iso-8859-1?q?ZQZiRuOMJMC7ttiPZYM77ZbrR2ks8EL3mRfS8eBR3mkCw5vBpX/FggulhxN+?= =?iso-8859-1?q?ZSMZoX2ZV+LzSU3ZtEDTImZkH1HY8QFR7a4OmWc0uX+Q36UbOEKgOf0jAM/v?= =?iso-8859-1?q?BFl1d4amWVU86T8zg8xSsW+s7HLtlaRmjC+oepnZqJPmH3QBVtkWQcogV8LG?= =?iso-8859-1?q?SovSxawcqFB5+g+ISR8R9ApApkZyGapX6OXKM6OVfNx2NMu44RiiPtpmvZnz?= =?iso-8859-1?q?wIzKGi6/T3i72T22eiuva7eZdYiyo2UUg/cjiOmPIByhoXR2fdCW8UOPGE/l?= =?iso-8859-1?q?Jou/yxRgKpEgXhRljknJaHcztl0EGW73ERpDtrhDgWCNpi4S0MBvtWgmj/la?= =?iso-8859-1?q?QEE89QmVgXKGP6CNX6CFpiYYncCP2MUEVaYAhx81kfcJsVTObE4rL88w8WYZ?= =?iso-8859-1?q?iJVl09dRi3jzoYzv6D1IWH/tRHvXSJyOHFRzXf5RMF/7nCjpW9fMZBF6gof4?= =?iso-8859-1?q?lc7t5o6tpBiikaXm4PJjlerE5iHLDvjPkMBd4cw=3D=3D?= Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-OriginatorOrg: webpros.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SA1PR14MB4691.namprd14.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2222dc8f-d47e-4941-a8da-08dc42df17f5 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Mar 2024 21:55:12.6403 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f8497356-a834-4060-86b6-d4b1d8059ee0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: fDA8/NU0m0NrQJQLOV7VEBWKb9Ho9Vn3EnCbMBK3E/byZjDxn1x8cDkUoYiTUZg2J0f9OMAQoQTc74knpK+onseyxW+uEMuzIkbfCOntRq8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR14MB4252 Provide an option that forces the local Git transport to transmit a local ref even when the receiving ref would not change (i.e. the local & remote refs point to the same object). This is not done normally, as no changes would take place on the server in a vanilla Git setup. However, some Git servers support push options and those push options decide which branches to operate on based on the refs that are transmitted alongside the option. This option ensures the refs listed on the command line are always sent. Signed-off-by: Christopher Lindee --- Documentation/git-push.txt | 8 +++++++- Documentation/git-send-pack.txt | 7 +++++++ builtin/push.c | 1 + builtin/send-pack.c | 4 ++++ send-pack.c | 2 +- send-pack.h | 3 ++- transport-helper.c | 7 ++++++- transport.c | 1 + transport.h | 1 + 9 files changed, 30 insertions(+), 4 deletions(-) diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt index 9b7cfbc5c1..44d1e04931 100644 --- a/Documentation/git-push.txt +++ b/Documentation/git-push.txt @@ -11,7 +11,7 @@ SYNOPSIS [verse] 'git push' [--all | --branches | --mirror | --tags] [--follow-tags] [--atomic] [-n | --dry-run] [--receive-pack=] [--repo=] [-f | --force] [-d | --delete] [--prune] [-q | --quiet] [-v | --verbose] - [-u | --set-upstream] [-o | --push-option=] + [-u | --set-upstream] [-o | --push-option=] [--send-up-to-date] [--[no-]signed|--signed=(true|false|if-asked)] [--force-with-lease[=[:]] [--force-if-includes]] [--no-verify] [ [...]] @@ -225,6 +225,12 @@ already exists on the remote side. line, the values of configuration variable `push.pushOption` are used instead. +--send-up-to-date:: + Usually, the command will not send a local ref when the remote ref + already matches, as no change would occur if it did. This flag + disables that check. This allows push options to be sent alongside + up-to-date references on the remote. + --receive-pack=:: --exec=:: Path to the 'git-receive-pack' program on the remote diff --git a/Documentation/git-send-pack.txt b/Documentation/git-send-pack.txt index b9e73f2e77..2517d226d0 100644 --- a/Documentation/git-send-pack.txt +++ b/Documentation/git-send-pack.txt @@ -13,6 +13,7 @@ SYNOPSIS [--receive-pack=] [--verbose] [--thin] [--atomic] [--[no-]signed | --signed=(true|false|if-asked)] + [--send-up-to-date] [:] (--all | ...) DESCRIPTION @@ -88,6 +89,12 @@ be in a separate packet, and the list must end with a flush packet. options, error out. See linkgit:git-push[1] and linkgit:githooks[5] for details. +--send-up-to-date:: + Usually, the command will not send a local ref when the remote ref + already matches, as no change would occur if it did. This flag + disables that check. This allows push options to be sent alongside + up-to-date references on the remote. + :: A remote host to house the repository. When this part is specified, 'git-receive-pack' is invoked via diff --git a/builtin/push.c b/builtin/push.c index 2fbb31c3ad..555e8b53fe 100644 --- a/builtin/push.c +++ b/builtin/push.c @@ -617,6 +617,7 @@ int cmd_push(int argc, const char **argv, const char *prefix) OPT_BIT(0, "no-verify", &flags, N_("bypass pre-push hook"), TRANSPORT_PUSH_NO_HOOK), OPT_BIT(0, "follow-tags", &flags, N_("push missing but relevant tags"), TRANSPORT_PUSH_FOLLOW_TAGS), + OPT_BIT(0, "send-up-to-date", &flags, N_("send refs when there is no change"), TRANSPORT_PUSH_SEND_UPTODATE), OPT_CALLBACK_F(0, "signed", &push_cert, "(yes|no|if-asked)", N_("GPG sign the push"), PARSE_OPT_OPTARG, option_parse_push_signed), OPT_BIT(0, "atomic", &flags, N_("request atomic transaction on remote side"), TRANSPORT_PUSH_ATOMIC), diff --git a/builtin/send-pack.c b/builtin/send-pack.c index 3df9eaad09..da6630fa12 100644 --- a/builtin/send-pack.c +++ b/builtin/send-pack.c @@ -19,6 +19,7 @@ static const char * const send_pack_usage[] = { " [--receive-pack=]\n" " [--verbose] [--thin] [--atomic]\n" " [--[no-]signed | --signed=(true|false|if-asked)]\n" + " [--send-up-to-date]\n" " [:] (--all | ...)"), NULL, }; @@ -165,6 +166,7 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix) const char *receivepack = "git-receive-pack"; unsigned dry_run = 0; unsigned send_mirror = 0; + unsigned send_uptodate = 0; unsigned force_update = 0; unsigned quiet = 0; int push_cert = 0; @@ -200,6 +202,7 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix) OPT_BOOL(0, "stateless-rpc", &stateless_rpc, N_("use stateless RPC protocol")), OPT_BOOL(0, "stdin", &from_stdin, N_("read refs from stdin")), OPT_BOOL(0, "helper-status", &helper_status, N_("print status from remote helper")), + OPT_BOOL(0, "send-up-to-date", &send_uptodate, N_("send refs when there is no change")), OPT_CALLBACK_F(0, "force-with-lease", &cas, N_(":"), N_("require old value of ref to be at this value"), PARSE_OPT_OPTARG, parseopt_push_cas_option), @@ -221,6 +224,7 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix) args.verbose = verbose; args.dry_run = dry_run; args.send_mirror = send_mirror; + args.send_uptodate = send_uptodate; args.force_update = force_update; args.quiet = quiet; args.push_cert = push_cert; diff --git a/send-pack.c b/send-pack.c index 37f59d4f66..30b0f2f276 100644 --- a/send-pack.c +++ b/send-pack.c @@ -313,7 +313,7 @@ static int check_to_send_update(const struct ref *ref, const struct send_pack_ar case REF_STATUS_REJECT_NODELETE: return CHECK_REF_STATUS_REJECTED; case REF_STATUS_UPTODATE: - return CHECK_REF_UPTODATE; + return args->send_uptodate ? 0 : CHECK_REF_UPTODATE; default: case REF_STATUS_EXPECTING_REPORT: diff --git a/send-pack.h b/send-pack.h index 7edb80596c..241b4278bc 100644 --- a/send-pack.h +++ b/send-pack.h @@ -27,7 +27,8 @@ struct send_pack_args { push_cert:2, stateless_rpc:1, atomic:1, - disable_bitmaps:1; + disable_bitmaps:1, + send_uptodate:1; const struct string_list *push_options; }; diff --git a/transport-helper.c b/transport-helper.c index dd6002b393..115f46f6b8 100644 --- a/transport-helper.c +++ b/transport-helper.c @@ -983,6 +983,7 @@ static int push_refs_with_push(struct transport *transport, int force_all = flags & TRANSPORT_PUSH_FORCE; int mirror = flags & TRANSPORT_PUSH_MIRROR; int atomic = flags & TRANSPORT_PUSH_ATOMIC; + int do_nop = flags & TRANSPORT_PUSH_SEND_UPTODATE; struct helper_data *data = transport->data; struct strbuf buf = STRBUF_INIT; struct ref *ref; @@ -1010,7 +1011,11 @@ static int push_refs_with_push(struct transport *transport, } else continue; case REF_STATUS_UPTODATE: - continue; + if (do_nop) { + ; /* do nothing */ + } + else + continue; default: ; /* do nothing */ } diff --git a/transport.c b/transport.c index df518ead70..84deadd2b6 100644 --- a/transport.c +++ b/transport.c @@ -867,6 +867,7 @@ static int git_transport_push(struct transport *transport, struct ref *remote_re memset(&args, 0, sizeof(args)); args.send_mirror = !!(flags & TRANSPORT_PUSH_MIRROR); + args.send_uptodate = !!(flags & TRANSPORT_PUSH_SEND_UPTODATE); args.force_update = !!(flags & TRANSPORT_PUSH_FORCE); args.use_thin_pack = data->options.thin; args.verbose = (transport->verbose > 0); diff --git a/transport.h b/transport.h index 6393cd9823..61a20e84f0 100644 --- a/transport.h +++ b/transport.h @@ -158,6 +158,7 @@ struct transport { #define TRANSPORT_RECURSE_SUBMODULES_ONLY (1<<15) #define TRANSPORT_PUSH_FORCE_IF_INCLUDES (1<<16) #define TRANSPORT_PUSH_AUTO_UPSTREAM (1<<17) +#define TRANSPORT_PUSH_SEND_UPTODATE (1<<18) int transport_summary_width(const struct ref *refs); From patchwork Tue Mar 12 21:55:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Lindee X-Patchwork-Id: 13590650 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2101.outbound.protection.outlook.com [40.107.93.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 36B8F144025 for ; Tue, 12 Mar 2024 21:55:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.101 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710280521; cv=fail; b=TGPZjcbTaBliTyU5wQz62CBjPbkXOQOO76m2R4MmYSzwBJSZaTb019Jd382Iqz30a240BL4ksaFqHN1zjppPyV6v/hgbfquVb6zXLcQu/yHOFf0khuOmLvm4RGd9WV+lILiUYmLWXfQgRkA+ATuxOA7VfWQYlyaLO2kuCkRNFGU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710280521; c=relaxed/simple; bh=gojP5vA7Z4H0VFQYjS3sVKnqZOPIGEFMPUvVjO6S1c8=; h=From:To:CC:Subject:Date:Message-ID:Content-Type:MIME-Version; b=shn01/w+lr8x2KwgGyeBTciSc7QEFm3MuobGz09icsVxPUPwW3PVE/pSE0Hc3x1qW465G20vy6ejJi85kyY7wRBhEkDipPVj8OT7GudTnc/wsPRhFSCBXbybLyAQIZio+XAD/F605MWhvh5RC9gCpF1tEcitrygseyXjYs/u/8g= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=webpros.com; spf=pass smtp.mailfrom=webpros.com; dkim=pass (2048-bit key) header.d=webpros.com header.i=@webpros.com header.b=T1fHXfg8; arc=fail smtp.client-ip=40.107.93.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=webpros.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=webpros.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=webpros.com header.i=@webpros.com header.b="T1fHXfg8" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Jm6PXsp6jFiePFeiv0sBTcMddxrHx8K8WYcr7Mo3kAK37OjQjpw9c39+/b1x7so9z4gseA/e2fRmAXrg3I46QRnJNF6GfQzYC+vWfl0mZ6pEtK505oG/dW5XaIVkoAzCRx5if9kEjTzsz+KEIZPUgyTr20Ky+BVoKEQLh3AJUQREz4ci1GNRglAQ+DsRicfkT842Rg8PDttX3kYXPh/3v+rukkOTUvfewV5xXHvJZk3rX1YzmO0psCw3yJ5ae+9EBNfpn1VtryeN3bAMAs7i8Jec3UJAAUhjGYzAw4ApfCfv9KrD7gu5qPKBuN/hIUBAdsDLdFOFelBMQWue+p0yPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=kGSg0Usl5azqSS/MQKcV40EYs0KkGWOL5Hm++3LJcW4=; b=awRK8jI2trjZE9WWLrA+2c3RPz9NQ9+Fj80l1trsvMxKoy26RORnr7ISMglHtbiYAjA5Bpa/v2APQ2+Wh9Sq1sHZtJuefy+TCji90/7nnbktNU+COytJww987eOLpN8DQMvznnyj6aAyT/rsuIv0OPriNY6yon1JIu9w3rMScr3v1+We4D7mD0xHMuP8rF8t6FV9iYrr47k7f5BcRSeb/L3YX/huojYKZHVVQmFHcdXVRtG9eHs3GX1iQwQCENDFDEXS/F/6RX4CqXafBw/dqJzyWN+0MfKUvMOLzwwYongdEc5rqVg05LIY57GPiIfllbr38fwXcWDpLF1aD0S5vQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=webpros.com; dmarc=pass action=none header.from=webpros.com; dkim=pass header.d=webpros.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=webpros.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kGSg0Usl5azqSS/MQKcV40EYs0KkGWOL5Hm++3LJcW4=; b=T1fHXfg88xNnzLesTdxBxPDuBUe7ZGdsbjneCw96uoSt2WxR02CZ2mwH+dsiylK0F0kC9CRhXUY+bYVpeSByoWAg5DsTunuqyrCrfKknutFjXBVd0vzDOBoKNMBif4pY/ErD4OAz9PPoaCbknnSkMx47iQZVo0RHlS1POMHXrsvfIEUCM0qerk+DO0GgaaM2du5pUY5T2jp95aA1o2sLRSodRfqkzAfriWVuQlA2Dqqw/v1uzzOwCYKZjIIvwizLJH3H9WhLzY0OTE0NY7X5VhezoFJf2n166f9UIfsSPyrMtvEVRKGA+5D19lTWSq2xmRFYMWU1VQJKyVgSbq8Lfw== Received: from SA1PR14MB4691.namprd14.prod.outlook.com (2603:10b6:806:196::11) by SJ0PR14MB4252.namprd14.prod.outlook.com (2603:10b6:a03:2eb::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.36; Tue, 12 Mar 2024 21:55:18 +0000 Received: from SA1PR14MB4691.namprd14.prod.outlook.com ([fe80::acf2:4ab7:1c71:e00]) by SA1PR14MB4691.namprd14.prod.outlook.com ([fe80::acf2:4ab7:1c71:e00%6]) with mapi id 15.20.7386.017; Tue, 12 Mar 2024 21:55:18 +0000 From: Christopher Lindee To: "git@vger.kernel.org" CC: Christopher Lindee Subject: [PATCH 2/2] Add transport message for up-to-date references Thread-Topic: [PATCH 2/2] Add transport message for up-to-date references Thread-Index: AQHadMfJU4Kb2lPtQEKMVlla3PY73A== Date: Tue, 12 Mar 2024 21:55:18 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=webpros.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SA1PR14MB4691:EE_|SJ0PR14MB4252:EE_ x-ms-office365-filtering-correlation-id: c535a81d-b07f-45f3-8d50-08dc42df1b59 x-ms-exchange-atpmessageproperties: SA x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: J4f94mCaarZ2mwgVVoFZg09aJSuR09L9qNFEuo54L8lm/dtPlV5FD5qxHQ1+jKVjnLgHLKnYXXKqGP00rOh63oB97timOG/5nR48SRO++yPzLQGT+XvbOvypi6Kq1Ed+YE3P2iHV8+rpeDYtxgJKi4c++4Z18x5HrhXrqqG5IT4XqERxYlce2CBvz0ezVfrCkUhJicKhoOw6WBs2UIWXdk403LZpy/qfX74g5C6l2ppFU4EAQxRLcsaT9grzbD/4TsMRSNq0g3A/Lr8V90LVi77kTtLadTmX0z2Nbb3o1f1uAuG4xJaji04M0qWLQiHqvIMvgHLeXsQ3ThfvP69hGKtmoXlOe+xlpVEiXzwwuBrJruCPsP8Zn6hV7znGTK1XVail5Xp+ph7GFrpTNW1vbieJip9u09mcKhXBK5nyPf/3ky9hFRDF0GbWDwrYsEfQwDZ4X5zR1Sze3+CNHK39WrlBCsgFYgPWJltk46T7fw8r0bApkqgSZwXG+fvm+Nkc+bcETK5kbAM+0XI+VF9hjsJI/+4Uz0lB43vatxSIe3vxl/WbsBfhhOUiLlU3F13ZFVsJzXDCUGRyZycsJGzgM9EXSK78Hj4ddGG+xhjOSei71v83sIh+qiW2J/kZ+LbTE+rYE2yxjIjEuBO00+EpVSvdsY0doZryknhMikQjtHna1cGcztRsRsKwC9AniFaZxm6MVHXdDssKIi5x+OPMfQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA1PR14MB4691.namprd14.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(1800799015)(38070700009);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?vRYZAOSp4AFx0wU5uKb8N4N?= =?iso-8859-1?q?qouAhJCslKAM7+HVYzQN3B/nfUUVE/ilRklYN2dFy/WIbx63N4kekHkaXDL4?= =?iso-8859-1?q?zQ+VvZMhQ3+3HwXlnHMZFqluJBvne5pSQ+gYeLkZsFscuWygDAN9968TMIKS?= =?iso-8859-1?q?zuMXbn0RTac20len1XWhHesgJeqF2UH99eGcRMb7gR45DUzYUhxvUk6TvBIV?= =?iso-8859-1?q?pvRm2tEqRyc0tce9AQ9VhYY33ypPoKKP3hI1zba3Kl9NSADlAkp/yNBqBXfL?= =?iso-8859-1?q?CphSYZAsQ/QbskHbx3jfygWnOb0nwv5qdUDk8e6Na/3CzrkV5NMSTHK4rxkp?= =?iso-8859-1?q?4qpvnw0WzVlByU52wuhFzSuu4Gb1wQFgukVjoGmZpMApuP8aJzQqD5h3/s5R?= =?iso-8859-1?q?88s4d7sSBvS0wyWYvCP2NkreYQt4Qd3Z3mHG7pQIoUbuOJ0TvCdR2GV7Pv3u?= =?iso-8859-1?q?JpbpPZ8reqvEBz88o9vOnn6+KviVmYaChOozFIKQwtJrUpv+pPRTcIEqcNUi?= =?iso-8859-1?q?At1w3QDS1Crfiq+Fb11c+hTrj8N7nX4EF6yMJYgfpwRK/G8Cc9AlNJRhL3XI?= =?iso-8859-1?q?2OqpNDnBlKu3ykgg4za8tgpu96ZCOU7hbV27I8EYIZ5ROCJStq5KMHHnOkxQ?= =?iso-8859-1?q?ZgYBrvHKLyPPRJgmzsYeCGfvISnwcaTRyowyFCegJ9V/PNHnGEcj3masXKPJ?= =?iso-8859-1?q?wEs2ffy0GvAOIEBtb8ZEbN/JIfeQycSWdCiIyFrYjZZ+XcXZcThwB5rXUxrI?= =?iso-8859-1?q?bvBjZoSWL3L6enW4+zXZnAmQRBGUxMvN8QrH/B11VQli8JzScvXHvWN3hKYp?= =?iso-8859-1?q?gv84csOSnjFMk4gebbAQlQJmsfvUyM6Xu49Joc9M5ZWZRGn9DnyCO5fGzeJG?= =?iso-8859-1?q?OKX7ZIDhs6nJ8QwZcd7f8vZ2o7hXEIp+STIgoMAf/t5nPHzI09+zopYwRD62?= =?iso-8859-1?q?sEwB2e8eFq0TnRvQo82E6m8v5vQs3D1CTa1jA5VudC2qLMohXyf48kQqQfOW?= =?iso-8859-1?q?e4UxaZ8JobRUIhUvQ+lu/XOIbV3QUnkXhlBK3qZGXi3DE0vr11U5NKMoYHCD?= =?iso-8859-1?q?5L6lQNt3CNFNjR5VdiIupDxg0BRXBe0/L5/XTL5pOkhCJjUdq1jS+Lhs3Cda?= =?iso-8859-1?q?H6R7pEN8JQdDnDp1W12K1RxP6V5SSm4ZA9Q30vYR6963EN3OwF3h59RqdrqS?= =?iso-8859-1?q?7zaW2nnnshNvHWVVQlK1q4QVKvEVOgDlRnqHj+OvrY7iZQoAFIW2xiWeo1+3?= =?iso-8859-1?q?XI7/9NcC96wPj+n5qbm7ixgpfKTWIDOaFOzFb8LYKypMeulbjyBz8QZJr3fK?= =?iso-8859-1?q?z8e0qI/IOw5+9k7GWTpALKuxJ6Bz6UoR0sUVe0UZeUE2shBQlX38dOOAihoO?= =?iso-8859-1?q?1LNacR69EpzIIMTbI/IniL2zGO0r2SXZt9wfczBjsQcwEmQfdxaMFbpOARoM?= =?iso-8859-1?q?CMTyzOh4yMRCymuInRTdJq/RKVYzG2fWbimHmbAwkVASm/PKCAnQMRJU5OVc?= =?iso-8859-1?q?vIqmkBlLAuD8sN8E1F1wkGbm6CZ+Fv2HokExyHdZc7HhXFuwu+jiqtSgxMcj?= =?iso-8859-1?q?znkABgbggw5hh4dvQITbgcavzA48edPjmvSIhNdiZ2Me3kKqf/cSrQU38dYk?= =?iso-8859-1?q?Y4cwwj5nuc+GTLxni8gn0i5a+Y3Kiial16xpnaw=3D=3D?= Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-OriginatorOrg: webpros.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SA1PR14MB4691.namprd14.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c535a81d-b07f-45f3-8d50-08dc42df1b59 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Mar 2024 21:55:18.3528 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f8497356-a834-4060-86b6-d4b1d8059ee0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: s4D488vWCMETZA+/lcjN2AdfukuiDPWB+6Tjfx2bDAR5lWemaCFdLUMcDh3a9rtREz7m822xtyyE5CVPnnVLGYtTNlZODkcsoOR+urcN+0U= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR14MB4252 If the `--send-up-to-date` option in the previous commit is used, the "Everything up-to-date!" message will never appear, even if all of the refs are up to date. Moreover, the output `deadbeef..deadbeef` appears suspicious, almost as if a collision occurred. To clarify that the hash is, in fact, identical & to allow grepping for the phrase "up-to-date", add a message to the output when the ref is transmitted, but no change occurred. Signed-off-by: Christopher Lindee --- transport.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/transport.c b/transport.c index 84deadd2b6..89802452ea 100644 --- a/transport.c +++ b/transport.c @@ -670,6 +670,8 @@ static void print_ok_ref_status(struct ref *ref, strbuf_addstr(&quickref, ".."); type = ' '; msg = NULL; + if (oideq(old_oid, new_oid)) + msg = "up-to-date"; } strbuf_add_unique_abbrev(&quickref, new_oid, DEFAULT_ABBREV);