git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Feature Request git snap, Lightweight Commit Workflow for Iterative Development

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Jul 2, 2025, 21:55 UTC
Message-ID
<aGWq7vBSYuuKW69o@fruit.crustytoothpaste.net>
In-Reply-To
<CAPGv+4ZT774b-LGMFpyv3cJYUrpWPMpkCGn25AfwD7MHskbV=g@mail.gmail.com>
On 2025-07-02 at 18:30:17, Suraj Bhadrike wrote:
Show 10 quoted lines
> Hi Git contributors,
> 
> This proposal introduces a new command git snap  designed to support
> highly iterative development workflows nowdays  influenced by AI
> coding assistants.
> 
> The rise of AI assistants and agentic AI workflows has changed the
> pace and nature of coding. A developer might cycle through dozens of
> variations of a function or component in a short period while
> collaborating with an AI.

I mean, I do this too without an AI. I frequently want to make changes until something works, and then snapshot it and modify it to polish it and make it more presentable.

Show 5 quoted lines
> This feature would provide a soft commit or snapshot capability,
> allowing developers to save their work state frequently and create a
> new commit every time as a snapshot or checkpoint without a commit
> message and flag where We can provide an option for developers to
> include files at the start of snap Session.

I think a lot of this is achievable with current functionality, just in a slightly different way. At the beginning, you could save a set of pathspecs in a file (equivalent to your `--include` and `--exclude` options) and create a random ID (also in a file). You then do `git add` with your pathspecs and do a `git commit -m "WIP: snap <random ID>"`.

For subsequent commits, you can just do the same `git add` with the pathspecs and then do a `git commit --squash HEAD` or `git commit --fixup HEAD`. When you're done, you can use `git rebase --autofixup` to squash all the commits down into one.

These are things you can create with an alias pretty easily and I have similar functionality to make this easy. Or you can create an external `git-snap` command that simply does this under the hood. I don't think this is functionality we need in core Git because we can already achieve most of it pretty easily with a few shell aliases.

If you do create this as an external command, then please do not accept multiple patterns in the `--include` and `--exclude` options; take multiple options instead. Git LFS did what you're proposing to do and it means that files or patterns with a comma in them can't be matched.

-- 
brian m. carlson (they/them)
Toronto, Ontario, CA
Previous: Lucas Seiki OshiroNext: Ben Knoble
Message 3 of 5 in “Feature Request git snap, Lightweight Commit Workflow for Iterative Development”
  1. Suraj BhadrikeJul 2, 2025
  2. Lucas Seiki OshiroJul 2, 2025
  3. brian m. carlsonJul 2, 2025
  4. Ben KnobleJul 3, 2025
  5. Suraj BhadrikeJul 3, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.