-
Notifications
You must be signed in to change notification settings - Fork 31
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
Idea: revise the last commit that changed the files in the index #66
Comments
This is basically |
I think a good path forward here would be to make PRs to https://github.com/tummychow/git-absorb to make it possible to use to implement this functionality in git-revise (i.e. git-revise queries git-absorb to figure out what changes need to be made) |
I'd never head of Looking over the usage, wouldn't it make more sense to setup |
That can also work |
I use |
Oh, git absorb sets up fixup commits? Neat! I was under the impression it directly did the rebase |
git autofixup is another tool that's very similar to |
I often want to revise the last commit that changed the file or files in the index.
I had been doing this manually until today, but I finally got fed up with it enough to make a simple alias.
As an alias (add to .gitconfig):
Reformatted as a standalone script:
This script is not robust (I doubt it handles things like uncommitted files properly), but it’s good enough for me.
I have created this issue because I think this would be useful functionality to upstream into git-revise, e.g.
git revise --last-commit-for-file=…
(with the files defaulting to all the files in the index).A better and safer version of this would allow users to specify an acceptable range of commits to revise (I’ve hardcoded
HEAD
here, but things like@{u}..
andmaster..
would be useful).Another power-user feature would be to be able to revise different commits for each file in the index (rather than just bailing as I’ve written here). The alternative is adding each file and revising, one by one (or by as many files as are in each commit, anyway). This functionality would definitely save me time occasionally.
The text was updated successfully, but these errors were encountered: