Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[egit-dev] Editing a file several revisions back

I’ve been finding I’ve been needing to do a certain set of actions recently and a pattern is beginning to emerge.

When I’m working locally (or proposing a set of changes to Gerrit) I often find that I need to make a change two or three commits back.

Right now this involves:

- stashing any changes
- interactive rebase to the commit where the fix needs to be made
- editing the file to make the fix
- commit amending
- rebase continuing
- unstashing any changes

All of the times I’ve needed to do this, the file I’m editing is in the workspace/current git history.

Although the EGit interactive rebase will allow me to do this in the IDE instead of the command line, I can’t help but think this operation may be fairly common and an option to allow an edit to a single file in history would be useful to others. In particular, when I do this I’m fixing a bug on one line, and invariably that line is the one that introduced the problem.

So I envisage an option where you can right-click on a line in the IDE and do ‘Edit past version’, where it prompts with a set of revisions from git log for that file (defaulting to the last commit for that line as shown by ‘git blame’), followed by an editing window that allows that file to be edited, and upon ‘save’ performs the rebase. Although this might be best done by resetting the project as a whole, in fact this operation might be so self contained that the workspace doesn’t need to be updated until the operation is complete.

Recovery for this could drop into the standard rebase workflow or throw an error.

What do others think?

Alex

Back to the top