From patchwork Wed Mar 20 23:37:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Lyles X-Patchwork-Id: 13598283 Received: from mail-qk1-f182.google.com (mail-qk1-f182.google.com [209.85.222.182]) (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 B8C4B8627A for ; Wed, 20 Mar 2024 23:39:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710977964; cv=none; b=cJkyvbSxOwcV8vd0oxi374pXdrKLA/gxalRf5m0iMSir27WzvIp+xoo22SYYbG0d7o0+11L4pDmyTgxZa5L/3ymIZhj3XTVHjht9GE/2jBojGPlDfUo9to31GMwalMW/dAdd1QDRXg/88on97K0DFaUIqSBSCFCT+93x7Z6c0Z4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710977964; c=relaxed/simple; bh=+UCX0H73ME1tPbJUTHQiOIALqDXOKmpSuSgPgnZSQKA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=J7/YFGgDS6sn5j/gxD2l+x6Au4qNB8lPK0pCH5ckYm2+BrWP5kQGn3GA1OWMYgkWTZ5NqGOpbPUInPYVftopYqGpm6nLIKgDPH8QC58W4aCk2xgsDkGrAZVEOfAc4GCxSQ6bBtHssEH4M3cPpk3+ZnkA+YT95ymnT7xH5bNaPIU= 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=CiayaONH; arc=none smtp.client-ip=209.85.222.182 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="CiayaONH" Received: by mail-qk1-f182.google.com with SMTP id af79cd13be357-78a26aaefc8so28312485a.1 for ; Wed, 20 Mar 2024 16:39:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710977961; x=1711582761; 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=hTe5nnuPRpf28rxTb5fSFuPC2Vt9Qqei4RIDrtO47z8=; b=CiayaONH80FbXImZUj+Vhnct55CQ/H+sOPxk1NyiUCyISYzC3cVoMCMF7e6dnhqlpV 3yt2bzP3NfP8Qda4iOHVtthKxk/sxhPV3cTa1afHLqgWrmJzzEnU+vneiHZrybBWoohD FKKVrLUnfF+GNL6hM3IwvoX2FDDmIstOjd08JW7NQTlkn0n54UvU3L9Xme55yK/VtPJM wU3Dp+rVARP8vqw4T2l7KYk+buo4or9BZj/SWNF0Ne69xX3YDsXThLnf0iWYkhpl4trA 46LWdWroT11CtyP2nPtyEP/T0iJaoG+OnaFNCMurKg+djacqDs6/nNgSTWSqcpuL9DQd 0WvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710977961; x=1711582761; 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=hTe5nnuPRpf28rxTb5fSFuPC2Vt9Qqei4RIDrtO47z8=; b=Nk65bBK4O8id7ATMVUMQf6E/WiUN7zgTE03j1IiYNHCcWDYu8x/L7vdMnGr1duFcWo BdcuiRVUSvPntLNRBgdhOAl+lhLPbjDUv0umRW5MSB2Adaqy1uiXFJUloKgXHwU8zVaZ +k5S3ll21M3R2XODSX+X5SuZlMlQFhcEihuZg4stLbJemOgCH4sfDFFy60ou2bvsBIGI rOcMMmPn8k1u8e9X/Lt7qmyYhpCDTvIxfJ2Lt23b9cyro/Pf9Z2gHssshEgIQck1GBY+ g4xaygeHG5Ixpzg/fW9jMSJIn0rpAlsV9MAe5YI0QF+oQvuARZbrTdv0c/VG7zwYtKlJ aJcQ== X-Gm-Message-State: AOJu0YwDTe2k4Z35AvyGJiJ/pxfS+GozpXqMm7/1pX5N9tho2gDxc/ji 9PNykuxM7Rj1LBFl8uhlzZ9yIecYaBwEm9TPvuTITKvv4LYY5JrBE1snKtcdskI= X-Google-Smtp-Source: AGHT+IEoX9LsbT4xyytAmtRCK2ntrDn18Dl5g4GSmOlmAaFL1+O0v7BcSRqJPhevy0hE6u77SdCUxA== X-Received: by 2002:ae9:f311:0:b0:789:f776:82b1 with SMTP id p17-20020ae9f311000000b00789f77682b1mr6674243qkg.27.1710977960804; Wed, 20 Mar 2024 16:39:20 -0700 (PDT) Received: from localhost.localdomain (047-034-027-162.res.spectrum.com. [47.34.27.162]) by smtp.gmail.com with ESMTPSA id v18-20020a05620a123200b0078a0edbaa94sm2400867qkj.91.2024.03.20.16.39.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Mar 2024 16:39:20 -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 v4 7/7] cherry-pick: add `--empty` for more robust redundant commit handling Date: Wed, 20 Mar 2024 18:37:02 -0500 Message-ID: <20240320233724.214369-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=