From patchwork Tue Mar 12 21:55:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Lindee X-Patchwork-Id: 13590648 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 467934AEEB for ; Tue, 12 Mar 2024 21:55:11 +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=1710280514; cv=fail; b=tj5kXD+nG+ObeXWh+FX1HJmbNQm11Y1M/CZkL4TFAWuLr86HUSSh9oggodl1g7wiL2kJiZ/0lsgQ1WiEoFzeVx7EKIYi7TmY4zrtsuec4l+WR76/jbMBHJodlJGOZ5QSdMmUhb5A1xErOQQNxkqzZlGgbVmgYq3dr2q6dvqy5V4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710280514; c=relaxed/simple; bh=3nmVNqS1VqCYq86wSLtrdK6gWFQ5E6TlfPojV1mBY18=; h=From:To:CC:Subject:Date:Message-ID:Content-Type:MIME-Version; b=pk+a8lBNKmyHG8N7uVvcOVjImvd5J6HMytWKZ1jByN0+gUsZhr0iyHrYOCi2DPcvU652FRlMES6M1LTLMcG6IbCBZf0jKErK9HIQhQU+ORx36XXX9J+cL6rqg/5Yc0pp1QqrwqS6IT62KXiAE4oTgEAwMUXdw6K4YdcLMamS1Kk= 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=WNuv5EBK; 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="WNuv5EBK" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z6hsRDrZUz5IzmVJisdGk1Ku9jHaq2WoKK0HifYX8QVwEjk+3bSsWqdaC/MIXkSUIKK6HNohUD7b04B9cvLT79x2fWLuLuy2RXL4IFgZgDpXBUeDunmN+BChzH/PPlQ725Qe9VqKSEGgds/3KMzsyqAQdmaMjbDfSvZozKGQKz4qnpkS3n/YP6n614Nc6Qp5sVk5BrTA7rfc7vQk5/yb+Vz39G4MvGjuN0f36oDNo24UpGlkGy0FDoMJNeGtlQwFurogwVA82p2ciDA4CjuEw2OPJ7dTDI4LVxHbbeYKwEtJ3n0nHfRrPMj9C6DMwSMsUDg9nbpXlBcLChFjqLfxXg== 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=48UWEj+6xr0plq6d91bfjkDruUpZseVUx2oMdHwJpmw=; b=SLH9tZkOS3plQta3/l1B3f4QO2xxc74Pl1bI4DezkAqHsIm6N4ppOfphBt6etzy2/BKLpoUNqwJ96RF6GA8FFRIn2wHqdGuB1+QX6NP2RuBfMMWHwsRseWPtuu2tTgHIb/A5WAFGNjgKIp6b4+OT4DbPpksi6fTTzgNkTEUL8UkjT22sXKih2a7ov7ISueo8eH9kN4XNFBqKmNfHhdco/49dhIbfH6jfwyxIvXGdPCaUienZ7bczrZD4SUhgQEVfvcx1pu6RJgxt04wbSL2v9AoXuaRg7bixh3pkRV+Uq0s2a/uzxpPmC0cJOURO9RCbiVOZP+jsgqh1ftSNVRAhmw== 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=48UWEj+6xr0plq6d91bfjkDruUpZseVUx2oMdHwJpmw=; b=WNuv5EBKmfNIzssmq3K7IBTmQvZhygiOjEPSQEEkYtg16P5gLpyka4a0RuITJmC2qry+4TdVW7xoK0se+6Ez0r0+yEBVYwieeJqB/WHDEPz9X0YQz0uE2KzMd00N8PONiX7vZ8IcDXKGMgIGWtLu264M37pyyWWM7FL2X4yX3mHlfJGUAhNh8DXB7Mn56cPDBgwc98kqhnC85GYRjFFUZBNBilMN5lky04sw5f9r+rm6JeqvVdwZ+c+SVZNnL+xkS3vP3+gEhkUrlKiORjdh2bMen/Xhz2+/UtLRa3If0ukOovR/pIxyO2PIMtDfMdFhSjjkTaIboQLcbQjYNVpXzg== 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:09 +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:09 +0000 From: Christopher Lindee To: "git@vger.kernel.org" CC: Christopher Lindee Subject: [PATCH 0/2] Optionally support push options on up-to-date branches Thread-Topic: [PATCH 0/2] Optionally support push options on up-to-date branches Thread-Index: AQHadLHezsdN01rhbUOhmHwkmqTtTQ== Date: Tue, 12 Mar 2024 21:55:08 +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: 54a4546d-bb3c-42ad-26ff-08dc42df15ca 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: uDPh9JqcVbxs4naWSyejmYiD3oRz5FBvqwrlloLbq2CGyvpa+VPuNOdx2LJ/yyroyAKTqErLhaifgXl4mEI7Trs0eKVDmgrNPnGGiliAn6+jtg9wGMTmHGGCvhTbq63oY5C9zYcQ6JBRMzOlO+tFq9+bv+rgTBggXwhbDJYDaFL1gmlwNqnRjzmFuYkedxrHOV2fDOnMbGtGOi/njhbdGRynlYhNEDFgho6HcVcgVOZXEDKyk01+i92xawR6hrw9luLyjKHPzT1qyC1yz2z6fDqonxqc/l470Q1EiNWjz4tTacfZIK95qF0QSGttnCno+yc2FuWWkmeKOYdR5NZAJyaR2EQktkkflwNqqa0m6ZLG0CfFWCfYCjEAdc9F6TUWuawnkxJBsmE1SBicvJRDU3QrHLRru38px+f7I/WPEwGDH4xMWrad5k2L+x60xjqyHL9/ReB1wGIisch9iQU/TyPXK35Is/fXk4UZz7DyQPs+D8wUhgNZuX9nkX0FC6pJD/Uvmdsu6MrOHyzeswcm29r94uUrtbR47FWommj0F6FyhoMmFpqDHDdsfNMHxiAG+lO72JK8lVDf6lELR4YrwDytiB+ul+UkLAn+dOo3+eY6zx9Fv95NhpPtjiduCcOAXICHP8Z3yMkhDJYhQXgZhBUhA1Y+XOF0IDX/PA5IThdlBBVI05IZc0obF2x5vTb8uvpOTkvSNNg/WNGrU9Q0MzrnqiBuHKU38FGegsxyTkk= 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?8MQrCWmkuK5i2M5YGISccZM?= =?iso-8859-1?q?WjY01uJY5DLmMtbU6ZLio29lHW/p6Fb7jIcIbWPydelkEyvFt4Ni2im2hfCQ?= =?iso-8859-1?q?S3YtJT4CAhTjQBXI+R86WkFzTcqRvIp9vsvAyYaz0vvdJjehddjamEaJ2sdn?= =?iso-8859-1?q?cVt9R8TQ98puuDOviqrPqtdp6B+rC5+cz/Td93QSQVYFoc9neTY5J1qftf7u?= =?iso-8859-1?q?pqcBDX49NXpdmpZw295qspjTJ42z/VJot7G3ejz+oZyrlexSF5UZBbxVSli/?= =?iso-8859-1?q?MBfCh+4v3vbFZBSKs0CcV9a3pJJOatRBTovv3iBIH+KGIZ1+A4h60GmnoDfa?= =?iso-8859-1?q?Gxx7SPgdnX3tN52rBn/Hum1vi+ETzV/QskAzxY4z16gpbVO7qHH0nBK+5Ol9?= =?iso-8859-1?q?X+W8IvsFbj78vntHGcSIy5mVzv4YnBoHPWF/aRkJT0zfNdjsgXCroUieqm32?= =?iso-8859-1?q?ksVPn6tgAaFEFVn4vG+wZBh+iVHj/aEIh4z5pdDvdkMUJFbn4ChoUfu44hE6?= =?iso-8859-1?q?ACQzDTQrr0jsaNYBRikD14R/ssUROCmxTKZz8mBmDH+Ielt6BjI0MDocq/cN?= =?iso-8859-1?q?x+DEMJVLQByxhoTymwuFjbpQ6AScm56BOJeXWbBQ2z8raCZYhR/kWY5zskcS?= =?iso-8859-1?q?tcr/WKAUEXbXtrrIDwWgIb1/xZxrtLYQZ+/YmXGMP3mf/5g6Fx3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?UiNsfy1X1A7FIG3bar2pfASAQkVifhHm5nXU0MiilgQoSMMHaPRo83aj5aCp?= =?iso-8859-1?q?9UgK7le+5aaieg0YvvtShzOHNgPhmMynfr/M8tg=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: 54a4546d-bb3c-42ad-26ff-08dc42df15ca X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Mar 2024 21:55:08.9988 (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: Dp9nEFodqbYJDhgmeJNQSp3Eusmhmn6nWR9NJ38MHacGuGZKikc5y8fBxm7S1RfqY5RtU7kQfMDSfZtXOn8dA2NJSW+FTAO1EfaYKNu2Ki0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR14MB4252 Some Git servers can take actions on a branch using push options; to do this, the branch ref must be passed along with the push options. However, if the branch is up-to-date, then Git submits push options without any refs, so the server is not given a branch to act upon and the push options become no-ops. This means a user who does the following $ git commit $ git push -o option remote branch # Performs option will have a very different experience from a user who does $ git commit $ git push remote branch $ git push -o option remote branch # No-op The latter could easily happen when a user forgets to add an appropriate option on push, but could also happen intentionally when a user wants to back up their changes to a remote and then later chooses to submit those changes with a push option (e.g. one that creates a pull request) to the same remote. To work around this issue, the user needs to re-write history between the two push commands in some way, either through force pushing a temporary value to the remote or by amending their commit to change the timestamp. Either can impact users who pull from the server, as well as automated systems triggered by a post-receive hook. With these potential side-effects, this workaround can be a bad option in some setups. This changeset proposes to address this issue by adding an option to `push` and `send-pack` that, when specified, will send refs where the old-oid and new-oid are identical - instead of silently skipping these refs. The first commit introduces the `--send-up-to-date` option to toggle this behavior, while the second commit updates the commands to output an `(up-to-date)` notice for each branch with an identical old-oid and new-oid. Notably, the `--force` option will not send a ref when the remote is up-to-date. Chris Lindee (2): Teach send-pack & push to --send-up-to-date refs Add transport message for up-to-date references 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 | 3 +++ transport.h | 1 + 9 files changed, 32 insertions(+), 4 deletions(-) base-commit: 3c2a3fdc388747b9eaf4a4a4f2035c1c9ddb26d0