3

I am trying to understand what a process that uses pull requests on a self-hosted git repo would look like (if it is even possible).

Say I have two branches, feature and master. A bunch of work is completed on the feature branch, and I want to submit a pull request for the changes to be reviewed before being merged into the master branch. As far as I understand it, the steps would be something like:

git push feature (developer pushes commits on feature branch to remote repo)

git request-pull <start commit> feature <end commit> developer creates the pull request. But I'm not entirely sure whether <url> should refer to master or feature branch?

Reviewer would then retrieve the pull request somehow, and if they are happy with it then they would merge the feature branch into master with git merge feature

Is such a workflow possible with self-hosted git? I haven't really used the likes of Github but I know they have a lot of GUI features to manage this sort of thing.

Summary of questions:

  • what should <url> be in the git request-pull command?
  • how does a reviewer receive the pull request?
  • is there a way to view a history of pull requests?
  • is there a way to have someone specific review the pull request?
  • "pull request" is not a feature of Git. It is a way of using it. Some hosting services, for example GitHub, provide it as a feature. – mkrieger1 Jan 08 '20 at 16:04
  • @mkrieger1 Here is the [git request-pull docs](https://git-scm.com/docs/git-request-pull). However it is not clear to me on how or whether it can be used in a self host git repo, or if it only exists for Github et al. I thought it would provide a nice way to show the changes being made for review at least, but maybe I'm wrong. – whatamidoingwithmylife Jan 08 '20 at 16:28
  • Interesting, I've never heard of that command. It is not related to GitHub. As far as I understand you would insert the URL of your self-hosted repository. – mkrieger1 Jan 08 '20 at 16:36
  • Possible duplicate of https://stackoverflow.com/questions/49423624/difference-between-git-request-pull-and-pull-request. – mkrieger1 Jan 08 '20 at 16:57

1 Answers1

0

As far as I understand it, the steps would be something like:

git push feature (developer pushes commits on feature branch to remote repo)

git request-pull <start commit> feature<url> <end commit> developer creates the pull request.

Reviewer would then retrieve the pull request somehow, and if they are happy with it then they would merge the feature branch into master with git merge feature

These are exactly the steps for the pull request workflow.

The git request-pull command simply prints a nicely formatted summary of the changes from <start commit> to <end commit> which you can then send to a reviewer (for example, by email) to notify them. It doesn't send anything on its own.

You would insert the URL of your hosted Git repository as <url> so that the reviewer knows where they could find your commits. <start commit> would be the last commit before those which make up your changes. <end commit> would be the latest commit, i.e. feature.

You can experiment with the command locally by inserting . as <url> (i.e. the directory you're in).


Summary of questions:

  • what should <url> be in the git request-pull command?

The URL of your hosted repository (can be a local directory name). (It can be anything, the command will only warn you if there is no repository containing the mentioned commits at that location.)

  • how does a reviewer receive the pull request?

By sending them the output of the command.

  • is there a way to view a history of pull requests?

Not with git request-pull, you have to keep track of them yourself.

  • is there a way to have someone specific review the pull request?

By sending the output of git request-pull to them.

mkrieger1
  • 19,194
  • 5
  • 54
  • 65