tummychow / git-absorb

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

Alternative output format when printing the created fixup commits #126

Open jez opened 2 weeks ago

jez commented 2 weeks ago

When making a fixup commit manually with git commit --fixup, the output looks like this:

❯ git commit --fixup 1f267d4ee8
[jez-dispatch-component-tree 4e12ee8fc7] fixup! Make it a proper tree, using `variant`
 1 file changed, 5 deletions(-)

This shows the first line of the commit message that will be fixed up.

By comparison, git absorb shows the (full) commit hash of the commit that was just created, plus some other information in a more machine-friendly format:

❯ git absorb
Oct 23 16:52:33.562 INFO committed, header: +0,-5, commit: b23cb295077cf3dc3c4c659bea7fe8ad6a6a6b0d

When trying to figure out whether git absorb picked the right commit, I basically always have to run git absorb then git log to see whether it created fixup commits for the commit I was expecting, because the above output doesn't tell me that.

Some suggestions for the output, in decreasing order of my preference for how much I'd like them:

Depending on how committed you are to preserving the current output, any or all of these changes could be added behind a flag, either opting into or out of the new presentation.

I would contribute these changes myself, but UI changes like this are stylistic and I would rather double check before contributing.

tummychow commented 2 weeks ago

ayyyy jez what's up. here's my thoughts:

pr welcome