From patchwork Fri Jan 19 05:59:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Lyles X-Patchwork-Id: 13523344 Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com [209.85.219.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6E7A28F6F for ; Fri, 19 Jan 2024 06:13:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705644815; cv=none; b=BPdJJ36d6/g66Rf/rymMPnqiCfd0Rk6H++POORVrU80Q69lunxYQn7y4yadnvD7l5TavCgO/VVrR/H1oQr5L2ivgJtUoqDAzWPESh1HlR695tlw7YnJ0LWqIHEbiLz21l0Bvb5uSrcteLsj+uf6T8fVcE2SA+Bs7DsBqP4saFZ0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705644815; c=relaxed/simple; bh=JbYw8/tCQMM8oDmrHeHqVwSS5J2+YGxyUiA+tnwvZaM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YCByfNeAiJROmjxpWhqWhuk2BJZYuSVEPPrE0snqTD9TbsMeg6F6dN+SKq6XiszcU4QhJHa1p9IEPKOMLqaGtmDBDBGy8Hii6nKbp6gypaabo6ursoPy3PKR6/gJvYXXU2lNEyqraPHX3b4qtm8/t78VRShxW1w9W6Sij9Zt3gM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=TWEIcw4A; arc=none smtp.client-ip=209.85.219.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TWEIcw4A" Received: by mail-qv1-f42.google.com with SMTP id 6a1803df08f44-6817a470730so2554746d6.3 for ; Thu, 18 Jan 2024 22:13:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705644811; x=1706249611; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AM03DHO352yrSOr/SCeIFKedS926D0+8H1PePxSHqIo=; b=TWEIcw4AJxZE23UBHmeW58Lrl1zO9vh2SqsXgsN1jmA0kXU81B7v2q3alhvaukX4JR iiRypMqfL/vDxAnrZp9i6iDO+p6Z7uhGkLIbQhSFSEAi2YsnQMAq42NhL9DyEXeFGSUE AlksZLuGG2b5JGbxVgx6aQGydjdlwt9uwfg0m86gP+7jnevuE9YIfjnXpJcr8HIr6ZEs 1Rxug7j7r0ZfDis687YyBverPCwZi4/MFEZWW/25mLBEU+XmpDsXnbFiWbRoupSvCJGQ Rv2VcSiPja+BNSOJdL8vmDgoo24kpyHlCAr+saMJa60WE6DemFemXb2axPPiTrToapMk aMgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705644811; x=1706249611; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AM03DHO352yrSOr/SCeIFKedS926D0+8H1PePxSHqIo=; b=YVr7zYvmPXLF9OFLDf6bE2CIKggPJpn9y206853Uq0gtlb5kGBa7ilDhPU0eWwNzEf gul6p0B/Zi/VNW5O7E5KTWp0IlDlz21UHdv2d/HrPBmRcpvDQCnVyzU0SS7fRQu+7qFF JuOi8DLcvaLnxcPgmCPSun6+XO39jtbvOCwPS+HxlYRt2q6iR19q8Eyy4mprtcaNByyA bI7XpBuGywQ4BBW2B3lEYVy0zBixJKIICCBrsbM7KIak7pxOkmL+wlYefDMgUREdElWg LXUrqHrNjwyZyUCcEeOghzKu6g/LDtNjvfFig6G0ZmZN0DjIkwIz2NSbK68I+9yyK0XT GV5g== X-Gm-Message-State: AOJu0Ywu7U/fm4fBmixn3As5aEeyof7wLQRcirZWgiE88wBmmRj7PJwi rLBAFIaD4r+RdgT4oh++xmHBNlIDS1fC26G3sCSsnTneyZ0Ck5J9xhzvThNZ X-Google-Smtp-Source: AGHT+IHvkTk5szbxHZFDE1OQdVCC5RPwHQ+S7m9/VQ1QlGzLhfiGfqlwuRXCoU5+p+Rsw2Kv4va/oA== X-Received: by 2002:ad4:5d67:0:b0:681:8873:c532 with SMTP id fn7-20020ad45d67000000b006818873c532mr1926458qvb.52.1705644811326; Thu, 18 Jan 2024 22:13:31 -0800 (PST) Received: from localhost.localdomain (047-034-027-162.res.spectrum.com. [47.34.27.162]) by smtp.gmail.com with ESMTPSA id op23-20020a056214459700b0068189a17598sm1365062qvb.72.2024.01.18.22.13.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 22:13:30 -0800 (PST) From: brianmlyles@gmail.com To: git@vger.kernel.org Cc: me@ttaylorr.com, newren@gmail.com, Brian Lyles Subject: [PATCH 4/4] cherry-pick: Add `--empty` for more robust redundant commit handling Date: Thu, 18 Jan 2024 23:59:20 -0600 Message-ID: <20240119060721.3734775-5-brianmlyles@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240119060721.3734775-2-brianmlyles@gmail.com> References: <20240119060721.3734775-2-brianmlyles@gmail.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Brian Lyles As with `git-rebase` and `git-am`, `git-cherry-pick` can result in a commit being made redundant if the content from the picked commit is already present in the target history. However, `git-cherry-pick` does not have the same options available that `git-rebase` and `git-am` have. There are three things that can be done with these redundant commits: drop them, keep them, or have the cherry-pick stop and wait for the user to take an action. `git-rebase` has the `--empty` option added in commit e98c4269c8 (rebase (interactive-backend): fix handling of commits that become empty, 2020-02-15), which handles all three of these scenarios. Similarly, `git-am` got its own `--empty` in 7c096b8d61 (am: support --empty=