From patchwork Sat Feb 10 07:43:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Lyles X-Patchwork-Id: 13552216 Received: from mail-ot1-f53.google.com (mail-ot1-f53.google.com [209.85.210.53]) (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 6EF8236AF2 for ; Sat, 10 Feb 2024 07:49:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707551387; cv=none; b=CsaOVZZIpoUYjzOEWYG3VfTpCO5blFsWexbGGByZQhxD4SqzCfsgLAIV7ukiydiXaGWdiVcY3eKHY2/OhZaA2yco1QH0OY+kIk3pm5MUkgDGV8FjWF/8r6YYuowvE1QYtQrkupJ9wpFmBr/mUTr1PWJIiLGRFutFe5Z+8iI0kx0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707551387; c=relaxed/simple; bh=LXm2CkngSFQAbgw7oN88w5SDGr6f/papuLFgTk7mst4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eLdozxvdjcansVOkP44AFVOuoxxU2rdZevzo/kfrTvMJ5VUypSghPtRum+HgrGj+yplkO2fLXkTkD/GxSvY1Gp3Gu9ydqO+h4KU1bVcknr52y+hWkuhuxMHnxlRw/drDxVbbShLh/LeEIhKYGO0mOtb618sfhQ8N0dswZLNa/Sk= 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=c2nrEZIH; arc=none smtp.client-ip=209.85.210.53 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="c2nrEZIH" Received: by mail-ot1-f53.google.com with SMTP id 46e09a7af769-6e0f43074edso843078a34.1 for ; Fri, 09 Feb 2024 23:49:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707551383; x=1708156183; 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=Gu1Riqn+fMaWy9vOIAlFdfl2h9HhLgp9wn/NlHr5UIU=; b=c2nrEZIHuObKu/t6QOPICqd8OQ+yZ9ymO8B41Ytfs9j2WGboskAOyI304u6KnnSwD/ 2c+va1pwSfcjTJTEl7jXv4EKopis7qvT+Aqj3TVz9FH4YzTiBE2ZQSjIt2/rFsCSDrNJ DrxxBA/yT2N4kn6bBTCRrNerUuDzMK3Iqu0uMJ/vgurh1KAZMlhD7Dj0zGWGjqXgaWwa FnzAeN6EwqwjOUT5Mg1D851lZCICNpyxPi7AiPl6t00W33+kHWIuDuJqDKBqMTnMsOYk pED1lTa/kA3E9O48YT3f8uKkc+uUyZR2xu8jDVKujCv9BYp3yWh6/O/u0XU9SnXSvnId zsuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707551383; x=1708156183; 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=Gu1Riqn+fMaWy9vOIAlFdfl2h9HhLgp9wn/NlHr5UIU=; b=HMUiQiKeT59sj3KnJ9OLAW4VeEJ0DF5lk1aUhIFP2Hse2hEe/tzfWkY4ImekaB4Dpv i/VCkQkKpB8xtyebHOqiBjEtSvONEYMHCYN6+NdjadeLtJ3D/FyrNA8XGaM7WcZ1pewG vJKnCyv1pOCEgd6PzjXBajUhaHyX3fVTSb4DJeKgBgEI1QPJbamvBwE9lgJJpK2ww0Z9 BxwgXNCX4JB7ZfeicU5MXA+8xeysWYGFrq2H3LFt29020CebFVqVKXRyX5ht4x7dxWm8 pz7aRRoptYa44XRoEHPF66vGYzNacJtMhBqT67wQNih9BTrxLVy/u3pJEnHzzWi2eG6E SlVw== X-Gm-Message-State: AOJu0YwbObxQf+QMUDzq5r7V9P24bPK7pc47JO+RdgywKHvB26ALOVgF DSNJuWpScZi/IrIND6CU4pgZQqs38lFBaLBJb5wtDsM34xOP4TFn78ECjV0iFb4= X-Google-Smtp-Source: AGHT+IGj1gyBzXTIQ7v+4cUl37ifXfr4G3BjJvNMQq6UvSWgnxsie3DWSxCmuRPf21+l6UCWUmD2dQ== X-Received: by 2002:a05:6870:2247:b0:219:1dc6:fdff with SMTP id j7-20020a056870224700b002191dc6fdffmr1415352oaf.55.1707551383538; Fri, 09 Feb 2024 23:49:43 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCV926tmqP1xtJeRydWpYfsxuf7hK5XgL9Mw/AQ3//2DptkHlQ5oX1Ubxg4yblgrszmhKCK/n29aohiioLhyIiuxb//ue73PN/nJY+PGyEaMZbka0iKVdF6k8iE/8fkJZ/qmNP2mqsgPmS56krPPGWfsI3oSnlwekYooKl7nJMIU Received: from localhost.localdomain (047-034-027-162.res.spectrum.com. [47.34.27.162]) by smtp.gmail.com with ESMTPSA id v19-20020a056870955300b00219fd9e3194sm310028oal.7.2024.02.09.23.49.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 23:49:42 -0800 (PST) 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 v2 8/8] cherry-pick: add `--empty` for more robust redundant commit handling Date: Sat, 10 Feb 2024 01:43:56 -0600 Message-ID: <20240210074859.552497-9-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=