Skip to content
This repository was archived by the owner on Nov 18, 2021. It is now read-only.
This repository was archived by the owner on Nov 18, 2021. It is now read-only.

Don't lose commit-related comments on rebase #443

Open

Description

@GrahamTheCoder

Problem: If I rebase my pull request to track the latest master, the hashes change, so any comments on the old commits are no longer visible on the pull request. Sometimes PRs take a long time to merge, and it's very useful to be able to rebase and keep comments.

Fix option 1: When commenting on a commit currently in a pull request, that comment should be saved permanently to the pull request conversation with a message like "formerly part of this PR"

Fix option 2:

  • Abolish commit comments
  • (Optional) Allow commenting on branches before they're opened as pull requests
  • (Optional) Make what were previously commit comments appear as comments on every branch they're part

If it's easier: When that commit is no longer in the branch the PR tracks, show the comment the same way as you show other "outdated diffs".

Workaround: Get everyone who comments to comment directly on the pull request.

Activity

  1. cirosantilli commented on Aug 14, 2015

    @cirosantilli
    Collaborator

    Why not comment on the pull request instead?

  2. GrahamTheCoder commented on Aug 15, 2015

    @GrahamTheCoder
    Author

    I've updated the description in response to your question.

    They aren't my comments, they're other peoples, it'll be hard to get everyone I ever work with to consistently ignore the comment on commit feature. Perhaps if there was a quick link from a commit to the diff it causes on any pull requests it's in that'd work.
    Why allow commenting on commits in the first place if the comments will be lost?

  3. MHova commented on Dec 10, 2015

    @MHova

    My team prefers to comment on the commits themselves during PR reviews because we like to read PRs commit-by-commit so that we can follow along with the author's thought process. We also prefer rebasing to merging and we find it incredibly painful to lose commit comments when rebasing.

    Would it be possible to automatically attach commit comments to the PR itself? And if a line in a commit will be changed by a later commit in the same PR, the reviewer can be shown a warning before s/he writes a comment on that line?

  4. codemac commented on Jan 27, 2016

    @codemac

    This is incredibly frustrating. Github really encourages this style of review (many commits in a pr showing progress over time) but many projects dislike having the history of review meddle with their ability to git-bisect.

  5. mdentremont commented on Feb 18, 2016

    @mdentremont

    +1 (@MHova that describes our situation as well)

  6. evanrmurphy commented on Mar 10, 2016

    @evanrmurphy

    This is a real gotcha with rebasing pull requests on GitHub. Would love to see this issue addressed.

  7. nvachhar commented on Jul 29, 2016

    @nvachhar

    In our team's workflow, we have code review comments addressed by adding new commits to the existing branch (and PR). Reviewing only what's changed since the last time you reviewed a change is useful in our flow. I'd even love being able to comment on a range of commits (i.e., all the commits since the last time I've reviewed), but not losing comments on rebase would be a huge step for us.

  8. donquixote commented on Sep 16, 2016

    @donquixote

    Two solutions I can see:

    1. Leave the original PR unchanged, close it, open a new PR.
    2. Create a tag at the original top of the PR, then rebase. The tag makes sure that comments are not deleted.

    I have not tried this second solution with github. But I imagine it should work..

  9. babineaum commented on Sep 19, 2016

    @babineaum

    @GrahamTheCoder Hey looks like some of the aspects in your request here were implemented in the new "review comments" feature on github. We noticed now that in-line comments are no longer removed after being addressed with a new commit and are kept in the history on the "Conversation" tab, with the one minor(but glaring) issue that it doesn't mark the old comment in anyway like you suggested with "formerly part of this PR". We are feeling the frustration of the lack of documentation on these new "review comments" changes and how they were implemented. We would like to join the fray and request some feedback be heard from the community. At the conference last week (great time) we heard that they are "listening" and that they are going to do a better job to publish their public roadmap. They are going to be vague but at least get the idea across of what they are working on in the future.

    UPDATE: Its actually called "code review" https://github.com/blog/

  10. GrahamTheCoder commented on Sep 20, 2016

    @GrahamTheCoder
    Author

    Yes I did notice that review comments are now immutable parts of the conversation, whereas line comments are not.

  11. babineaum commented on Sep 20, 2016

    @babineaum

    Hey Graham,
    I actually think that the line comments are also immutable now too.

  12. GrahamTheCoder commented on Sep 20, 2016

    @GrahamTheCoder
    Author

    Ah, I haven't actually tested them in a rebase situation. I just noticed you couldn't edit/delete review comments but could still edit/delete line comments.

  13. jamiesalts commented on Oct 10, 2016

    @jamiesalts

    Comments not going away when a commit changes that line is incredibly frustrating.

  14. carlescufi commented on Jun 29, 2018

    @carlescufi

    +1 for this one, our project uses a rebase-driven PR approach as well. Supporting push -f properly so that rebased PRs display their history would be a major help for us.

  15. aspiers commented on Jun 29, 2018

    @aspiers
    Collaborator

    IIUC this issue is a symptom of the broader issue that amending PR branches via force-push causes unreachable commits to be garbage-collected (#997). It's not just during rebase, but any force-push.

  16. carlescufi commented on Jun 29, 2018

    @carlescufi

    @aspiers it is indeed. I just mentioned the rebase-driven approach because typically you either "pile-up" commits in the PR or you rebase (or amend if it's a single commit), and it's the latter that doesn't play nice with GitHub today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions