From patchwork Sun Mar 10 18:42:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Lyles X-Patchwork-Id: 13588168 Received: from mail-ot1-f42.google.com (mail-ot1-f42.google.com [209.85.210.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 AEA153A8C8 for ; Sun, 10 Mar 2024 18:47:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710096427; cv=none; b=M3/a5fkfRJZV24f3UqVyNjKr1pNL34SY/USOJ8n0YPgtTP71wIeH+0xeAtNpeoJayoMafkzhGeJjDpJO1V8JxCSuEBKFiZOsWsvCKe5M4OBrTA0CjBs6pODDHZirtCnBbfEd+YJNDBRoQT901fPNKbkPzgwrYCd346gp7xQBs/8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710096427; c=relaxed/simple; bh=mnn23Px3iME41iR+wCaWjfwP2pi7RdfyKu+EOPKgXnQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qYAjnV82KRmzq4cfFQksxbnfIJRm0BxIXvuCsEO4zYsYQ/Kdts7LUfEdvYx1Mac+TPwK8ucwenJSCYOW2Y+AbpIg38JD9/j+IBsxFGTt/oVEINEA+1sMfZRfINs3VxDC30eyTOHBH0RrO+vz6vAhA10ABFL7DhHfwks9grxLwNk= 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=fej7y01I; arc=none smtp.client-ip=209.85.210.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="fej7y01I" Received: by mail-ot1-f42.google.com with SMTP id 46e09a7af769-6e4e8be9c85so1859004a34.3 for ; Sun, 10 Mar 2024 11:47:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710096424; x=1710701224; 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=RcbP4Zzt4o2xDMKv0SidjS77/NdcCcat3aXSsqCAgrw=; b=fej7y01I1B4Jq5EaGSqOrSaA1mTbt/5OPRSsj3WH+aocYurNCLm7qfDw1EAiKo6y0F SjAYdXEd3Tx7Nh0VmnL7z6xzNED9kRh6Cs8knroo35SHc+jIP5ARcyvfPhi1sQ6QcfWA aFRX0hGp6lXdoyRsQX27uIOIrzHCJ1p7lF4zJUJjQkvHuAHbiFZyEfaTsJwNsdy3Pcs+ fIDRxSeNP7o1CqyF/ofAbNUyXHB0CCWgnL5hAPIJfj1/Zp4IQsYOtSxet5rtEG49cgO9 /KdyX6McKo5YDkuV0cdGhVPT89YH8eUbQMM+uHEWv0wKmDPE9fg/R/HHAwqiENhkdeZZ 0u0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710096424; x=1710701224; 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=RcbP4Zzt4o2xDMKv0SidjS77/NdcCcat3aXSsqCAgrw=; b=rxupLpRB42UXEb93JaSz+AmoBDVqiVu+MKt/miR8hjFnt5RAX6gE7dovIrLjGUtZh1 gVeQ3h7mh57rCqj+v4CW3HxlucyMsb0NFpJhMFcmACSIy3MHvjQIntgz5xGBCMl/tN9s 6e81fmmHwwsOHFlzinCM0kr85KQA04bPJstn3ebiUiXcsDFjYKFgCxDwHncva5bOGOgA CCSsbHyTDPa5iiA9lAcjTTFuD3heFYOlGQDYC+6KMLQwoCRN+ELT8lwAoZz9VltcR5e3 niNV4PLNhxXZlktFbB6F10l9frc+QzIxxsIcBu0z2Dk0CSFhq0B+qdInrcdl49+TmQVO qNTg== X-Gm-Message-State: AOJu0YyDxgJFNCJpZhWmLXfwmlhVhWX2IQ44wFm0oIx2+JoE1mcipLyZ jXdDOrWK5Owsq0mA9qp3umUs7abUgLFAU2gjd8CHiQ7z86K3ZS1Zz9TLMhHycJw= X-Google-Smtp-Source: AGHT+IH+6wmmzlXtt7+7l/P23KKDVQegws4ngFS9ZB0gGdbzk+gChNDsD+xZuTb8SltxldcHqQPPmg== X-Received: by 2002:a9d:4814:0:b0:6e4:e39f:b095 with SMTP id c20-20020a9d4814000000b006e4e39fb095mr5687478otf.7.1710096424196; Sun, 10 Mar 2024 11:47:04 -0700 (PDT) Received: from localhost.localdomain (047-034-027-162.res.spectrum.com. [47.34.27.162]) by smtp.gmail.com with ESMTPSA id l8-20020a0568302b0800b006e4c97ec1f4sm742131otv.69.2024.03.10.11.47.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Mar 2024 11:47:03 -0700 (PDT) From: Brian Lyles To: git@vger.kernel.org Cc: Brian Lyles , newren@gmail.com, me@ttaylorr.com, phillip.wood123@gmail.com, gitster@pobox.com Subject: [PATCH v3 7/7] cherry-pick: add `--empty` for more robust redundant commit handling Date: Sun, 10 Mar 2024 13:42:06 -0500 Message-ID: <20240310184602.539656-8-brianmlyles@gmail.com> X-Mailer: git-send-email 2.43.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 As with git-rebase(1) and git-am(1), git-cherry-pick(1) 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(1) does not have the same options available that git-rebase(1) and git-am(1) 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(1) 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(1) got its own `--empty` in 7c096b8d61 (am: support --empty=