3 ms·
It's actually really easy to create a "patch", so people usually create small "patches" and send them to people if they need any feedback on those. A "patch" i
by hknd 8y ago
It's actually really easy to create a "patch", so people usually create small "patches" and send them to people if they need any feedback on those.
A "patch" is actually just a commit (actually a changelist) which can be viewed, commented and edited in the browser based code review and IDE tool.
Imho I find it much easier to get an url of a "patch" and comment on it inline, instead of having to checkout a branch etc.
If you have a question to a specific example I'm happy to answer it in the way it would've been done within Google/Facebook.
- weinzierl 8y agoThank you, I appreciate your effort to help me understand this better and our exchange helped me to make progress. One thing I infer from your answer is that it seems that there is an established process and dedicated tooling for working with patches at Google. I think a lot of my pain with patches stems more from the lack of process and lack of an agreement on formats and standards in my environment than from the use of patches per se. Where I still see an advantage of branches is that they facilitate documentation of what has been done by whom and when. All of this documentation is in the same place and form as the documentation of changes in the trunk. It all is in commit messages whereas patches are only documented somewhere else, possibly in the Email or IM used to send the patch. Even if most of the branch documentation does not survive on trunk when we squash the final merge it is still there and easy to find as long as the branch doesn't get deleted. When I want to look up why I applied a certain patch I'll have to dig through my messages. I think that makes it harder to work with patches than with branches.
- hknd 8y agoA "patch" in Google/Facebook/Twitter is the same as a commit. It has a (mostly) descriptive commit message, references to bug tickets and might contain links to documentation, screenshots and mocks. You basically work on a "patch" (changelist), get feedback from others and send it out to review at the end. Before you can submit (commit) it, you'll have to sync to "head" (to have the latest changes) and run all tests. ^ most of this happens automatically, and as most changelists ("patches") are small, this happens very fast and async in the background.
- ranma42 8y agoFWIW coreboot is an open-source project that uses a similar style, where you need to upload your change to the review tool (https://review.coreboot.org/ https://review.coreboot.org/, which is using gerrit https://www.gerritcodereview.com/ https://www.gerritcodereview.com/) and people comment and LGTM in there and then it gets committed to the master branch once everything looks good.
- brown9-2 8y agoI think what you are missing is that Google's SCM has different concepts and terms than Git. Google's system is derived from Perforce, which has the concept of a changelist (think: commit), which can be "pending" and stored on the server for review/cloning by other developers: https://www.perforce.com/perforce/doc.051/manuals/p4guide/07_changelists.html https://www.perforce.com/perforce/doc.051/manuals/p4guide/07... This allows you to share work without (in Git terms) pushing to master. Branches in Perforce-like systems tend to be more heavyweight and permanent (IIRC you have to branch an entire path of files, it is not the same as the Git concept of "branch" which is just a commit that points to another parent commit). You can think of the system as enabling you, in Git terms, to create pull requests without the creation of an underlying branch.