﻿<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ja">
	<id>https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=Dev%3ADoc%2FTools%2FCode_Review</id>
	<title>Dev:Doc/Tools/Code Review - 版の履歴</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=Dev%3ADoc%2FTools%2FCode_Review"/>
	<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:Doc/Tools/Code_Review&amp;action=history"/>
	<updated>2026-05-19T02:55:52Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=Dev:Doc/Tools/Code_Review&amp;diff=105105&amp;oldid=prev</id>
		<title>Yamyam: 1版 をインポートしました</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:Doc/Tools/Code_Review&amp;diff=105105&amp;oldid=prev"/>
		<updated>2018-06-28T19:43:33Z</updated>

		<summary type="html">&lt;p&gt;1版 をインポートしました&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ja&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← 古い版&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;2018年6月28日 (木) 19:43時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;ja&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(相違点なし)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Yamyam</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=Dev:Doc/Tools/Code_Review&amp;diff=105104&amp;oldid=prev</id>
		<title>wiki&gt;Fsiddi: Fix broken links</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:Doc/Tools/Code_Review&amp;diff=105104&amp;oldid=prev"/>
		<updated>2018-04-07T18:00:16Z</updated>

		<summary type="html">&lt;p&gt;Fix broken links&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Code Review =&lt;br /&gt;
