I've been wanting to experiment also with getting an agent to go back and rebase history, rewrite commits etc in the context of where the project ended up, to make a more legible history, but I don't know if that's doable, or even all that useful.
I've been wanting to experiment also with getting an agent to go back and rebase history, rewrite commits etc in the context of where the project ended up, to make a more legible history, but I don't know if that's doable, or even all that useful.
Its fine if you just rebase at the end manually, but not good if you don't, your history will be cluttered and as hard to read as the codebase.
Eventually most people who use coding tools will have low knowledge of what is being generated and then they probably never rebase either...
You can typically go back and edit git history. But it will require force push and breaking changes. And a few sacrifices to ensure that it doesn't make a mistake because then your repo is potentially broken.
Best way to do that is probably to have it work on branches and then squash merge those.
Another problem I inadvertently dodged by using Jujutsu with Claude Code :)
I tend to send a lone "commit" message to Claude when I think I'm in a spot I may want to return to in the future, in case the current path doesn't work out. Then Claude commits it with a decent message. It knows how to use jj well enough for most things. Then it's really easy to jj new back to a previous change and try again.
Often I have a branch with multiple commits on it, with each commit corresponding to a message in a conversation with AI on Cursor trying to get a new feature built.
In the end, I can diff the branch against the main branch, and see the sum total of changes the AI agent has made.
Maybe edit/improve manually on my own afterwards. And then, merge.
That’s what I do too until I developed a practice to break up into thematic commits as I realize I need them. And if I don’t, then I just git reset to the beginning and use git gui to commit lines and chunks that are relevant for a given piece of work. But with experience, I barely do the break down completely - I generally don’t even bother creating commits until I have a starting sense of what the desired commit history should be.
I just commit with a “wip!”-prefaced message whenever the LLM pauses and says it’s finished, including new files. You can squash and cleanup later, or revert back to a state before it screwed up.
Also doubles as a way to cohesively look at the changes it made without all the natural language and recursive error/type fixing it does while working.
I don’t understand why people are making it so complicated. You’re saving a minute per iteration with the LLM, tops, at risk of losing control or introducing hard to find issues. It is the definition of diminishing returns.