News for hackers. Stuff that matters.
Re:Abandoning Gitflow and GitHub in favour of Gerrit by timr on Tuesday April 05, 2016 @02:41PM (#11433147)
I've been working on a code-review tool that does exactly what you want: https://www.omniref.com/code_review

It works seamlessly with GitHub, and provides code reviews that end up "sticking" to your code, and documenting its development. Every pull request you create can become a review automatically, or you can pick-and-choose which pull requests to review. And you don't lose reviews or comments when you push to a branch under review.

Also, it lets you dive into the history of a single line of code. For example, here's a line from GitHub's libgit project, annotated with the pull request that created it: https://www.omniref.com/repositories/libgit2/rugged/files/li...

Re:Abandoning Gitflow and GitHub in favour of Gerrit by eridius on Tuesday April 05, 2016 @03:46PM (#11433728)
Looks promising. Does it handle force-pushes to PRs? It says it doesn't lose comments when pushing new commits, but it doesn't mention how it handles history rewriting.
Re:Abandoning Gitflow and GitHub in favour of Gerrit by timr on Tuesday April 05, 2016 @06:33PM (#11435124)
It doesn't lose track of state when you force push. You'll see the old commits in the history, and the force-pushed commit, and the comments will still be on the old commits, the issues will still be active, etc. This isn't perfect, but it's a start, and it's better than GitHub.

It's on my feature short-list to write the code to make a best-effort to migrate review comments for rebased commits. But this will always be a bit of a heuristic, and error-prone. If the diff changes substantially as part of a rebase, it's really hard (i.e. theoretically impossible) to always know where to move annotations.

Ultimately, all you really know when you're on the receiving end of a force-push is that some commits were orphaned by a new commit. You can detect this and identify the orphaned commits, but knowing where to move the sticky notes on those orphaned commits is challenging.