Article View: linux.kernel.git
Article #3704Re: [PATCH] sequencer: reset saved HEAD OID when picking onto an unborn branch
From: Junio C Hamano
Date: Tue, 24 Nov 2026 14:54
Date: Tue, 24 Nov 2026 14:54
54 lines
14871 bytes
14871 bytes
"Wonseok Oh via GitGitGadget" <gitgitgadget@gmail.com> writes:
> From: Wonseok Oh <marinelay7@gmail.com>
>
> When picking multiple commits, "git cherry-pick" stores the current HEAD
> in .git/sequencer/head for "--abort" to return to. If the branch is
> unborn, repo_get_oid() fails and leaves the object ID uninitialized,
> but sequencer_pick_revisions() saves it anyway instead of clearing it
> to the null OID that sequencer_rollback() checks for to report
> "cannot abort from a branch yet to be born".
>
> As a result, "--abort" errors out with "Could not parse object" in my
> master build, while in Debian's 2.47.3 build the uninitialized memory
> happened to hold the last picked commit's OID and moved the new branch
> there.
>
> Clear the object ID to the null OID when HEAD cannot be resolved, and
> add a test.
As Phillip mentioned, the commit message can use some clarification. In
addition to tightening the first paragraph so the relationship between
oidclr() and sequencer_rollback() reads clearly, the second paragraph
frames the symptoms around anecdotal builds ("in my master build" and
"in Debian's 2.47.3 build") instead of describing the general
undefined-behavior failure modes. And the final ", and add a test" is
filler that does not add much value.
> +test_expect_success 'cannot abort a cherry-pick sequence on a new history' '
> + pristine_detach initial &&
> + git checkout --orphan new_disconnected_seq &&
> + git reset --hard &&
> + test_must_fail git cherry-pick base..anotherpick &&
This cherry-pick will fail at the very first step. HEAD stays unborn
and the abort-safety file would be empty. Even without the code fix, if
the variables on the stack happened to be zero-initialized, doesn't this
test pass by coincidence, or fail in rollback_is_safe() with "could not
parse abort-safety" rather than "could not parse object"? Perhaps it is
a good idea to check how the command fails and with what error message,
not just having test_must_fail to make sure that the command dies a
controlled death, plus validating that the sequencer/head file stores
$ZERO_OID, to harden the test?
> + test_must_fail git cherry-pick --abort 2>advice &&
> + test_grep "cannot abort from a branch yet to be born" advice &&
> + test_must_fail git rev-parse --verify HEAD
> +'
> +
> test_expect_success 'allow skipping stopped cherry-pick because of untracked file modifications' '
> test_when_finished "rm unrelated" &&
> pristine_detach initial &&
>
> base-commit: e1ec09b23c8e0deb21a0b95ac5996422277395d4
Technical Details
Message-ID:
<xmqqh5h6wa9h.fsf@gitster.g>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!git+bounces-76221-linux-kernel-git=dewy.ruReferences:
<pull.2317.git.1795242633923.gitgitgadget@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!git+bounces-76221-linux-kernel-git=dewy.ru From: gitster@pobox.com (Junio C Hamano) Newsgroups: linux.kernel.git Subject: Re: [PATCH] sequencer: reset saved HEAD OID when picking onto an unborn branch Date: Tue, 24 Nov 2026 06:54:02 -0800 Organization: Usenet Network Message-ID: <xmqqh5h6wa9h.fsf@gitster.g> References: <pull.2317.git.1795242633923.gitgitgadget@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Info: usenet.network; logging-data="4162547"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:KX5eAVLPfozHFco7Yt7rgK6sYuo= sha256:KpRHP98bs6DGMqR3uIHNnmQ+wuATksHPnznjbVHn+Hs= sha1:fNQfI5jgKS82iPtPzTkl2zmoFaY= sha256:H62Ttx0Jsct1rJryb/IroOCXU4STUxbWrparWIOv2Cw= List-ID: <git.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 4A004125E1A; Tue, 24 Nov 2026 17:54:26 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.051 X-Spam-Status: No, score=-3.051 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=pobox.com header.b=P7syKGDL; dkim=pass (2048-bit key) header.d=messagingengine.com header.b=cfx7oC14 X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eiGDReJciwmb; Tue, 24 Nov 2026 17:54:22 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=git+bounces-76221-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=pobox.com X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 59CDE125E18; Tue, 24 Nov 2026 17:54:09 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 0DBBE33932; Tue, 24 Nov 2026 14:54:08 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795532047; b=yfgWX/JuIaai4Ws4fENgvNH8XMRUbHzvubHYcSFitQ5d2HeuOClk65+GhtVVJiJCFhi7 wUJ0xKjYqt1z7DSekby+A8s9PHppOBV5Ae+2VDu43aLFRmrgpD2Fwzk8vKDF9iBA8/BJA O9MJInKsXOjxIRC3v3XC3z4noEoee7/5HAWF4eZz7wHQcIrlhEXGiNWR3ysNIQ2io+hk2 s068HZJZ+YZ6mzAXDt7BYsZQZT6bf+CHASjiuYya6nFTFk/iuguR8AFdPfQO7Oki7eGtE +8j1wBQOYmB/Ywmw5hWACdHXhAEjVRBzptBw4Y1wFGG2mSAtuwsZAYYY5iSHv7miVaw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795532047; h=X-Original-To:Received:DMARC-Filter:Received:Received:DKIM-Signature: DKIM-Signature:X-DKIM2-Info:DKIM2-Signature:X-DKIM2-Info: Message-Instance:X-ME-Sender:X-ME-Received:X-ME-Proxy-Cause: X-ME-Proxy:Feedback-ID:Received:From:To:Cc:Subject:In-Reply-To: References:Date:Message-ID:User-Agent:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version:Content-Type; bh=N71SIE9mO+LsFoIZzp9im/biwFiSQK+RANGV6khL+1c=; b=BOBE3XBWnYpG7YMB6/HRor1zv+cLb7c29iZ2r1pyj4fQVEit224fkZMvzBEvsMPxeqeA 1Dzu7JRMcQEX3ZMy1u3Jr1zb9xv7lTtc424F2/Va7rC7W3LbVUpffxgpjM/s8c9gnZwHQ /7/RvlidFgZrYvCClMMBk0FaTbNi0XWcMJUvX7At+6H3wpBe8RfiiRGu42wUKQbNxiA4c g5PNqIZe6P0zF2NpcvndLrIKX5OlkUuO0ObaoAAyn9jN59fqZEvLnzODR2WqpZlanvEnJ /PvSxVzpPQIq05T48zhqj2eILjckDM9uvybGS8h4pKhChmyu/AEMiSKlofxm/uxOx1A== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=pobox.com header.i=@pobox.com header.a=rsa-sha256 header.s=fm2 header.b=P7syKGDL; dkim=pass header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=cfx7oC14; dmarc=pass header.from=pobox.com; spf=pass smtp.mailfrom=pobox.com; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6336D606A32C; Tue, 24 Nov 2026 14:54:07 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=pobox.com header.i=@pobox.com header.a=rsa-sha256 header.s=fm2 header.b=P7syKGDL; dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=cfx7oC14 X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=103.168.172.144 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795532046; b=xWztjUzLao1Plh4hOMZ/8y4OnNG2xezsoml5RmUfI/dSVxA847Kqp+zuTnN3sUS8fW5r oAQLCFewWeDSW7LiyN+/duOqJpeGoRuzGOMM6L7MncIMCnOrKggp2gtfFZNccAYXK7Y0Y Xn1loxVITbiR06iuXZf5dyM0QEE+yaAjU0vB+/BX3CAifHk8Acy4pSnhb37e3/sbsORr9 cqRgNz8y3Jr77e7J7BFxAeVxxaCeDoQUl/coszfKZf+bZxVjmsFXia0PZQxcrIepwrCv3 cJ6hQ7pKUuI8JAByc73olleSnlC85+AhDxOsPiAA6IR4qZWluPll9k9aXvmfyiqKs9w== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795532046; h=DMARC-Filter:Received:Received:DKIM-Signature:DKIM-Signature: X-DKIM2-Info:DKIM2-Signature:X-DKIM2-Info:Message-Instance: X-ME-Sender:X-ME-Received:X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID: Received:From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: User-Agent:MIME-Version:Content-Type; bh=N71SIE9mO+LsFoIZzp9im/biwFiSQK+RANGV6khL+1c=; b=2upfUaFg+YbbqN4MNkQ0ncTB2mrBUmEPS2K6QzJHn6dRAX6G4UdTqrqQKzlOJTPLMs9J z/q/SftwzUsY1Oj1pNaN864aPBQgcdYDwmSg0SVzaJRBww8FNMPlI2rhmnOkoGkPhI3GN /x0sJVdsqy6NaaGQLHmfJdpVJxaOkIK7lBbKcbC59jzBIux0G0gEOqHyAiYHTwXam6PZ5 3HDiGKCAmabGceGW70zWjaVyjBGORv6B55E3MJ6PCryVKOAQZI5FagMplVwmF5iDTgZMN BOc56RH0r7sM3Tn9kE8nxwxqKs+UcF5eXHmKH20BwCY5N3NyMiVlBwDfb43dzvl+0RQ== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=pobox.com; spf=pass smtp.mailfrom=pobox.com; dkim=pass header.d=pobox.com header.i=@pobox.com header.a=rsa-sha256 header.s=fm2 header.b=P7syKGDL; dkim=pass header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=cfx7oC14; arc=none smtp.remote-ip=103.168.172.144 X-Received: from fout-a1-smtp.messagingengine.com (fout-a1-smtp.messagingengine.com [103.168.172.144]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F6E7606A31E for <git@vger.kernel.org>; Tue, 24 Nov 2026 14:54:05 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 0F6E7606A31E X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pobox.com X-Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfout.phl.internal (Postfix) with ESMTP id 373BFEC097E for <git@vger.kernel.org>; Tue, 24 Nov 2026 09:54:05 -0500 (EST) X-Received: from phl-frontend-02 ([10.202.2.161]) by phl-compute-05.internal (MEProxy); Tue, 24 Nov 2026 09:54:05 -0500 X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pobox.com; h=cc :cc: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=fm2; t=1795532045; x=1795618445; bh=N71SIE9mO+ LsFoIZzp9im/biwFiSQK+RANGV6khL+1c=; b=P7syKGDLpUjnwARqVLilTovr3H A14b3cRzTXvD08WC19A9DAKS0aGVqTIT1TZ2dvtjhlHumOiXHRWCddoretFGaUUV mkX83OVQenGsWiIq6cx7UXyVwSYXmH+bQgPhCdDpzd7JyMNujNwqLzYjcB27yMNr BCZSBQDzn/cSZo8EnUwvx5807nMFNaf2T7owjrjj5YtjY0X97bqoCr0bnmUvz7qs vpUYEMlQfHKQSnGm7EnXDOlCoF+UQKByvtY56tbJfq40vrFRAZU1EvuLXWWaVbVC JvCeY8mqJFpJ8JR3F3CGiuXd9g1m0i2Oru1CdeiMAuUadjWVVQh5hRIF13Dw== X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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=fm3; t= 1795532045; x=1795618445; bh=N71SIE9mO+LsFoIZzp9im/biwFiSQK+RANG V6khL+1c=; b=cfx7oC14E0d+14GL2IvYGjpTG8MVYrSOnINAadlzksPj3DGcm/K 6FOGL+4eCApd533JcD44+fzBu1XDgE+yuPl5dFOzXMXuqUVEMfErEVKAhQML5tuk yRmN8z03GYzddstdGE+k7f3YryrRB626f7siDhedNH2Yeh3/vYx2xk6vu5WU1zww 4bOZN2rKxDbQgvcHeVqH6MpQmOBZLT7Kow3PqRay1p/a3XeWvuAhIO3cHGSbPJ3u DvZrhFKtT/55W1OTBfiIolrZq66NMp+JjNJ7nq5bx8y5N+QOfm5m5yWan3xtYYPg BcaJ5z/s1RDE+eryBAO/oiPiHRueqH1UweA== X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=sign d=pobox.com a=rsa-sha256; X-DKIM2-Signature: i=1; m=1; t=1795532045; d=pobox.com; mf=PGdpdHN0ZXJAcG9ib3guY29tPg==; rt=PGdpdEB2Z2VyLmtlcm5lbC5vcmc+; s=fm2:rsa-sha256:F1eDTeOwl74dZGLfC9zjtcJH+B52ShZBfvzcPsA0cJC0xsT 3OiBqBGTyR1ym/K/Ta5KBCcvLwy6zWCdn3L0g3PvKujP3R5Dr0tDj6tiCTXqcmr2 FJ0HsZonf0iTgSXgXI0gZSkYttYzLDFXvzoPutJuxmVTNBDiaYOldVALkuK7A9+1 9DPag3vUs9jLQDQjyuC29a8EYUlBiNtr5MM3YqQNN5PmIsjcdi/Wn6clx9reRDnX YE6gsNx6d42rvY2qg1E3dRhzmHcTdFthnZidQMB4oJ3OeViGpiFD6968O3FzIhXR eJqm0DIfu2Z9Ro+8YBiyvim+nKsezJlFlu39JrA==; X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=mi-m=1; hc=12; hn=cc,content-type,date,feedback-id,from,in-reply-to,message-id, mime-version,references,subject,to,user-agent; X-Message-Instance: m=1; h=sha256:UIb9u0B39xAO67bnnkl+PEw2+nvao7BiwNvBKbD/wms=:i2gVszpxW9MYaiVCdq7JOPkboH44IniYbGZUuKm3nkw=; X-ME-Sender: <xms:DKUFa1-vIDl0yiF0W1D5iVQNa3OTuAW4VPa1RAdeJn45rYPbNRBALQ> <xme:DKUFa7Mvr0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xLFjHWnK_sClFye_3EwIREB5pQADsQxwVuyh6iggrlCLCXzKA> <xmx:DKUFa1lvWRe5dXMYb3Geyem_uo2Ew747GaRP0hemuzFRaxXJLCMrNg> <xmx:DaUFa7rro4vrm0VPs0gbtn5-DUvEbyTRpjS-BF8L30fYn95D41k_PGLB> X-Feedback-ID: if26b431b:Fastmail X-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 24 Nov 2026 09:54:04 -0500 (EST) X-Cc: git@vger.kernel.org, Wonseok Oh <wonseok_oh@korea.ac.kr>, Wonseok Oh <marinelay7@gmail.com> X-In-Reply-To: <pull.2317.git.1795242633923.gitgitgadget@gmail.com> (Wonseok Oh via GitGitGadget's message of "Sat, 21 Nov 2026 06:30:33 +0000") X-User-Agent: Gnus/5.13 (Gnus v5.13) X-Mailing-List: git@vger.kernel.org X-List-Post: <mailto:git@vger.kernel.org> X-List-Help: <mailto:git+help@vger.kernel.org> X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:git+owner@vger.kernel.org> X-Precedence: list