Git development
 help / color / mirror / Atom feed
* [RFC] git task: grouping commits into named units of work
@ 2026-11-26 23:44 Hamdan
  2026-11-27 11:48 ` Oswald Buddenhagen
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Hamdan @ 2026-11-26 23:44 UTC (permalink / raw)
  To: git

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)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-28 17:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-26 23:44 [RFC] git task: grouping commits into named units of work Hamdan
2026-11-27 11:48 ` Oswald Buddenhagen
2026-11-27 19:16 ` Junio C Hamano
2026-11-28 17:11 ` Kristoffer Haugsbakk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox