Live data from Hacker News

Correct Git commits with git-autofixup

symflower.com

1–10 of 67 posts

Re: Correct Git commits with git-autofixup

#3
git-autofixup definitely changed my daily development life.... I mostly use it with this Git alias

``` autofixup = !"autofixup origin/master --exit-code; test $? -lt 2 && GIT_SEQUENCE_EDITOR=true git rebase -i --autosquash $(git merge-base HEAD origin/master)" ```

Works almost every time perfectly, and when not i always get a comment during a code review.

Re: Correct Git commits with git-autofixup

#4
post #2

git-absorb is another implementation: - https://github.com/tummychow/git-absorb - https://lib.rs/crates/git-absorb

Can anyone give a comparison of the two from experience?

I'm painfully familiar with the problem they solve and am delighted to discover they exist.

I'd love some input about how they differ.

Re: Correct Git commits with git-autofixup

#7
For this issue and so many others, everyone should just get comfortable with interactive rebase. Crutches like this trap you in this space of never really learning git. And that's a tragedy. All because you're impatient? Afraid?

Re: Correct Git commits with git-autofixup

#8
post #5

If you're an Emacs user, I must recommend magit ( https://magit.vc/ ) - the interactive rebasing (including squashing/fixups) is one of the best UIs (overall, not just git) I've seen in my life. I'd switch away from Emacs but magit keeps me hooked!

Does Magit have a similar feature to what is discussed in this article? Specifically “magically figure out which previous commit these changes should be combined with”?

Re: Correct Git commits with git-autofixup

#9
post #7

For this issue and so many others, everyone should just get comfortable with interactive rebase. Crutches like this trap you in this space of never really learning git. And that's a tragedy. All because you're impatient? Afraid?

Learning rebasing is one thing but wasting hours every week on rebasing because you are doing the same thing over and over again is another. When i do a one line fixup i just do not want to figure out the correct commit and then rebase i just want it to happen because i already know how i would rebase that: you just use git-autofixup or other similar tools discussed here to get it done.

Re: Correct Git commits with git-autofixup

#10
post #3

git-autofixup definitely changed my daily development life.... I mostly use it with this Git alias ``` autofixup = !"autofixup origin/master --exit-code; test $? -lt 2 && GIT_SEQUENCE_EDITOR=true git rebase -i --autosquash $(git merge-base HEAD origin/master)" ``` Works almost every time perfectly, and when not i always get a comment during a code review.

> when not i always get a comment during a code review.

Why during CR? Is the error not obvious to you? You should be able to check the results of your changes before pushing, right?

Post reply on HN