From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=103.168.172.159 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795885942; b=3+3zbkod9FENFeKO4iYNxzMGMhQafwVdLS/BZ/e8ZKajVbQWr26O+vhGiIy88KZlFgai VZ4+r5Ek6GM8GoSON9Gsbaw1UtGKKJ/eZ0bJDcFxQoziYtoKGsaY6Zj9+hsuMcbm4RAUk B2XiDEGn+ffBPlKJeBlWgYSPN5Cn79sPW5GuFZHXr/d0FvV2oXqcamPDl3TgfA0x1EzDW /im/mgW52YQdGRkaPXlQTtZq223LCdlpHg5Sfavf7Yh8f1fem0zg6WF3KlnX5FbstIXIM WanPwBkCdW0gla9DsB3nErkhSFA9vcF/hZ7KDE4oJgHRzH1PuCn9LdcUEZPO/jxjgZw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795885942; h=DMARC-Filter:Received:Received:DKIM-Signature:DKIM-Signature: X-DKIM2-Info:DKIM2-Signature:X-DKIM2-Info:Message-Instance: X-ME-Sender:X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID:Received:X-Mailer: MIME-Version:X-ThreadId:Date:From:To:Message-Id:In-Reply-To: References:Subject:Content-Type:Content-Transfer-Encoding; bh=Fkh1WN0w7jmrzOVRrdhmyXwwhE7HTfZNB4ACr7w23qQ=; b=2kjLj6Om6CoZ82mkqfurvPw7suF1I7/b5cGD0ldm6Oh+gtyoizLLBRMMV/K4lkM/U9IU /nprNnRlmqCJtErEXhzGIeTu8/gOU7E2Erva32gOJm8RJwpJZa0QUQq/DKDlicb/FzcLG Xl/7wJZd9zF1TWe78CpgVZaWWaJWP4pCz115blExi4X+maEvtA3ymjVM4V0IPg5q3czXG RdAuQmTUDq2pDHCR9UXDd2Xy/A9tYHgUHHgOV8RFuIIDf6HVbqhd3l4VrIhuk7/2l+LrR IhQ2N3tE2NRwmMox7SMmmmnLCX2jagzRMuTw6ofP8iRYeKm/T9dvQYIJPwSLW//szQQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=fastmail.com; spf=pass smtp.mailfrom=fastmail.com; dkim=pass header.d=fastmail.com header.i=@fastmail.com header.a=rsa-sha256 header.s=fm3 header.b="JwYyPn/a"; dkim=pass header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b="cR/QphwG"; arc=none smtp.remote-ip=103.168.172.159 Received: from fhigh-a8-smtp.messagingengine.com (fhigh-a8-smtp.messagingengine.com [103.168.172.159]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 829A4606A31C for ; Sat, 28 Nov 2026 17:12:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 829A4606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fastmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fastmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=fastmail.com header.i=@fastmail.com header.a=rsa-sha256 header.s=fm3 header.b=JwYyPn/a; dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=cR/QphwG Received: from ams-compute-01.internal (ams-compute-01.internal [10.64.2.61]) by mailfhigh.phl.internal (Postfix) with ESMTP id 768F11400234 for ; Sat, 28 Nov 2026 12:12:20 -0500 (EST) Received: from ams-imap-15 ([10.64.2.35]) by ams-compute-01.internal (MEProxy); Sat, 28 Nov 2026 12:12:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= 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=fm3; t=1795885939; x=1795972339; bh=Fkh1WN0w7jmrzOVRrdhmyXwwhE7HTfZNB4ACr7w23qQ=; b= JwYyPn/ab2/owgM1voCmk89Tmqmvsd00n3vyQhPLZXWxDXFMEovdRlwnvfqxs0kf p9bYfkzbQQSjzwXnMTgaFwRY3V71vbmIOcP5h0wd+Q22GLnPmc7gj/MX3rEKrqg/ CWhkD5cIrvoz5fvS8lHhlCTDvBJoKhMslANyIzaKhgYKK49/b3Khs3iv7TcvuDgI ux6CzRW2RwvKzg2kkI3YgBliMMcqq2ujlKPYxfM6yr+04zv7SU2qBcPqM13/Y74/ IJccKAtsspW40q/srRSG1gOaaLND7Pw8nlxZzLUBb2T9+YOZZcBsmpqnBso225M5 iTiQ4xGGdDdOCHUppOyc5A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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=fm3; t=1795885939; x=1795972339; bh=F kh1WN0w7jmrzOVRrdhmyXwwhE7HTfZNB4ACr7w23qQ=; b=cR/QphwGy45WGxATG J3xqH2MC5Xnq0LeTR8Dt61OX4B63NXgd37Xwf+swT46i0SmDAKE1VwkcBpjgPimV GCBaGIf7ky/rZugFJHxFxn0bc+G+QeFnGSBr78mywJBC66uam5Er2OyQdabqcrqc 64+M71KMh5FSsIfZ2B9ij9LfB32LqjfgGFs53QZcauErwck9RoUVJSVYmpcyh1o0 yuKBJep+sTbq8FEXjAeOKgg7gr/YlP+hcKU5oSSQeGPx+XCqBxUzRsF8mdI/H4C9 9hw1nuVCyJlSQTIbJ9eX7Ao6MMgTxAiykS69HzW1zk6Wg5QIIxnUZWVppf90sU4X TmKqg== X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=sign d=fastmail.com a=rsa-sha256; DKIM2-Signature: i=1; m=1; t=1795885939; d=fastmail.com; mf=PGtyaXN0b2ZmZXJoYXVnc2Jha2tAZmFzdG1haWwuY29tPg==; rt=PGdpdEB2Z2VyLmtlcm5lbC5vcmc+; s=fm3:rsa-sha256:eeaJNj6H5vwQ+yBqNIAqru5JBd4s37BPwWxnBw3v8ZHspcK JOs1zfAMElRf1I1OUxg8HCZHjfAXVDXuP0M8V9qkPB34CdxG9bGpcAi+UvgVXmWQ jQCJJZWlWEp2Lte5UaypUY7XaAfinakx5mfD9V3rFJnH4E4dn8Jv/UdkX17oAFj2 YllLsfOKec5FDrQwqqeW0jUivEoUTM4pSjv6iddc1tLwj/h+G58rukDEkV7j9qYa QqEJvL7aVLG6sN8MiGsWpf3FS2S7JyM0KWEPdXTve5axtEWJ4mm+1xJGdo6fVmiW Gp+WY7opapSpBZ7DTZMsMf1ffsH3hSN0jIbsLAg==; 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=11; hn=content-transfer-encoding,content-type,date,feedback-id,from, in-reply-to,message-id,mime-version,references,subject,to; Message-Instance: m=1; h=sha256:zE+uiVpVD1sUtr4sJ4svkSV0IEoqW6Jo7Z5NzwLXWk0=:N/T5+iYbgJ1iQu58a9bWnaZAjZ2hdD0JkjOsHiy8PA8=; X-ME-Sender: X-ME-Proxy-Cause: dmFkZTFmmVCT6wz2NV96rkgReWyjiGdI+1KusHJ5YY5u2we7MQ6Z3/nTJpl+0lZUyrkjG/ ZqD6aM2ZcDpi41liUadrcY6Ktura14++dKHozaRSy8ELRCYIwBIXwDOUy45tGuNbsppIYt dfQAcc1eQ7xQXDpW4y/e2hGr81Zu8jqwrjXO7HAOYtcZ47n0u2YLU/4rJUegdsahwidZc6 GJgBuuB2a7S526Rj1CxJfv9it+wzHTFGIGnQ8n0pwSBAg2azn9jJ4xgK8wnkxWPMHRZqOP dXk17akzcdrQcYcaXJAh9FSgliYkB8mjAu5xFiJkb3LNpjSDkDxy8KpexGVZ10Mjr0pyJF XHEx/1kHwENtabj4illQBcrzran9o+TJxmWL3FDodv3VhmWIS95YyHsCknCWrnsE++9Tak 5LmGs63eAM76RYMdhxBiZcKYZXo2DF7BBvyasZfXFA32WziH5S7k1tCJ/5vV7FRZwv6nVG Rs6JFC6plb46+cw5Fp8bJ0/0dbSpgupVN4eaYcZJcNZCNQo0Sw0tFY8xuu+pJEWXkYF5q+ zPzLVCpj2dmuV1lc/kK1NlmhyN37RwicLqnU8uaxay5WCkRPDhylGUHmgEZ24ubjZIMX4i W00s9/rJbeaLqslDxTH170kOO7S8JNyCTLjHXyIjh99F1rExDCTSKKZOb21w X-ME-Proxy: Feedback-ID: i8b11424c:Fastmail Received: by mailuser.ams.internal (Postfix, from userid 501) id E349222C009C; Sat, 28 Nov 2026 12:12:17 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface X-Mailing-List: git@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-ThreadId: AlYZHBqOGPC7 Date: Sat, 28 Nov 2026 18:11:57 +0100 From: "Kristoffer Haugsbakk" To: git@vger.kernel.org Message-Id: <74409b35-70c8-4ab3-948d-3541435b6db4@app.fastmail.com> In-Reply-To: <0AB3AB52-1F14-4C72-ABE8-46B635F463CE@gmail.com> References: <0AB3AB52-1F14-4C72-ABE8-46B635F463CE@gmail.com> Subject: Re: [RFC] git task: grouping commits into named units of work Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Fri, Nov 27, 2026, at 00:44, Hamdan wrote: > Hi all, > > I'd like to share an early idea and hear whether it makes sense for Gi= t. > > The idea > > Most of the time, developers (and now AI coding agents) work in > discrete tasks: adding a payment gateway to an existing app, building a > versioned update system, and so on. While doing a task, we commit > periodically as we hit milestones, so the work stays saved and > traceable. > > Today, if you want those commits to read as one unit later, you usually > create a branch or worktree, commit there, then bring it back into main > with a rebase, a merge, or a pull request. In a commit graph it looks > like this: the branch splits off at commit 187, runs through to 247, > and merges back into main at 248. > > What I'm proposing is a native Task primitive that gives you the > grouping without the branching: > > git task start "add payment gateway" > git commit ... > git commit ... > git task done > > A task is a box around a unit of work. You can stay on main the whole > time. When you look at history later, commits 187 to 247 show up as one > task that you can collapse or expand, like a collapsible list, so it's > clear what was built there. You should write what you want to achieve first and then how it works. =E2=80=A2 =E2=80=9CYou can stay on main=E2=80=9D=E2=80=94so it=E2=80=99s= like a branch, but different? =E2=80=A2 =E2=80=9Cthat you can collapse and expand=E2=80=9D=E2=80=94you= can collapse and expand (sort of) the history according to merges, `--first-parent`, and so on What I often see is that people want this: =E2=80=A2 Person A: I would like a sort of subcommit: it=E2=80=99s less = important than a mainline (`--first-parent`) commit. You can hide it if you want. Or show it. =E2=80=A2 Person B: Oh, but you can use merges for that =E2=80=A2 (The most =E2=80=9Cdiligent=E2=80=9D approach is to rebase t= he branch against upstream before the non-fast forward merge, so the first parent of the merge commit is the same parent as the first commit =E2=80=9Con = the branch=E2=80=9D. This approach is an alternative to having all commi= ts on mainline without any merge commits. It won=E2=80=99t work for workfl= ows where you might fix an old bug on top of the buggy commit and then merge it into five release branches.) The conversation ends there if person A is fine with merges. But some are not, for some reason. They still want to make all commits on mainline while being able to expand and collapse them. > > Why it matters > > - Readability: on large codebases, history reads as a list of tasks > instead of a flat stream of commits. Many projects use pull requests where a merge on mainline means one finished task. > > - Lower friction: for beginners, small tasks, small teams, and > early-stage startups, "start a task, commit, finish the task" is > simpler than creating branches, switching context, rebasing, merging, > and managing merge commits or PR overhead. I notice that for tasks here you just start a task, do the work, then finish. But for branches you start them, do the work, *switch contexts*, *rebase*, ... you=E2=80=99re comparing a clean and perfect execution for= tasks with an imperfect, interrupted, and time-worn (rebase) approach with branches. > > - Agents: an AI agent can open a task, checkpoint freely inside it, Like with branches. > and the whole task can be reviewed or reverted as one unit. Reviewed yeah. You can also =E2=80=9Crevert=E2=80=9D a branch by reverti= ng a merge. Although, I feel that reverting a merge is more advanced and has more caveats than reverting a single commit. But I am skeptical when people say that reverting whole tasks is important. Having to revert entire tasks suggests code churn, and frequent reverts lead to more maintenance burden. A revert is just a reversed diff, so the extra code change leads to the same issues with potential merge conflicts when multiple people are working together. > > Single-branch and multi-branch tasks > > A task doesn't have to be tied to one branch. It can live: > > - on a single branch, e.g. a feature built directly on main, even if > unrelated commits land in between; Next you propose using trailers to implement this. As such a task cannot be tied to a branch since a branch is a ref. So that=E2=80=99s fine. > > - across several branches, e.g. a fix on main that is also > cherry-picked to two release branches, or a feature with a backend part > and a frontend part on different branches. Four commits on four > branches, one task. Oh, here=E2=80=99s something that makes me glad that git(1) has not supp= orted some kind of persisted ID for commits beyond `git cherry-pick -x`;[1] it makes it *less tempting* to use cherry picks and whatnot to effectively duplicate commits for releases. Cherry picks are the copy=E2=80=93paste of Git. The commit graph is first-class and you can e= asily query for one commit being present in however many branches. Cherry picks (or equivalent) are just duplicated changesets: more costly to query for, you have to make sure to mark the origin, and they clutter the history when you go spelunking later (you might hit some commit that you were looking for, but it turns out that it=E2=80=99s the cherry pick= on some release branch that you didn=E2=80=99t care about.[2]) Making it easier to duplicate changesets is not a good thing. =E2=80=A0 1: A patch ID can identify a change, but I=E2=80=99m talking a= bout marking the commit itself with it. =E2=80=A0 2: I imagine. Haven=E2=80=99t done much of that in anger. > > To support both, a task would be identified by an ID stored in each > commit (a trailer such as "Task: payment-gateway"), not by a commit > range. That ID survives rebase and cherry-pick, so Git could answer > "which commits belong to this task?" and "which branches has it landed > on?" The implementation is fine and aligns well with people=E2=80=99s apparen= t love for issue managers. I mean, so many people put issue keys in the commit message. They might as well put it in a `Task` trailer. Note: that `payment-gateway` task might come up again as the same string in two years time. Issue keys often work better in practice if you want a unique key since they use some prefix with an incrementing number. > > What this isn't > > This doesn't replace branches. Branches give isolation: your unfinished > work doesn't affect anyone until you merge it. Tasks only give > grouping. Larger teams that need review before code lands would still > use branches and PRs, and tasks could work alongside them. LLM waffling but okay. The branch =E2=80=9Cgrouping=E2=80=9D is implicit= , so I can see how the task grouping is different (explicit). > > I know related things exist: --no-ff merges read back with > --first-parent, commit trailers, GitButler's virtual branches, and > Jujutsu's change IDs. My feeling is that none of them make "this is one > task" a simple, first-class concept. Again, you have to work more on the motivation. There=E2=80=99s a lot of= text here on agents, multi-branch setups, small teams, early stage startups=E2= =80=94a lot of talk about how it fits in with everything before it has been established how useful it is. Most people are in fact fine with most things being second class. Motivating raising it to being first class can be a tall order. > > This is an early concept, and I'm not sure it beats branches in every > case, But two paragraphs ago you said that it wasn=E2=80=99t supposed to beat (replace) branches. > but I think keeping the mental model this simple is worth > exploring. I'm happy to build a prototype first if that's the preferred > path.