{"id":1658,"date":"2012-06-27T17:54:55","date_gmt":"2012-06-27T09:54:55","guid":{"rendered":"https:\/\/www.csslayer.info\/wordpress\/?p=1658"},"modified":"2012-06-27T17:54:55","modified_gmt":"2012-06-27T09:54:55","slug":"contribute-patch-to-qt","status":"publish","type":"post","link":"https:\/\/www.csslayer.info\/wordpress\/linux\/qt-linux\/contribute-patch-to-qt\/","title":{"rendered":"\u5982\u4f55\u7ed9 Qt \u8d21\u732e Patch"},"content":{"rendered":"<p>\u6700\u8fd1\u7ed9 Qt 5 \u5199\u4e86\u51e0\u4e2a\u50bb\u74dc\u90fd\u80fd\u5199\u7684 Patch \u2026\u2026\u76ee\u7684\u662f\u4fee\u590d\u4e00\u4e9b\u8f93\u5165\u6cd5\u76f8\u5173\u7684 Bug\u3002\u5f53\u7136\u8fd9\u4e0d\u662f\u91cd\u70b9\uff0c\u91cd\u70b9\u662f\u600e\u4e48\u7ed9 Qt \u5199 Patch \u5e76\u63d0\u4ea4\u3002<\/p>\n<p>\u9996\u5148 Qt \u81ea\u4ece\u8f6c\u5411\u5f00\u653e\u7ba1\u7406\u4e4b\u540e\uff0c\u7ed9 Qt \u5199 Patch \u5c31\u6210\u4e3a\u4e86\u4e00\u4ef6\u975e\u5e38\u7b80\u5355\u7684\u4e8b\u60c5\u3002<\/p>\n<p>\u9996\u5148\u4e0d\u7528\u8bf4\uff0c\u4f60\u9700\u8981\u6ce8\u518c\u4e2a\u8d26\u53f7\uff0c\u5148\u5230\u8fd9\u4e2a\u7f51\u7ad9\u6ce8\u518c\u4e2a\u8d26\u53f7\uff0c<a href=\"http:\/\/bugreports.qt-project.org\">bugreports.qt-project.org<\/a>\uff0c\u7136\u540e\u6253\u5f00<a href=\"http:\/\/codereview.qt-project.org\">codereview.qt-project.org<\/a> \uff0c\u9009\u62e9 sign in\uff0csign in\u4e4b\u540e\u9700\u8981\u505a\u7684\u5c31\u662f\u548c\u4e00\u822c\u7684\u4ee3\u7801\u7ba1\u7406\u7f51\u7ad9\u4e00\u6837\uff0c\u6dfb\u52a0\u4f60\u7684ssh key\uff0c\u7136\u540e\u8fd8\u9700\u8981\u505a\u7684\u662f\u7b7e\u7f72\u4e00\u4e2a\u534f\u8bae\uff0c\u5728Agreements\u91cc\u9762\uff0c\u4f5c\u4e3a\u4e00\u822c\u4eba\u7b7e\u4e2a Invidudual\u7684\u5c31\u597d\uff0c\u53e6\u4e00\u79cd\u662f\u5982\u679c\u4f60\u4ee3\u8868\u516c\u53f8\u5411 Qt \u8d21\u732e\uff0c\u90a3\u4e48\u5219\u662f\u7b7e\u90a3\u4e2a\uff0c\u7136\u540e\u5927\u6982\u5c31\u662f\u9700\u8981\u7b49\u8fd9\u4e2a\u5ba1\u6838\u901a\u8fc7\uff0c\u6548\u7387\u8fd8\u662f\u975e\u5e38\u9ad8\u7684\uff0c\u559d\u53e3\u8336\u5927\u6982\u6700\u591a\u51e0\u4e2a\u5c0f\u65f6\u4e4b\u540e\u5c31ok\u4e86\uff0c\u7136\u540e\u4f60\u5c31\u53ef\u4ee5\u901a\u8fc7 gerrit \uff08qt\u7684code review \u7cfb\u7edf\u63d0\u4ea4 patch \u4e86\uff09\u3002<\/p>\n<p>gerrit \u8fd9\u4e2a\u4e1c\u897f\u662f\u4e2a\u975e\u5e38\u795e\u5947\u7684\u4e1c\u897f\uff0c\u975e\u5e38\u597d\u7528\uff0c\u5982\u679c\u4f60\u719f\u6089 git \u7684\u5f00\u53d1\u7684\u8bdd\u5c31\u66f4\u597d\u4e86\u3002<\/p>\n<p>\u5176\u5b9e Qt \u4e0a\u5df2\u7ecf\u6709\u4e86<a href=\"http:\/\/qt-project.org\/wiki\/Gerrit-Introduction\">\u975e\u5e38\u8be6\u7ec6\u7684\u8bf4\u660e<\/a>\uff0c\u6211\u8fd9\u91cc\u53ea\u7b80\u5355\u4ecb\u7ecd\u4e00\u4e0b\u3002<\/p>\n<p>\u9996\u5148\u8981\u914d\u7f6e\u4f60\u7684ssh_config \uff0ccode review\u7684ssh\u5e76\u975e\u662f\u4f20\u7edf\u768422\u7aef\u53e3\uff0c\u800c\u662f\u4e00\u4e2a\u81ea\u5b9a\u4e49\u7aef\u53e3\uff0c\u5728\u4f60\u7684~\/.ssh\/config \u4e2d\u52a0\u5165\uff1a<\/p>\n<div>\n<pre> Host codereview.qt-project.org\r\n\u00a0 \u00a0Port 29418<\/pre>\n<\/div>\n<p>\u9996\u5148\u5728\u4f60 clone \u4e0b\u6765\u4ee3\u7801\u4e4b\u540e\uff08from gitorous\u6216\u8005code review\u90fd\u884c\uff09\uff0c<\/p>\n<div>\n<pre>$ git clone ssh:\/\/&lt;username&gt;@codereview.qt-project.org\/qt\/qtbase.git\r\nCloning into qtbase...\r\nremote: Counting objects: 33523, done\r\nremote: Finding sources: 100% (33523\/33523)\r\nReceiving objects: 100% (33523\/33523), 69.45 MiB | 901 KiB\/s, done.\r\nremote: Total 33523 (delta 16501), reused 33523 (delta 16501)\r\nResolving deltas: 100% (16501\/16501), done.\r\n$<\/pre>\n<\/div>\n<p>\u9996\u5148\u9700\u8981\u914d\u7f6e\u7684\u662f commit msg\u548ccommit hook\uff0c\u5b83\u80fd\u81ea\u52a8\u751f\u6210\u4e00\u4e2achangeid\uff0c\u4e5f\u5c31\u662f\u5c06\u6765\u6807\u793a\u4f60\u8fd9\u4e2a\u4fee\u6539\u7684id\u3002<\/p>\n<pre>$ scp -P 29418 &lt;username&gt;@codereview.qt-project.org:hooks\/commit-msg .git\/hooks<\/pre>\n<p>\u53e6\u5916\u5c31\u662f\u9700\u8981 clone \u4e00\u4e2a qtrepotools\uff0c\u5e76\u4e14\u628a git-hooks\/git_post_commit_hook \u94fe\u63a5\u5230\u4f60\u7684 .git\/hooks\/post-commit<\/p>\n<p>\u5e76\u4e14\u8981\u4fdd\u6301\u8fd9\u4e24\u4e2a\u6587\u4ef6\u53ef\u6267\u884c\u54e6\u3002<\/p>\n<p>\u4e4b\u540e\u4f60\u5c31\u53ef\u4ee5\u505a\u4f60\u7684\u4fee\u6539\u4e86\uff0c\u505a\u4e86commit\u4e4b\u540e\u4f60\u53ef\u4ee5git log\u770b\u770b\uff0c\u662f\u4e0d\u662f\u6709 Change-Id: I3db87fdffdb5b01404047e905793ae6e10bb1e90 \u8fd9\u6837\u7684\u5b57\u6837\uff0c\u5982\u679c\u6ca1\u6709\u7684\u8bdd\u53ef\u662f\u4e0d\u884c\u7684\u54e6\uff0c\u90a3\u6837\u4f60\u9700\u8981\u68c0\u67e5\u4e0b\u4f60\u7684commit-msg\u662f\u4e0d\u662f\u6709\u95ee\u9898\uff1f<\/p>\n<p>\u5982\u679c\u987a\u5229\u7684\u8bdd\uff0c\u90a3\u4e48\u4f60\u53ef\u4ee5\u63d0\u4ea4\u4f60\u7684 review\u4e86<\/p>\n<div>\n<pre>$ git push ssh:\/\/&lt;username&gt;@codereview.qt-project.org:29418\/qt\/qtbase HEAD:refs\/for\/master\r\nCounting objects: 6, done.\r\nDelta compression using up to 2 threads.\r\nCompressing objects: 100% (3\/3), done.\r\nWriting objects: 100% (4\/4), 407 bytes, done.\r\nTotal 4 (delta 2), reused 0 (delta 0)\r\nremote: Resolving deltas: \u00a0 0% (0\/2)\r\nTo ssh:\/\/&lt;username&gt;@codereview.qt-project.org:29418\/qt\/qtbase\r\n\u00a0* [new branch] \u00a0 \u00a0 \u00a0HEAD -&gt; refs\/for\/master\r\n$<\/pre>\n<\/div>\n<p>\u7136\u540e\u4f1a\u751f\u6210\u4e00\u4e2a\u94fe\u63a5\u7ed9\u4f60\uff0c\u53ef\u4ee5\u7528\u6765\u5728\u7f51\u7ad9\u4e0atrack\u72b6\u6001\u3002<\/p>\n<p>\u7136\u540e\u9700\u8981\u505a\u7684\u4e00\u4ef6\u4e8b\u5c31\u662f\u627ereviewer\uff0c\u90a3\u4e48\u627e\u8c01\u5462\uff1f\u6709\u4ee5\u4e0b\u4e24\u79cd\u529e\u6cd5\u2026\u4e00\u4e2a\u662f\u770b\u770b\u4f60\u8fd9\u4e2a\u6587\u4ef6\u7684\u4fee\u6539\u5386\u53f2\uff0c\u90fd\u6709\u8c01review\u8fc7\uff0creviewer\u7684\u540d\u5b57\u4f1a\u7528 Reviewed-by: \u6807\u660e\uff0c\u561b\u2026\u2026\u547d\u4e2d\u591a\u7684\u5927\u6982\u5c31\u76f8\u5173\u5427\u2026\u2026<\/p>\n<p>\u8fd8\u6709\u5c31\u662f\u4f60\u53ef\u4ee5\u5230 #qt-labs @ freenode.net \u8fd9\u4e2airc\u9891\u9053\u53bb\u8be2\u95ee\u4e00\u4e0b\uff0c\u4e5f\u4f1a\u5f97\u5230\u56de\u590d\u7684\u3002<\/p>\n<p>\u7136\u540e\u5c31\u662f\u7b49\u7740review\u4e86\u3002<\/p>\n<p>\u8fd0\u6c14\u597d\u7684\u8bdd\uff0c\u53ef\u80fd\u63a5\u4e0b\u6765\u5c31\u4f60\u5565\u4e8b\u4e86\uff0c\u5f53\u7136\u50cf\u6211\u8fd9\u79cd<del>\u4e8c\u903c<\/del>\u9752\u5e74\u2026\u2026\u5934\u4e00\u6b21\u5c31\u72af\u4e86\u5404\u79cd\u50bb\u5230\u5bb6\u7684\u9519\u8bef\u2026\u2026\u90a3\u4f60\u53ef\u80fd\u9700\u8981\u4fee\u6539\u4f60\u7684\u4ee3\u7801\uff0c\u8fd9\u8981\u600e\u4e48\u505a\u5462\uff1f<\/p>\n<p>\u5176\u5b9e\u975e\u5e38\u7b80\u5355\uff08\u4e0b\u9762\u662f\u6211\u81ea\u5df1\u4f7f\u7528\u7684\u529e\u6cd5\uff0c\u4e0d\u77e5\u9053\u662f\u5426\u5b8c\u5168\u6b63\u786e\uff0c\u4e0d\u8fc7\u81f3\u5c11work\uff09\uff0c\u9996\u5148\u5230\u7f51\u9875\u4e0a\u627e\u5230 git fetch https:\/\/codereview.qt-project.org\/p\/qt\/qtbase refs\/changes\/xx\/xxxxx\/x &amp;&amp; git checkout FETCH_HEAD \uff0c\u50cf\u8fd9\u6837\u5c31\u80fd\u627e\u56de\u4f60\u7684\u63d0\u4ea4\uff0c\u7136\u540e\u505a\u51fa\u5bf9\u5e94\u7684\u4fee\u6539\uff0c\u4f60\u53ef\u80fd\u9700\u8981rebase\u5230master\u6216\u8005\u505a\u4e00\u4e9b\u76f8\u5173\u7684\u64cd\u4f5c\u3002\uff08\u6211\u4e2a\u4eba\u5efa\u8bae\u662f\u4e0d\u8981merge\uff0c\u90a3\u6837\u4f1a\u751f\u6210\u989d\u5916\u7684\u4e0d\u5fc5\u8981\u7684\u63d0\u4ea4\u2026\u2026\uff09<\/p>\n<p>\u8fd9\u79cd\u65f6\u5019 git commit &#8211;amend \u5c31\u6d3e\u4e0a\u7528\u573a\uff0c\u4f60\u53ef\u4ee5\u4fee\u6539\u4f60\u7684\u63d0\u4ea4\uff0c\u7136\u540e\u4fee\u6539\u5b8c\u6210\u540e\u518d\u7528\u6700\u5f00\u59cb\u548c\u63d0\u4ea4code review\u4e00\u6837\u7684\u547d\u4ee4\uff0c\u5c31\u53ef\u4ee5\u4e86\u3002\u6ce8\u610f\u7684\u662fChange-Id \u5f53\u7136\u662f\u4e0d\u80fd\u6539\u7684\uff0c\u5426\u5219\u7cfb\u7edf\u5c31\u4f1a\u8ba4\u4e3a\u8fd9\u662f\u4e00\u4e2a\u65b0\u7684review\u3002<\/p>\n<p>\u90a3\u4e48\u5c31\u662f\u8fd9\u6837\uff0cQt\u7684\u7f51\u7ad9\u4e0a\u4e5f\u6709\u5f88\u591a\u76f8\u5173\u7684\u5185\u5bb9\uff0c\u751a\u81f3\u6709\u89c6\u9891\u6f14\u793a\uff0c\u94fe\u63a5\u90fd\u5217\u5728\u4e0b\u9762\u53ef\u4ee5\u67e5\u770b\u3002<\/p>\n<p><a href=\"http:\/\/qt-project.org\/wiki\/Category:Developing_Qt\">http:\/\/qt-project.org\/wiki\/Category:Developing_Qt<\/a><\/p>\n<p><a href=\"http:\/\/qt-project.org\/wiki\/Code_Reviews\">http:\/\/qt-project.org\/wiki\/Code_Reviews<\/a><\/p>\n<p><a href=\"http:\/\/developer.qt.nokia.com\/videos\/watch\/gerrit_contributing_and_reviewing_a_change\">http:\/\/developer.qt.nokia.com\/videos\/watch\/gerrit_contributing_and_reviewing_a_change<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u7ed9 Qt 5 \u5199\u4e86\u51e0\u4e2a\u50bb\u74dc\u90fd\u80fd\u5199\u7684 Patch \u2026\u2026\u76ee\u7684\u662f\u4fee\u590d\u4e00\u4e9b\u8f93\u5165\u6cd5\u76f8\u5173\u7684 Bug\u3002\u5f53\u7136\u8fd9\u4e0d\u662f\u91cd\u70b9\uff0c\u91cd\u70b9\u662f\u600e\u4e48\u7ed9 Qt \u5199 Patch \u5e76\u63d0\u4ea4\u3002 \u9996\u5148 Qt \u81ea\u4ece\u8f6c\u5411\u5f00\u653e\u7ba1\u7406\u4e4b\u540e\uff0c\u7ed9 Qt \u5199 Patch \u5c31\u6210\u4e3a\u4e86\u4e00\u4ef6\u975e\u5e38\u7b80\u5355\u7684\u4e8b\u60c5\u3002 \u9996\u5148\u4e0d\u7528\u8bf4\uff0c\u4f60\u9700\u8981\u6ce8\u518c\u4e2a\u8d26\u53f7\uff0c\u5148\u5230\u8fd9\u4e2a\u7f51\u7ad9\u6ce8\u518c\u4e2a\u8d26\u53f7\uff0cbugreports.qt-project.org\uff0c\u7136\u540e\u6253\u5f00codereview.qt-project.org \uff0c\u9009\u62e9 sign in\uff0csign in\u4e4b\u540e\u9700\u8981\u505a\u7684\u5c31\u662f\u548c\u4e00\u822c\u7684\u4ee3\u7801\u7ba1\u7406\u7f51\u7ad9\u4e00\u6837\uff0c\u6dfb\u52a0\u4f60\u7684ssh key\uff0c\u7136\u540e\u8fd8\u9700\u8981\u505a\u7684\u662f\u7b7e\u7f72\u4e00\u4e2a\u534f\u8bae\uff0c\u5728Agreements\u91cc\u9762\uff0c\u4f5c\u4e3a\u4e00\u822c\u4eba\u7b7e\u4e2a Invidudual\u7684\u5c31\u597d\uff0c\u53e6\u4e00\u79cd\u662f\u5982\u679c\u4f60\u4ee3\u8868\u516c\u53f8\u5411 Qt \u8d21\u732e\uff0c\u90a3\u4e48\u5219\u662f\u7b7e\u90a3\u4e2a\uff0c\u7136\u540e\u5927\u6982\u5c31\u662f\u9700\u8981\u7b49\u8fd9\u4e2a\u5ba1\u6838\u901a\u8fc7\uff0c\u6548\u7387\u8fd8\u662f\u975e\u5e38\u9ad8\u7684\uff0c\u559d\u53e3\u8336\u5927\u6982\u6700\u591a\u51e0\u4e2a\u5c0f\u65f6\u4e4b\u540e\u5c31ok\u4e86\uff0c\u7136\u540e\u4f60\u5c31\u53ef\u4ee5\u901a\u8fc7 gerrit \uff08qt\u7684code review \u7cfb\u7edf\u63d0\u4ea4 patch \u4e86\uff09\u3002 gerrit \u8fd9\u4e2a\u4e1c\u897f\u662f\u4e2a\u975e\u5e38\u795e\u5947\u7684\u4e1c\u897f\uff0c\u975e\u5e38\u597d\u7528\uff0c\u5982\u679c\u4f60\u719f\u6089 git \u7684\u5f00\u53d1\u7684\u8bdd\u5c31\u66f4\u597d\u4e86\u3002 \u5176\u5b9e Qt \u4e0a\u5df2\u7ecf\u6709\u4e86\u975e\u5e38\u8be6\u7ec6\u7684\u8bf4\u660e\uff0c\u6211\u8fd9\u91cc\u53ea\u7b80\u5355\u4ecb\u7ecd\u4e00\u4e0b\u3002 &hellip; <a href=\"https:\/\/www.csslayer.info\/wordpress\/linux\/qt-linux\/contribute-patch-to-qt\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[91],"tags":[43],"class_list":["post-1658","post","type-post","status-publish","format-standard","hentry","category-qt-linux","tag-qt"],"_links":{"self":[{"href":"https:\/\/www.csslayer.info\/wordpress\/wp-json\/wp\/v2\/posts\/1658","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.csslayer.info\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.csslayer.info\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.csslayer.info\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.csslayer.info\/wordpress\/wp-json\/wp\/v2\/comments?post=1658"}],"version-history":[{"count":1,"href":"https:\/\/www.csslayer.info\/wordpress\/wp-json\/wp\/v2\/posts\/1658\/revisions"}],"predecessor-version":[{"id":1659,"href":"https:\/\/www.csslayer.info\/wordpress\/wp-json\/wp\/v2\/posts\/1658\/revisions\/1659"}],"wp:attachment":[{"href":"https:\/\/www.csslayer.info\/wordpress\/wp-json\/wp\/v2\/media?parent=1658"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.csslayer.info\/wordpress\/wp-json\/wp\/v2\/categories?post=1658"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.csslayer.info\/wordpress\/wp-json\/wp\/v2\/tags?post=1658"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}