Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why can't I create an empty Pull Request for discussion prior to developing changes?

Tags:

git

github

I want to branch from master and immediately create an empty Pull Request to discuss implementation details of a specific feature.

After selecting my branch and clicking "Pull Request", Github claims "Nothing to Compare" and doesn't offer any "Create Pull Request" button.

Github's own documentation on Flow states (click the right-arrow twice):

You can open a Pull Request at any point during the development process: when you have little or no code but want to share some screenshots or general ideas, when you're stuck and need help or advice, or when you're ready for someone to review your work.

But their own documentation on Pull Requests here states:

Pull requests can only be opened if there are differences between your branch and the upstream branch

I would like to utilise Github collaboration features with my team prior to committing changes to code. As we understand it, Pull Requests are for code changes and discussion of implementation details (ie: the "solution"), while Issues are higher level, for discussing features/bugs (ie: the "problem").

Am I misunderstanding these things?

Edit:

Apparently I can circumvent the process by changing the branch with an empty commit:

git commit --allow-empty -m "make pull request"

but I am trying to better understand why my (default) decision to create an empty PR was wrong in the first place, and why their documentation appears contradictory. Is there a strict "discuss code explicitly in PRs" policy or similar? Is this a contentious issue?

Update

Github have released Draft Pull Requests, but (alas) they can't be created if the 2 branches are identical.

like image 729
Alex McMillan Avatar asked Oct 05 '17 03:10

Alex McMillan


People also ask

How do I enable a pull request?

To accept the pull request, click the Pull Requests tab to see a summary of pending pull requests. If you are happy with the changes, click Merge Pull request to accept the pull request and perform the merge. You can add in a comment if you want. Once you click Merge Pull request, you will see a button Confirm merge.

When should I Create a pull request?

When you use branches or forked repositories to work on a separate line of code from the codebase, you can use pull requests to get your code reviewed and merge your changes from Bitbucket Cloud. When you're ready to start a discussion about your code changes, it's time to create a pull request.

How do I fix pull request changes?

The current way to update a pull request is to click on the “Edit” button along the other pull request action buttons. This will bring you to the update pull request page where you can make changes to the title, description, reviewers and specify whether to close the branch after the pull request has been merged.


1 Answers

The documentation talking about "no code" dates from... December 2013:

enter image description here

It is possible they changed their policy in the official documentation, which is up-to-date and apply to github.com as well as GitHub Enterprise.
So you might want to contact GitHub support to mention this inaccuracy.

like image 189
VonC Avatar answered Oct 12 '22 16:10

VonC