The Case Against Pull Requests
dev.to
dev.to
Sure there's some small overhead to create a PR, but the process proposed here is essentially treating single commits as though they ara PRs.
How does that work with CI? I think it's always better to wait until a feature is 'done' and passes tests, before asking others to spend time reviewing it.
A bigger issue is perhaps that a lot of code metadata, ie feature descriptions, design rationales, back-and-forth conversations to hone the code, etc ends up only in the pull request, which is stored on some commercial change-management system, ie github, gitlab, etc, rather than in the intrinsic git history.
He's describing the workflow that Phabricator uses but not explaining the benefits very well. He also seems to be oblivious to the fact that there already exists an open source platform built to do what he's describing.
Namely?
I guess my last sentence there doesn't explicitly state that but I assumed if anyone clicked on that link they would get the picture.
Create a new branch from master.
Checkout the newly created branch.
Create and push your fix commit.
If everything is alright, file a pull request.
Get it reviewed and merged.
Switch back to master.
That seems like a lot of unnecessary branch switching. I'm hardly ever on master. Checkout with -b option, fetch --prune, rebase onto origin/master.Edit: bonus tip `git checkout -` works like `cd -` but for branches.
Oooh, thanks!!!
Big software is going to run into complexity sooner or later. You don't need superhuman skill to manage it but no single person will be able to hold the whole thing in their head.
An interesting approach to handling the combinatorial explosion of flags, if you desire to test all possible interactions (even though you don't typically need to) is instead limit yourself to the subset of all pairs of interactions (all-pairs testing).
My team tends to run like this. Many WIP PRs, and if nobody reviews and merges it in a timely fashion, we tend to go ahead and merge it anyway, after asking in slack if anyone wants to take a look before merging. PRs are an add-on to the process to help communication, not a gatekeeper to moving the codebase forward.
Now, without CI/CD, I could see it as far more painful. But I'm not sure that has anything to do with PRs. Even taking PRs out of the mix, you're still having to get it to production.
Here are a few tools:
- hub https://github.com/github/hub
- lab https://github.com/zaquestion/lab
- git-extras https://github.com/tj/git-extras
If (a), then what happens if that commit needs to be reworked on? Will it lead to another commit on trunk?
If (b), then what happens if the trunk has moved by the time your commit got approved?
When you get approval, you can submit your commits and Gerrit will try to merge them (even if the trunk has moved; you can say it's sort of cherry-picking on the trunk). If it can't merge the commit, you'll have to take a pull and push your commit again by resolving conflicts.
Edit: Tweaked the post a little to make it more clear.
To me OP's flow just reminds me of a particular way of doing development with perforce. You make your changes against one branch everyone works from, move them to a new 'pending changelist', then send the diff to another system for review. (You might even use perforce's own swarm tool by making a 'shelf' of your pending changes and starting a review from that.) Rework is done, you send over the new diff/overwrite the shelf, reviewers can see diff-of-diffs (tracked only by the review tool) and overall-diff. Eventually if all is well (or if your review has been in limbo and no one's going to argue if you merge without review anyway) you commit the pending changelist. (Which might involve in reality sending your diff again to another service, and that service tries to integrate and build/run tests using a new changelist in your name and only finalizing a commit to the master branch with that.)
I wouldn't recommend it. Not that I think the popular pull request model is much better, but at least you have options, though that's more to do with using a DVCS. I'd like to sometime try Fossil with a team, which aims to have the technical benefits of DVCS but with the tradeoff of cathedral vs bazaar being given back to the cathedral style, which is what I see pull requests as popularly done on github as clumsily trying to accomplish.
However, I feel that your technological choice is a bit nitpicking. I believe that creating an alias for 'git checkout master; git pull; git checkout my-branch' and another alias for 'git push; curl .../review' would essentially implement the same workflow as you suggest. (Granted, in some organizations, creating a branch is a heavy process: It requires opening a JIRA ticket, the branch needs to be well-named, etc. but these are not technological issues.)
How is this different from what you are suggesting?