tummychow / git-absorb

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

Elevator pitch code in the readme doesn't work #121

Open gigatexal opened 4 hours ago

gigatexal commented 4 hours ago

Firstly, thank you for this free tool. It has sent me into a git fixup, git rebase rabbit hole and has expanded my knowledge of a git a bit more.

I was also won over by the first part of the elevator pitch:

https://github.com/tummychow/git-absorb?tab=readme-ov-file#elevator-pitch

git add $FILES_YOU_FIXED
git absorb --and-rebase

I created a silly git repo, added a text file, committed it, then in another edit added another line, ran git absorb --and-rebase and it all worked as expected. There were no fixup! commits in the log.

BUT

git add $FILES_YOU_FIXED
git absorb
git log # check the auto-generated fixup commits
git rebase -i --autosquash master

Doing the above left the file in the right state of course but left the fixup! init commit in the log :-/ where I expected them to be equivalent i.e the fixup! init commit to be squashed.

I might be doing something wrong here so apologies if this is user error.

Running on git v 2.46.2 on M3 MacBook Pro on MacOS 15

tummychow commented 4 hours ago

i'm going to need more than that to reproduce the issue. what was the exact state of the repo in each case? (or are you saying you saw the fixup commit in the git log output before running git rebase? that's kind of the whole point. the rebase command is what squashes away the fixups)