On 2025-07-02 at 18:30:17, Suraj Bhadrike wrote: > 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. > 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
Attachment:
signature.asc
Description: PGP signature