google / git-appraise

Distributed code review system for Git repos
Apache License 2.0
5.12k stars 145 forks source link

Add support for detached comments #102

Closed ojarjur closed 4 years ago

ojarjur commented 4 years ago

This change adds support for "detached" comments; comments that are not attached to a code review.

Instead, we anchor these comments at a file path relative to the repository.

In order to do that, we add the concept of a "well-known commit" which can be deterministically recreated and corresponds to a specific path. Detached comments are then attached to their corresponding well-known commit rather than a review.

When we use a well-known commit for the first time, we add it to the archive ref so that the attached git-notes do not get pruned. To prevent the archive ref from growing indefinitely, this change also includes an enhancement where trying to archive an already-archived object is a no-op.

This fixes #97