From: Hamdan <hamdankhubaib959@gmail.com>
To: git@vger.kernel.org
Subject: [RFC] git task: grouping commits into named units of work
Date: Fri, 27 Nov 2026 05:14:44 +0530 [thread overview]
Message-ID: <0AB3AB52-1F14-4C72-ABE8-46B635F463CE@gmail.com> (raw)
Hi all,
I'd like to share an early idea and hear whether it makes sense for Git.
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.
Why it matters
- Readability: on large codebases, history reads as a list of tasks instead of a flat stream of commits.
- 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.
- Agents: an AI agent can open a task, checkpoint freely inside it, and the whole task can be reviewed or reverted as one unit.
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;
- 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.
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?"
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.
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.
This is an early concept, and I'm not sure it beats branches in every case, 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.
Thanks,
Hamdan Khubaib (GitCoder052023)
next reply other threads:[~2026-11-26 23:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 23:44 Hamdan [this message]
2026-11-27 11:48 ` [RFC] git task: grouping commits into named units of work Oswald Buddenhagen
2026-11-27 19:16 ` Junio C Hamano
2026-11-28 17:11 ` Kristoffer Haugsbakk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0AB3AB52-1F14-4C72-ABE8-46B635F463CE@gmail.com \
--to=hamdankhubaib959@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox