tummychow / git-absorb

git commit --fixup, but automatic
https://crates.io/crates/git-absorb
BSD 3-Clause "New" or "Revised" License
3.35k stars 59 forks source link

Feature Suggestion : attribute the fixup to the last commit that also modified this file #76

Closed joihn closed 1 year ago

joihn commented 1 year ago

I usually organize my commit by files: 2 commits of the same feature-branch will not modify the same file.

Sometime, git-absorb can't find a commit for fixup, because the fixup adds a new line somewhere. intead of doing a lookup by line, I suggest looking for the last commit that modified the file, and attributing the fixup to it.

This methodology should off course not be the default but be triggered via an args.

tummychow commented 1 year ago

duplicate? https://github.com/tummychow/git-absorb/issues/56

nunojsa commented 1 year ago

Yeah, +1 for this feature... @tummychow how would you consider this feature? Like a "good first feature/issue"? Right now I don't really have the time but I might give it a try in the future if not done in the meantime. I do want to start learning some rust and having specific things/goals is always a good motivator :)

tummychow commented 1 year ago

@nunojsa git-absorb was my first practical rust project, so in terms of language-induced difficulty, i don't think it's any harder than any other "first rust project". functionally, the implementation is straightforward if you understand the concept of commuting patches. see my comment on #56 (and let's go over there if you want to discuss it further).