Open paul-hammant opened 1 month ago
I find more fine-grained control useful. I keep VSCode open at the same time I'm using aider. I use the diff view in VSCode's version control tab.
For aider, I actually use the --no-auto-commits
flag, and then manually commit each time.
However, you could keep the auto commit on and if you regret anything, you could
git checkout HEAD~1 --soft
This moves your branch pointer back one commit (to HEAD~1) but leaves all the changes from that commit in your working directory and staging area as uncommitted changes. This allows you to make adjustments or re-commit the changes as needed without losing any work.
I prefer using full version control tools in this way because I can pick and choose what I want to keep, and easily make manual edits at the same time. VSCode has handy Stage Block/Revert Block buttons that you can use for this.
If you did it the way I'm suggesting, undo
could be implemented with git stash
Step 1: aider auto commits the change
Step 2: if you don't like it you git checkout HEAD~1 --soft
- this will keep the uncommitted changes in your workspace, you can pick and choose
Step 3: for a full "undo", git stash
will remove the changes from your workspace
Step 4: for "redo", git stash apply
will bring the changes back, ready for you to commit
I think this is better than a simple undo/redo, because often I find I want to pick and choose what I want to keep.
For git, I found these resources handy: https://learngitbranching.js.org/ https://ndpsoftware.com/git-cheatsheet.html#loc=index
redo could be implemented without keeping the commit or relying on git, if aider could keep the last iteration(s) in memory, and just reapply them
I have "live page reload" going and sometimes I regret my /undo decision :-O