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

Dev/add new match file flag #80

Closed nunojsa closed 1 year ago

nunojsa commented 1 year ago

Add new option to match the current hunk file with the first commit touching that file as discussed in #56. Hence, these PULL should fix issue #56.

@tummychow this was suspiciously easy to add and I'm not so sure about the solution. From what I understood, as we pass the first match expression, then we know the current hunk file is touched by that commit and hence, we can just bail out. not sure if there's any subtle tie I'm missing. As stated in #76, I'm very very new with rust.

I was also wondering if we should keep the same mechanism as before (doing the commutations) and just add this flag check in the end of the loop so that, even with the flag, we use it as a fallback mechanism.

tummychow commented 1 year ago

this was suspiciously easy to add and I'm not so sure about the solution

well i did say the implementation was straightforward ;) thanks for the pr.

I was also wondering if we should keep the same mechanism as before (doing the commutations) and just add this flag check in the end of the loop so that, even with the flag, we use it as a fallback mechanism.

eh, doesn't make much difference to me. i have a minor stylistic preference for seeing the least specific log message last (ie all the other forms of commutation should be checked first, so if we have verbose logging, we can see the most specific explanation for why the commit doesn't commute), but not enough to make you edit the pr.