🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.git
Article #4312

git-history-squash feedback

#4312
From: "D. Ben Knoble"
Date: Thu, 03 Dec 2026 22:03
50 lines
13267 bytes
Hi all,

I've cc'd folks from the original "history squash" thread [1] as they
might be interested. Here's some feedback from my first time using "git
history squash" at work.

[1]: <98a1b756bcf13cf47f71141633df57dd1336aaed.1788900119.git.gitgitgadget@gmail.com>

1. "git history squash <base>..<tip>" might complain that the revision
   range is empty when it isn't. Consider the following diagram:

                        * D (HEAD)
                        |
                        * C
    (origin/main) B *  /
                    | /
                  A *

    When I run, for example, "git history squash origin..HEAD", I get

        error: the revision range is empty

    but "git rev-list origin..HEAD" lists C and D. I haven't dug too
    deeply yet, but I suspect something in resolve_squash_range() is not
    counting right or not checking the right condition?

    Conversely, if I give

        git history squash $(git merge-base origin HEAD)..HEAD

    then C and D are squashed into a commit with parent A as expected.

    I think this is a bug?

2. The editor presents the list of commits with comments like "commit
   message number <N>", probably from "add_squash_message_header()"; it
   would be really nice to have the actual commit IDs instead, so that
   one could (for example) examine the exact commit directly from the
   message editor or from another terminal with copy-paste.

   Fixing this probably takes a bit more plumbing and work, and I know
   the message design got a lot of feedback originally, so I'm mostly
   curious what others think on this point.

Anyway, once I got things working (see (1)), it was nice to be able to
collapse a mess of commits down to something sensible in one shot!

