Pull Request Files changed is empty even though commits show otherwise

Issue #7582 invalid
created an issue

No description provided.

Comments (9)

  1. Michael Forbes

    This might be a similar example:


    I am pulling from one branch to a branch where all the files have been deleted. The diff should show that all the files are being added but is empty. Here is the hg diff:

    $ hg diff -r code_review_2_clean -r code_review_2
    diff --git a/README.rst b/README.rst
    new file mode 100644
    --- /dev/null
    +++ b/README.rst
    @@ -0,0 +1,13 @@
    +Dummy Repository
    +Here we are testing workflows for code review.
    +The idea here is to create a "code_review" branch with no code that shares a
    +common ancestor with the default branch, then one can make PR's to this empty
    +I played with making starting from a "code_review" branch, but to fully
    +"approve" a PR (so it no-longer appears as needing attention), you need to
    +actually merge it, which makes your repository messy.  A better solution is to
    +just create a new branch when the code review is needed.
    diff --git a/tst/file.py b/tst/file.py
    new file mode 100644
    --- /dev/null
    +++ b/tst/file.py
    @@ -0,0 +1,1 @@
    +"""Does nothing"""
  2. Brian Nguyen

    Hi Michael,

    There is a difference between a diff between two commits and a pull request. In hg diff, you are shown the diff between the two commits in isolation.

    In a pull request, you are shown the diff if the two commits were to be merged. Rather than diffing the two commits' contents, it looks at the difference between the histories of the two commits.

    In the case of the pull request, this is the command that is effectively run:

    $ hg merge -P -r code_review_2_clean -r code_review_2
    changeset:   7:b63069e8b4be
    branch:      code_review_2
    date:        Sat Feb 01 13:11:57 2014 -0800
    summary:     Start code review 2

    This says that the only commit that will be merged into the branch code_review_2_clean from code_review_2 is b63069e8b4be.

    There were no changes included in the commit, and that is why the pull request is empty.

    I hope this helps.

    Cheers, Brian

  3. Michael Forbes

    Drat. I guess that means the only way of generating a clean PR for the purpose of a mini-code review is to pull into a detached branch or a completely new repo? I was trying to find something that would only create a "local" modification to the history when accepted. Any other suggestions?

  4. Michael Forbes

    I appreciate that (and am trying to regularly do that). The problem I am trying to solve is that, once in a while, I want a place to comment on a whole file - not just the changes (which can be distracting). The commit comments here provide one option, but, 1) the changes are the wrong way, 2) I don't yet see and easy way to update the code during the review (isolating those commits in a separate branch) and then reviewing the changes.

    Your comment gives me a few suggestions of how I might proceed though, so I will play arround some more. Thanks.

  5. Log in to comment