Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: /rageedit to edit last diff in rage #96

Closed
alexanderkjeldaas opened this issue Jul 13, 2023 · 8 comments
Closed

feature request: /rageedit to edit last diff in rage #96

alexanderkjeldaas opened this issue Jul 13, 2023 · 8 comments
Labels
enhancement New feature or request

Comments

@alexanderkjeldaas
Copy link

Sometimes gpt stubbornly will not understand what you say and do too much.

In this case, a "rage edit" command is appropriate to invoke to edit the diff in rage.

@alexanderkjeldaas alexanderkjeldaas changed the title feature request: /ragedit to edit last diff feature request: /rageedit to edit last diff Jul 13, 2023
@alexanderkjeldaas alexanderkjeldaas changed the title feature request: /rageedit to edit last diff feature request: /rageedit to edit last diff in rage Jul 13, 2023
@alexanderkjeldaas
Copy link
Author

this command could also invoke git add -i for interactive add of the commit.

@paul-gauthier paul-gauthier added the enhancement New feature or request label Jul 14, 2023
@paul-gauthier
Copy link
Collaborator

Thanks for trying aider and reporting this issue.

I'm not exactly sure I understand your request. But I just added a FAQ entry that you might find helpful:
https://aider.chat/docs/faq.html#aider-isnt-editing-my-files

@alexanderkjeldaas
Copy link
Author

alexanderkjeldaas commented Jul 17, 2023

It's not that example I'm thinking of. I haven't seen gpt not being able to edit files (but I'm using 3.5 which seems to not have that problem). I'm thinking of when the diff contains unneeded changes that I want to remove. I have 3 choices:

  1. /undo + update the command and retry
  2. edit externally + git commit -a --amend
  3. /rageedit which would do add topics #2 from within aider, but instead use the equivalent of:
git reset HEAD^
git add -i

This is mostly a convenience as small edits like that is quite common.

@paul-gauthier
Copy link
Collaborator

Ah I see. In my experience coding with GPT, in this situation I would simply make an edit in my editor to fix/improve the code, commit that and move on (kind of like your option 2). That fixes the code, but doesn't worry about the fact that there's a commit in the history which wasn't perfect.

I'm not sure it's in scope for aider to strive for a perfect commit history. Coding with GPT is very much a collaborative and iterative process. Aider relies on git for safety so that you can always undo something that GPT does.

If you want to tidy up the commit history, you probably need to use git on the command line to rebase or --amend, etc.

Here's some info on how aider uses git that might be relevant:
https://aider.chat/docs/faq.html#how-does-aider-use-git

@paul-gauthier
Copy link
Collaborator

I just asked aider to add an in-chat /git command so you can run git commands without having to leave the chat. It's not the automagic functionality you were describing, but it might simplify the workflow you're looking for.

@joshuavial
Copy link
Contributor

My practice is to do a rebase periodically to keep the git history in order. I'm still on the fence personally about how I feel about the large diffs that gpt-4 puts in the git history.

I like the idea of keeping as few opinions as possible in aider itself and letting folks do things the way they want.

@alexanderkjeldaas
Copy link
Author

@paul-gauthier the /git command might be optimal. it is more composable than having more specific commands.

@paul-gauthier
Copy link
Collaborator

I'm going to close this issue for now, but feel free to re-open or file a new issue any time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants