From patchwork Mon Mar 25 23:16:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Lyles X-Patchwork-Id: 13603164 Received: from mail-oa1-f44.google.com (mail-oa1-f44.google.com [209.85.160.44]) (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 A30A783CD9 for ; Mon, 25 Mar 2024 23:26:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711409165; cv=none; b=EfwLMgqfTvUQtDPBQMkXvYSYAjGlsycfD0xx+f9pQxEM65xDjrK7huMsXjTdBPFXDg9rMATrzq4lZohCYf+UxJPGJnxQeIrLbOJYKkjIet+R4paG1veF/pakqqonimkEBmNxkg/EpGXXJmWm8KAzpvJQc4BGnuqgwlr8K2SrBz0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711409165; c=relaxed/simple; bh=ucKrMg0wDux31H9mhEcggaTKBtbIowT+k00sBW2tpjs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HsRRn4c8RdJY8OeOOqsTMYzSBDBkup+VMmwfsvZCWwgHqt0/o2MQKtS5Jm5A5f4IQlcMeg6itfUnte3ZfZMxYJMx3CVRv+wmzJB88g9no11RfKuHCHPm4Bkvz56T5c7jxwFDRjDGokvCSo0TJEQ6KE+YPmZDZFaTzDkV2DFH3EE= 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=ZX8d3Iz4; arc=none smtp.client-ip=209.85.160.44 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="ZX8d3Iz4" Received: by mail-oa1-f44.google.com with SMTP id 586e51a60fabf-22988692021so2086171fac.1 for ; Mon, 25 Mar 2024 16:26:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711409162; x=1712013962; 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=h5y4EITr3qbAPjn085Olt1drrfSlGPcO5RESN90LFv0=; b=ZX8d3Iz4gizGYOgRNaJM0kpIxj8uIlPMLhoQk9i4O5ZUpfVAOocioYGPeICyojvU/s H6z3FcEkq6e8f8uQRV1HEDXsDPdQAVufW742kilKnnuXJ8/lWIGhsIC/oQrp5vMbvZP6 8Q2qB7HB8fmvPuD89bl50EekTKBGWcwc5v06jN6JLE3LsPIvMwnNINWeCmVeoLuPyUHw I73BTCmx1J6X2blBIVwdR3euqV1EtHR7tLnoAcaTD8aVER0xJgkqcklW66zc5sR5ms7w Ytzt+pOEZiRpAYhcqxjuBeDxAe8ONnffVUhMZTYKr8EenRvWfxBtySj261uiyk6c5i/F Q47g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711409162; x=1712013962; 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=h5y4EITr3qbAPjn085Olt1drrfSlGPcO5RESN90LFv0=; b=fcMUQbvBbIDGt0Qd/x8OdVFNzzR8fcRkO8MeY3rvY+Dymw1DR4laIG0TsQthHab7pk Of9yRfHb4c+POlgp+u0TX401UHBGnaNxERMei+8o8LAFXZI1hhYB/tGRnxsrwCcQLNXM 6/kh219S+Xulbp0IeMoM2fBRBuKgIgERzPUrFkw5PM0meHAXh0VA/BHCV8szWwZ4qXup H2IwA/D0fFjsTysojn9OMnu7U2qvS12PEeuLI2LZyGz12/nzq+2m28fv+2n6EHxE/kc8 +fBtm/OCgvSMoV+CNSym12nvnqCL4Q7RctU/XA5jzu1V6U0Dktw78NZyxLr8gsKuWIv8 hqZQ== X-Gm-Message-State: AOJu0YywOC4P8Cc39QisBr80MWjqU2PyWS1T419yCdZkaFFVeNOAnEqD 8K1/ygJhko3sOZrQH7NqDcsU/JVN3tG3o72AV030POk/f7BXLlkB1yj0OSV6GGs= X-Google-Smtp-Source: AGHT+IHQgWplrYsXlLP6x8UjUnGuunLi67z4occnTPbBJjYCetspvkYOzTkjYDOqOkg0gJnGykrJXA== X-Received: by 2002:a05:6870:7b4a:b0:22a:3226:b10a with SMTP id ji10-20020a0568707b4a00b0022a3226b10amr1994818oab.17.1711409161763; Mon, 25 Mar 2024 16:26:01 -0700 (PDT) Received: from localhost.localdomain (047-034-027-162.res.spectrum.com. [47.34.27.162]) by smtp.gmail.com with ESMTPSA id vp8-20020a056871a00800b0022a1d794bb8sm1454868oab.22.2024.03.25.16.26.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 16:26:01 -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 v5 7/7] cherry-pick: add `--empty` for more robust redundant commit handling Date: Mon, 25 Mar 2024 18:16:54 -0500 Message-ID: <20240325232451.963946-8-brianmlyles@gmail.com> X-Mailer: git-send-email 2.43.2 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=