Thanks,
Ben
Technical Details
Message-ID: <CALnO6CCOyVX_Setv4fy3sUnccQn889dHhUa=NyoOLyXbe768XA@mail.gmail.com>
Path: mbox-mo1.pugleaf.net!news-fra.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!git+bounces-76969-linux-kernel-git=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-fra.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!git+bounces-76969-linux-kernel-git=dewy.ru
From: ben.knoble@gmail.com ("D. Ben Knoble")
Newsgroups: linux.kernel.git
Subject: git-history-squash feedback
Date: Thu, 3 Dec 2026 17:03:13 -0500
Organization: Usenet Network
Message-ID: <CALnO6CCOyVX_Setv4fy3sUnccQn889dHhUa=NyoOLyXbe768XA@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Injection-Info: usenet.network;
	logging-data="2609080"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:m4HZr8SGBLYyRgOHgwstMZnh4jw= sha256:0T5ITEynccjytd8/jH0jSVVYr7AcHGFEVELDxraeEu8=
	sha1:9I+GyWdYNJD700YXthYrZe22AkU= sha256:7wdWeH/Bl71mwGjP3cDDOxaJrKbATRPRzG508yj0dwc=
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 83138117A4A; Fri,  4 Dec 2026 01:03:39 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.197
X-Spam-Status: No, score=-2.197 tagged_above=-9999 required=6.31
	tests=[DCC_CHECK=1.1, DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001,
	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=gmail.com
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 EwxNMHFRoe8t;
	Fri,  4 Dec 2026 01:03:37 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=git+bounces-76969-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 28927117A26; Fri,  4 Dec 2026 01:03:29 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 7BFE92A710; Thu,  3 Dec 2026 22:03:27 +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=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1796335406;
	b=RwF9AHhzNSLidK+zW/1M+VQ9ejFbGgvrIXtyZ4YdvBVRP2puy9MsFkIuJVmft5y84zI2
	 n0nHGat/7NWV4llcybumYNDISDHyM0q8slTU3xHjCjqBtZvsEEvm6hbC4bCIDx8csqz2o
	 UrlGi3LCAdYQ5GTSP2NMCZ7BJFJBEgwJdpPLgl8keSgrJIcFgKZlP+7PnNUBo194Ik6Yg
	 Je6fMBjzriWtCdvSc+7fjFJX+uBcDGlFxlDBCicgQ+4FnIhClH9He6+9S7Hdci/Bjt8H+
	 txyglnHUWXsZtkQfJea5/jzKKh5OKkN4QxJbfzUWx/B7Wjw1edZ99JRuL4np+FrbG9g==
X-ARC-Message-Signature: i=3; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796335406;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:From:Date:
	 X-Gm-Features:Message-ID:Subject:To:Cc:Content-Type;
	bh=5sSPdgOyoO0i5BHIIM4g+X0jnw6pzWEPFMCheKCLsAo=;
	b=Nc0Jg0H+DlawQAq4dL3HvO/1fIAH0A4dz5XwUwGap7PXTg9/gG8RfEUpGQiSluN0rZo6
	 aDnge0BTEVFRHzKiGReHQwNB4qyH0tbosM3JEKgBU5i7VMCtz8oDKvkeskCm2e2m87srf
	 oNwBvJs5WwjSeWhHU24AF3Lq9MWbz2YTfrWtP4q8Cr2sVmqdGIznv9dh6Xs6rUL+f6J05
	 xP5ClscKNJFu1u0ltibhy/AaMVwhZbpWvSe0aDwejBXfz7sdaLMs14DFt8w0fJ5uTmywj
	 BMgjZq2SaLSAonFyPCgHN0nCBWiZIHt4805SD96/6jv9Hk/steC9rmPyHmVN8oBnGVw==
X-ARC-Authentication-Results: i=3; smtp.subspace.kernel.org; 
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=SGfbu6jb;
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.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 D7D5F606A333;
	Thu,  3 Dec 2026 22:03:26 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=SGfbu6jb
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=209.85.215.172
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1796335406;
	b=ifbG4H+CEKxYxOkoguFWRJ8IYQ6gbFt019O565fmoYMFZnB54y/R/CkjJ68FJ/FoPhf6
	 BkzyjSdWcz4FesLjPG+TEl9G9No7jxN/qAFD5VxsWg2sgQIpBhkryLHHCM+JClKt2qpAU
	 ost2PyAMVzwOjbePDiQhqhgjCV9dNxLao2F//MV/vSOJdYf1NS+SzDJSrtSQdMM4UnZ4K
	 06k6PtXasX8SglmrJ/G7byvGp3YYXNsZAayIw/23TNe9RPoDXaJC536kcZeLQtQDjlh3i
	 i1zqt7PdR5Co3R1I+nKHc3QsuyZ1SjkuR/s0LikF9yh98FAOR344XKvJZ4LUtzdHB6Q==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796335406;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Gm-Message-State:X-Gm-Gg:X-Received:MIME-Version:From:Date:
	 X-Gm-Features:Message-ID:Subject:To:Cc:Content-Type;
	bh=5sSPdgOyoO0i5BHIIM4g+X0jnw6pzWEPFMCheKCLsAo=;
	b=luA025EV2H43Qon/jkadY3NePsPEIqTGaXag3wutxfK9MZS7cUNnZk+RO/y3e6RLOCzB
	 yaDd1MtndA1AumTfUH7jlyExGhQLLsLv9SklMNnbk+HvqFcIkUgo4XKiJRCzz9WbwThsy
	 gJR0K1nNIeDDwBrzTbRvMyPoxcc4+oA6Me0V0iMG204R5v0/VRnA2z+EwN60sS1q/tBzE
	 1p9jgATcgQefXIBAHO8hZC2u6rKECjtTHGg5d6yRYyOTNuhpXFRWrDg1XYnMDZO8zECa1
	 /QUNhNZ8LP6A+TbggkBqOLMLy8oT4MZiMaac+/9aWv0yDpnlXpPmZuK8QO+xgz/giLQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=SGfbu6jb;
	arc=pass header.oldest-pass=0 smtp.remote-ip=209.85.215.172
X-Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id AA64D606A322
	for <git@vger.kernel.org>; Thu,  3 Dec 2026 22:03:25 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org AA64D606A322
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-pg1-f172.google.com with SMTP id 41be03b00d2f7-cdebab6fdb3so163108a12.2
        for <git@vger.kernel.org>; Thu, 03 Dec 2026 14:03:25 -0800 (PST)
X-ARC-Seal: i=1; a=rsa-sha256; t=1796335405; cv=none;
        d=google.com; s=arc-20260327;
        b=CrIPsPgLphKKFZ3e9CrA1FGrVQuKb9VSC29//BBXu60N4XjkC11CvUP4v9efVZnVAu
         nxBLmmaWQ80ifhZ0jiJc/BF9aLEMpfYc6k/2StEyDipsJ2cVc25isgB1Blvpp60x6z4M
         0zy8Pm5VAbK2Gbf9hqY83iOvGj6qrdXGDGg/Frk6xTU7LFoEqTIqpN2ebECy5tYMK4Hc
         9lgVv3hyP+2lh5pbPBgHWhg0MpLGBJEdL/4SqQ630Z+U7SkdbIy2Um/E+8szGFCBqbQ6
         iIy1hOJV8hffP0EAdO0aPjPJCaRJgyF1EGxoObWlFQgMDrGwK8loPPwg2WgiM73234Id
         njrg==
X-ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
        h=cc:to:subject:message-id:date:from:mime-version:dkim-signature;
        bh=5sSPdgOyoO0i5BHIIM4g+X0jnw6pzWEPFMCheKCLsAo=;
        fh=k0W9WtnA3WIB54bLC57QCs5RLrw79uuj6HPtGlJKeKQ=;
        b=Kfq51W38BIMPoaFchiXWYnWFH0N6vP19hddpG5Oa77e0pOP7RR4MsrGuiTC7HjCjFS
         QJavshsI5xfB0kVRmkBJ3dK5McJyOU1b1HdJBVdn37L9zLC2rir7VbcWMwbdDe4PBZ65
         jozTIJFUrp9/LBbMlVXqYnu95eGkD0/PZh4ScznDK0KZN0QtdatFQ/iWmm5wPevt1fjU
         lWFpqaotgXUNgnVtqCXTaQj+whZUuQx4x9fRWbVNV17dWxwwKYKt9XKAQFbweAgxDmtq
         UfN8JE5kGvhl5DPOncdNjmKooMZ42/pXhm1qAT3JYLI1WY/ODKeRu0eC8NGuK12smhDj
         c+fQ==;
        darn=vger.kernel.org
X-ARC-Authentication-Results: i=1; mx.google.com; arc=none
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20260707; t=1796335405; x=1796940205; darn=vger.kernel.org;
        h=content-type:cc:to:subject:message-id:date:from:mime-version:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=5sSPdgOyoO0i5BHIIM4g+X0jnw6pzWEPFMCheKCLsAo=;
        b=SGfbu6jbL78AuItJP7Rg/D8LVRhSl16m60g5RP3mFz/gIT47Qqt/4EHVBdryh/10L1
         Ag7ucKGbs9HY0K1+YK+N2w3j8fFE1ywO5AjfxYcfL4uCRhgd92BPrdhG+4R0i7SVg6P6
         6raQGZoTBqZ/OT4JqWcfw3kLIJjQBz/5twSXdaA2RHfRhH6P2P7DLP0cZQgsBoclopbJ
         ESv6QtlHLyDNb2Ku/KuypcaqMipcvRgvI1ZPYBKFosNhZkBPVz3Hg7V4rQI05dlEOwWk
         3v18P43I7/58bdlgWgJWF1fbF3IzCYJikeJ5wxlgt+av1HhjVKd3u9ySF8uU8Jbpf1B2
         pNoQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1796335405; x=1796940205;
        h=content-type:cc:to:subject:message-id:date:from:mime-version
         :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=5sSPdgOyoO0i5BHIIM4g+X0jnw6pzWEPFMCheKCLsAo=;
        b=wRd5GPrCZpSmPcR4zRgX0ik/Hi40wgQ7TVcfE+s+iZzfD3AGZMhCGVv/3gX4UTcdxO
         G8F8/fJLPLb0QKfiPNJ8X4A1kju+zx+oQXot+vUZzackOGyhrhojGJgniKSCJUaIEDlW
         aG33dT99BLa6+kgfuImT2Rc/OUsGlRHyayBhOmoSMnNKJV/CcrZDjN3Yx0Q/4jCk6pVt
         ja1Dkx2KEno5tbOyr/iJN/r/3yN4lIQtxsn5iuw+vApELKad7b6fPBs/vbLitbezZFEC
         vFhSIYhjGleJWwgRX0fSHe/Av04H8W/0idjPkfg8udPAkTt/gPYfeJl3td/J50qkx48T
         uCKw==
X-Gm-Message-State: APuU4Z9JKgLYd3mDC3tSFkuUgIg+JBHjOy9CO0S1MHcKPTcGgAVpD3WD
	HwjBswV7iebIp1qOMFti4mu1akMm61ab3wOajL0vSuwcegYJ/tKDoZv1SuOvn+R/oupn/VAhij/
	ohsdQUJQTkhDC3Qo6ftQgS1moQu5nn7wMjisb
X-Gm-Gg: AZFdTZfiBZek2XhCaztX/23VULv4evOFFHCVcn392XjgteaSolH9z3jyoyEmuJB7c9a
	Lu5gzeyXQrQ0TsWoIUO5YBSSBSrZ/tmHMZoWEjYIzf3rpzt6uVTCLMU5hdYMGlfTdG3ufH4bzKm
	LOBdtL2VSTKADN19jLjMYOuqVT3ea+hvrdfXNHlk97hhkb2AcgmDRJZxIdLzUXCbnyrXZUtwMsI
	LIhheU8pZTndDwiQuXthmQk8ghe/PdppbcEO0EnhGBIE3AZl2EVHc7CBEmEBVCQNvl/7jcFkkGm
	/zeKf0KaglGQa+FZxPHkwuxV4LYMxZCubfsDWiol8JQgx8gKx5QPM33nPHCPdJ+VB0fQzJSWxaY
	VePaXIRLEAHWS014vwN1qfjkT0x1lAmSeRrfsy0xO9WRHMNlXri6xFOOMfUNMR3C6ZKlfXhWhzi
	rg86ESrCmQY6bf3J+jomjJD+0rcPwB/1ohKZ2i6ExWJYeiv1Rp6Y9ykyKwJX0FQHvLCJKwf7Pia
	3w5JVPNDfNzEQ==
X-Received: by 2002:a05:6300:6bdc:b0:3f2:277:7c93 with SMTP id
 adf61e73a8af0-415617419acmr90738637.32.1796335404758; Thu, 03 Dec 2026
 14:03:24 -0800 (PST)
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
X-Gm-Features: Aa3M54oMpTdXAYW_-aJK_-EtW3rvploMUE1detg166EfmMhzqqf8mRQm4gFC2UQ
X-Cc: Phillip Wood <phillip.wood123@gmail.com>, Patrick Steinhardt <ps@pks.im>, Matt Hunter <m@lfurio.us>, 
	Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>, Tuomas Ahola <taahol@utu.fi>, 
	Harald Nordgren <haraldnordgren@gmail.com>, Junio C Hamano <gitster@pobox.com>