&lt;br /&gt;
[https://developer.blender.org/differential Differential on developer.blender.org] is an online tool for code review, used by developers with commit access to review each others code, and by other developers to submit patches.&lt;br /&gt;
&lt;br /&gt;
Doing code review improves the quality of commits. With more eyes looking at the code we can prevent bugs, and having your code reviewed also generally keeps you on your toes. If mistakes slip through anyway, [https://developer.blender.org/audit/ Audit on developer.blender.org] can be used to notify developers and review code after it has been committed.&lt;br /&gt;
&lt;br /&gt;
== Guidelines ==&lt;br /&gt;
&lt;br /&gt;
The intention is that code review is used for most non-trivial commits. Some guidelines:&lt;br /&gt;
&lt;br /&gt;
* The typical reviewers with final approval should be module owners, but anyone can and is encouraged to participate.&lt;br /&gt;
* Code reviewers should try to either accept, request changes, or reassign to another reviewer quickly, to unblock the developers working on their features. This makes the process more inviting to new developers and more usable for existing developers.&lt;br /&gt;
* Developers submitting code should make it easy for people to review their code. That means you do not submit huge patches, but break up your work into multiple smaller commits and reviews. Code refactoring, new features, bug fixes, etc. should generally be submitted as separate code reviews. You can have them as separate commits in the same local Git branch.&lt;br /&gt;
* If there are bigger design question to solve, open a Patch or Design task first, so that code review can focus mostly on the implementation.&lt;br /&gt;
&lt;br /&gt;
== Use a Local Branch ==&lt;br /&gt;
&lt;br /&gt;
When you are going to submit code for review, it is best to commit that code in a local Git branch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git checkout -b some-new-feature&lt;br /&gt;
# ... make changes to code ...&lt;br /&gt;
git commit .&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next step is to create a revision in Differential, and there are two different ways of doing this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Upload a Diff ==&lt;br /&gt;
&lt;br /&gt;
The easiest way to create a revision in Differential is to [https://developer.blender.org/differential/diff/create/ Create a Diff] and upload a diff file there. For detailed information on how to work with such files, see the [[Dev:Doc/Process/Patches|Patches and Diffs page]].&lt;br /&gt;
&lt;br /&gt;
In short, Differential expects standard &amp;lt;tt&amp;gt;git diff&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;git show&amp;lt;/tt&amp;gt; output. If your changes are committed in a local branch, this is the command that will work.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# generate a diff from some-new-feature branch&lt;br /&gt;
git diff master...some-new-feature &amp;gt; some-new-feature.diff&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the reviewer requests changes, you can use Update Diff on the code review page to upload a new patch.&lt;br /&gt;
&lt;br /&gt;
== Use Arcanist ==&lt;br /&gt;
&lt;br /&gt;
Phabricator comes with a command line tool called &amp;lt;tt&amp;gt;arc&amp;lt;/tt&amp;gt; which can be used to quickly submit, apply, and land revisions. For developers that do code reviews often this is much more efficient than uploading and downloading diffs, but requires some setup and use of command line tools.&lt;br /&gt;
&lt;br /&gt;
==== Installation ====&lt;br /&gt;
&lt;br /&gt;
See the [https://secure.phabricator.com/book/phabricator/article/arcanist_quick_start/ Arcanist Quick Start].&lt;br /&gt;
&lt;br /&gt;
Basically you need to install php, get arcanist from its git repository, and put the arc command in your PATH.&lt;br /&gt;
&lt;br /&gt;
You do not need to add a &amp;lt;tt&amp;gt;.arcconfig&amp;lt;/tt&amp;gt;, this is already in the repository.&lt;br /&gt;
&lt;br /&gt;
Next you need to authenticate yourself. Run this command and follow the instructions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
arc install-certificate&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Send a Patch ====&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;tt&amp;gt;arc&amp;lt;/tt&amp;gt; is installed and all your code changes are committed in a branch, sending the changes for review is quick, simply run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git checkout some-new-feature&lt;br /&gt;
arc diff&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be prompted to add a title on the first line, and an optional extra summary and reviewers. If this revision relates to a particular task, you should mention the task ID in the summary, for example &amp;quot;This commit fixes T123&amp;quot; to reference task T123. The revision will then shown up automatically in the task. The reviewers are referred to by their username on developer.blender.org.&lt;br /&gt;
&lt;br /&gt;
To '''update the revision''' with modified or new commits, simply run the same &amp;lt;tt&amp;gt;arc diff&amp;lt;/tt&amp;gt; command again.  If updating a revision you may want to get the latest changes from master on your local branch (should not rebase on public branch) before submitting a new diff, this can be done with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# commit code to your branch if not already done so&lt;br /&gt;
git checkout master&lt;br /&gt;
git pull origin master&lt;br /&gt;
git checkout some-new-feature&lt;br /&gt;
git rebase master&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Apply a Patch ====&lt;br /&gt;
&lt;br /&gt;
A reviewer or other interested party can download and apply a patch to their local repository with a command like this, which will be shown on the revision page:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
arc patch D123&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will download the patch and apply it in a newly created branch.&lt;br /&gt;
&lt;br /&gt;
==== Land a Patch ====&lt;br /&gt;
&lt;br /&gt;
When the revision is approved and you have commit rights, you can '''push to the main repository'''. If you do not have commit rights, the reviewer will do this for you.&lt;br /&gt;
&lt;br /&gt;
It's best to use this command to move it to the master branch:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
arc land --hold some-new-feature&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then you can inspect the commit message and if necessary amend it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# show commit log and diff&lt;br /&gt;
git show HEAD&lt;br /&gt;
# change commit log&lt;br /&gt;
git commit --amend&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Some Other Useful Commands ====&lt;br /&gt;
&lt;br /&gt;
This section explained the basic workflow for working with &amp;lt;tt&amp;gt;arc&amp;lt;/tt&amp;gt;, however it is quite a flexible tool and it can be used in different ways. For example you can send a specified range of commits, or even uncommitted changes rather than always creating a branch, it's a matter of preference.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;arc&amp;lt;/tt&amp;gt; can also be used to close revisions, close tasks, upload or download files, and many more things. See the user guide for more details. Here are a few useful commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# list local branches that have an associated revision on differential&lt;br /&gt;
arc feature&lt;br /&gt;
# list open tasks assigned to you&lt;br /&gt;
arc tasks&lt;br /&gt;
# upgrade to the latest version of arc (can be needed when we update the website)&lt;br /&gt;
arc upgrade&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Further Reading ====&lt;br /&gt;
&lt;br /&gt;
* [https://secure.phabricator.com/book/phabricator/article/arcanist/ User Guide]&lt;br /&gt;
* [https://secure.phabricator.com/book/phabricator/article/arcanist_diff/ &amp;lt;tt&amp;gt;arc diff&amp;lt;/tt&amp;gt; Guide]&lt;/div&gt;</summary>
		<author><name>wiki&gt;Fsiddi</name></author>
		
	</entry>
</feed>