Live data from Hacker News

Correct Git commits with git-autofixup

symflower.com

61–67 of 67 posts

Re: Correct Git commits with git-autofixup

#61
post #4

Earlier quoted context omitted.

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.

I have looked at both but only used git-autofixup. Some observations: - git-autofixup has a changelog - git-autofixup includes sober, technical documentation that actually explains how it works. OTOH, git-absorb has a great elevator pitch for users that are not so familiar with Git. - git-autofixup does not have unresolved bugs, unlike git-absorb - git-absorb creates fixup commits for the last 10 commits, which seems…

Great information. Thank you!

Re: Correct Git commits with git-autofixup

#62

Earlier quoted context omitted.

Is there one of these `@{}` tags that means "the point where this branch split off from master"? That'd be very useful, because that's usually the scope of my rebases.

I recommend reading the git-rev-parse(1) man page in full, it’ll give you good ideas for this sort of thing. What you’re looking for could be spelled $(git merge-base HEAD master) (that’s a subshell invocation, outputting a single commit ID). In some circumstances dotted range notation might do: master.. includes all the commits after master and HEAD diverge. That’s good for logging, for example, but not so useful fo…

That's helpful, thanks! I already do use merge-base, I was wondering if there's a builtin shortcut as I hadn't seen anything in the rev-parse manage.

Re: Correct Git commits with git-autofixup

#63
post #59
post #22

Earlier quoted context omitted.

Yep. I have that practice too and i thought that was good enough but with git-autofixup and my posted alias i am down to under one second. So it will save you 1-14 sesconds of your life with every fixup you do... unless it cannot be done automatically. Try it and let us know what you think :-)

Challenge accepted.

I tried git-absorb (git-autofixup is Perl? Installing things with CPAN needs sudo? Sorry... I don't have a good Perl situation and don't care to have one.) and it did not immediately work correctly. Maybe git-autofixup is better; idk. Also I misunderstood; I'm expected to `git add` before using these tools - after that, the commit/rebase only takes me a few seconds; I already knew what commit it was bound for when I staged the changes.

Re: Correct Git commits with git-autofixup

#64

Earlier quoted context omitted.

I rely on code review tools that can show me the difference between two patch sets. I really love Phabricator for that ability - push a set of commits and each gets a review. Absorb any fixes, push and suddenly each commit has a new version that you can diff against old ones if you care. It makes reviewing the patch set in totality trickier. However, since I’m practice you want individual commits within a set to be s…

In https://reviweable.io , you can have both matching-commit diffs and whole-PR diffs, all in the same review.

I think you typo'ed your plugged domain name. :)

Re: Correct Git commits with git-autofixup

#65
post #64

Earlier quoted context omitted.

In https://reviweable.io , you can have both matching-commit diffs and whole-PR diffs, all in the same review.

I think you typo'ed your plugged domain name. :)

Dammit! I mean, uh, it was a clever marketing ploy to attract attention and you totally fell for it. Yeah, that's the ticket.

Re: Correct Git commits with git-autofixup

#66
post #63
post #59

Earlier quoted context omitted.

Challenge accepted.

I tried git-absorb (git-autofixup is Perl? Installing things with CPAN needs sudo? Sorry... I don't have a good Perl situation and don't care to have one.) and it did not immediately work correctly. Maybe git-autofixup is better; idk. Also I misunderstood; I'm expected to `git add` before using these tools - after that, the commit/rebase only takes me a few seconds; I already knew what commit it was bound for when I…

git-autofixup can also be installed by simply downloading the script[1], giving it execute permissions, and putting it somewhere in your PATH. It needs perl 5.8.4+, which is very old, and only depends on the standard library. Git ships with a Perl interpreter on Windows.

If there are any staged changes, git-autofixup only fixes those up and ignores any unstaged ones; otherwise it tries to autofixup all unstaged changes.

[1]: https://github.com/torbiak/git-autofixup/blob/master/git-aut...

Re: Correct Git commits with git-autofixup

#67
post #11

Earlier quoted context omitted.

> 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?

I/we do but sometimes you just overlook something especially if there are a lot of changes. But having someone else review what you do almost completely removes that problem. I usually do not look through all commits again when a basic review already happend and i "just" integrate the review comments. That is where for me personally these problems happen that git-autofixup is sometimes wrong but in over a few thousan…

Cool, I'm glad it's working out for you. Due to my workflow at my current job I haven't actually had much occasion to use it since writing it, so I'm not that confident about how good the hueristics are.

Do you generally use the default --strict setting?

Post reply on HN