Closed rjmunro closed 1 year ago
in your example, what parts of the change are already committed, and what parts are added to the index before you run git-absorb?
The above is the simulated output of git diff --cached
- the -
lines are previously committed, the +
lines are in the index.
ah thanks, now i see what you're asking for. you want a way to reconfigure commutation so that hunks only commute if they're in different files. yes, i think i'm open to this change, although i'm not sure it'll behave as well as you imagine. pr welcome - it would probably go immediately below here https://github.com/tummychow/git-absorb/blob/master/src/lib.rs#L160-L169 to bail out of the rest of the commute analysis if the paths do match
-w
introduced in #80
Often I make a change like
And I forget to include the
import b
when I commit the change. Could there be a way to ask git absorb to write a fixup that matched the last commit where a file changed in any way, rather than the last commit where it will cleanly merge? E.g.--whole-file-changes
or something?Obviously it should be used with care - there are often cases where there are 2 commits that change a file and git absorb will have no way to know which one introduced the requirement for the import, but it might be a useful feature.