From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fout-b1-smtp.messagingengine.com (fout-b1-smtp.messagingengine.com [202.12.124.144]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5395744CAF7 for ; Wed, 3 Jun 2026 10:06:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.144 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780481196; cv=none; b=DIVF6Ygqh87eSwxpUDQDVV4YE9szhPzbXmbg+rWmwkxP+1oV4grg0MCTLxPHx4HKkcvR1REHN6cimJmGeZuJdmmZ+MHYUlIi8hMFWr0XRxpXvyi+1hYBnw/D0bbsAylZMUhurZBpI9/3UEPAhrM4QJao+SoMefbCHSdzUXmpxBU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780481196; c=relaxed/simple; bh=uWq+JoeCrFP/lohnt1e3xMzoONmphEAX/Q0hwjYqmSw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=TDAPTV13VDUhd5DoEKIAC6E8LzFRWrGk1Oy9RKf6B4YErWc7JaXG9/dASAkOftE4PVg8In7Nv7qivq8wcr7xruVECMOInIaX09b+JKj10jbwG8VvidZBwP4+wsW1elaDBGGPOFC2hCw57a7zt6jH3J//nv++OGjyid2Hpt+sFY4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=mUh/M0Zy; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Lay1i9MH; arc=none smtp.client-ip=202.12.124.144 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="mUh/M0Zy"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Lay1i9MH" Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfout.stl.internal (Postfix) with ESMTP id 72F591D0005E; Wed, 3 Jun 2026 06:06:33 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Wed, 03 Jun 2026 06:06:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1780481193; x=1780567593; bh=psrlC/HesUSo7OwyD+utt2Rq7m2tpdVadMOlYoLG3+M=; b= mUh/M0Zyy21jmUUeMbkyV+pY8OVClKtfOOcE2FgJs/OSi1dgthUQJ+p949d2YO1N mVMy9PLiI42CsO3eaNH2kyjt6HjzovTn+x/0S3EwGkvWYgPW9JsXPSI8en/gwZzJ VSjTfW2ZhbzTSM5svRUhdST/m1j+It8oWQb9Aq31igNrxZm7DGrijhnQucdSMb99 yXU17NdLVyGQCNf/r5UWKW0L7lFGqtKfxkNZS2sakxL4Zf8yBLdo3g2sLzfIeKL+ eDTDJeD2ui+FQRsdcwbf5OnHYfDLg1xYvsylvzu/gsBHEv6XwPzueJavU8w5V2An 0lneNuCmcd9iJBMSK/ahFw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1780481193; x= 1780567593; bh=psr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QFh8yM7ZGZlQj6urmqM3gBWXIy6Ww X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 3 Jun 2026 06:06:32 -0400 (EDT) Received: by mail (OpenSMTPD) with ESMTPSA id 4a600799 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 3 Jun 2026 10:06:29 +0000 (UTC) Date: Wed, 3 Jun 2026 12:06:19 +0200 From: Patrick Steinhardt To: Pablo Sabater Cc: git@vger.kernel.org Subject: Re: [PATCH 2/2] builtin/history: implement "drop" subcommand Message-ID: References: <20260601-b4-pks-history-drop-v1-0-643e32340d55@pks.im> <20260601-b4-pks-history-drop-v1-2-643e32340d55@pks.im> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Tue, Jun 02, 2026 at 09:31:17AM +0200, Pablo Sabater wrote: > El mar, 2 jun 2026 a las 8:16, Patrick Steinhardt () escribió: [snip] > > + original = lookup_commit_reference_by_name(argv[0]); > > + if (!original) { > > + ret = error(_("commit cannot be found: %s"), argv[0]); > > + goto out; > > + } > > + > > + if (!original->parents) { > > + ret = error(_("cannot drop root commit %s: " > > + "it has no parent to replay onto"), > > + argv[0]); > > + goto out; > > + } else if (original->parents->next) { > > + ret = error(_("cannot drop merge commit")); > > Why the if block adds which commit context, but not on the else if block? True indeed, will adapt. > > diff --git a/t/t3454-history-drop.sh b/t/t3454-history-drop.sh > > new file mode 100755 > > index 0000000000..b320ff09b3 > > --- /dev/null > > +++ b/t/t3454-history-drop.sh > > @@ -0,0 +1,513 @@ > > +#!/bin/sh > > + > > +test_description='tests for git-history drop subcommand' > > + > > +. ./test-lib.sh > > +. "$TEST_DIRECTORY/lib-log-graph.sh" > > + > > +expect_graph () { > > + cat >expect && > > + lib_test_cmp_graph --graph --format=%s "$@" > > +} > > This function appears exactly the same at t6016 and t4215 but named as > check_graph. I was gonna do a cleanup for a commit series I'm working > on to bring that function to `lib-log-graph.sh` because all these test > files share that they import graph functions from `lib-log-graph.c`, > maybe you could do it? I'd rather keep this series focussed, but I wouldn't mind a follow up that deduplicates these call sites. > Also: > > lib_test_cmp_graph () { > git log --graph "$@" >output && > sed 's/ *$//' >output.sanitized test_cmp expect output.sanitized > } > > Already uses `--graph` you can drop it from expect_graph() True indeed, dropped the "--graph" argument. Thanks! Patrick