-
Notifications
You must be signed in to change notification settings - Fork 8
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
Limit git autofixup
to specified files and/or to staged changes
#30
Comments
On Sun, Feb 25, 2024 at 04:27:08AM -0800, Ivan Shapovalov wrote:
It would be nice if it was possible to limit `git-autofixup` to changes in specific files, e. g.:
```
git autofixup <base> -- /path/to/file /path/to/something/else
```
Good idea. It is probably doable to support arbitrary pathspecs by forwarding them to Git diff.
Alternatively (might be even more useful), accept something like
- `--staged` to only operate on _already staged_ changes (mirroring `git stash --staged`), and
that's already the default in the latest release - if you have anything
staged, stage everything. It is indeed very useful.
- `--keep-index` for the opposite (mirroring `git stash --keep-index`).
interesting, yeah. Would probably need to temporarily swap the index file but we already do that elsewhere.
|
Regarding If I'm understanding correctly, it'd be roughly equivalent to this:
But what if rebasing the saved index onto the changed topic branch fails? |
oh, I guess it'd be a lot nicer to write a
Thanks for the suggestions, @intelfx, but to me it seems more flexible, tractable, and lower maintenance for people to write this as a shell script instead of working it into git-autofixup. Apart from convenience, is there an additional advantage that would be gained by having it in git-autofixup? |
It would be nice if it was possible to limit
git-autofixup
to changes in specific files, e. g.:Alternatively (might be even more useful), accept something like
--staged
to only operate on already staged changes (mirroringgit stash --staged
), and--keep-index
for the opposite (mirroringgit stash --keep-index
).The text was updated successfully, but these errors were encountered: