Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(689)

Side by Side Diff: docs/html/depot_tools_tutorial.html

Issue 225433003: Add a basic tutorial for the tools in depot_tools. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@git_map
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> 3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4 <head> 4 <head>
5 <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" / > 5 <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" / >
6 <meta name="generator" content="AsciiDoc 8.6.9" /> 6 <meta name="generator" content="AsciiDoc 8.6.9" />
7 <title>git-map(1)</title> 7 <title>depot_tools_tutorial(7)</title>
8 <style type="text/css"> 8 <style type="text/css">
9 /* Shared CSS for AsciiDoc xhtml11 and html5 backends */ 9 /* Shared CSS for AsciiDoc xhtml11 and html5 backends */
10 10
11 /* Default font. */ 11 /* Default font. */
12 body { 12 body {
13 font-family: Georgia,serif; 13 font-family: Georgia,serif;
14 } 14 }
15 15
16 /* Title font. */ 16 /* Title font. */
17 h1, h2, h3, h4, h5, h6, 17 h1, h2, h3, h4, h5, h6,
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 } 734 }
735 735
736 } 736 }
737 asciidoc.install(); 737 asciidoc.install();
738 /*]]>*/ 738 /*]]>*/
739 </script> 739 </script>
740 </head> 740 </head>
741 <body class="manpage"> 741 <body class="manpage">
742 <div id="header"> 742 <div id="header">
743 <h1> 743 <h1>
744 git-map(1) Manual Page 744 depot_tools_tutorial(7) Manual Page
745 </h1> 745 </h1>
746 <h2>NAME</h2> 746 <h2>NAME</h2>
747 <div class="sectionbody"> 747 <div class="sectionbody">
748 <p>git-map - 748 <p>depot_tools_tutorial -
749 Display history of all branches in a colorized terminal format. 749 A tutorial introduction to the Chromium depot_tools git extensions.
750 </p> 750 </p>
751 </div> 751 </div>
752 </div> 752 </div>
753 <div id="content"> 753 <div id="content">
754 <div class="sect1"> 754 <div class="sect1">
755 <h2 id="_synopsis">SYNOPSIS</h2>
756 <div class="sectionbody">
757 <div class="verseblock">
758 <pre class="content"><em>git map</em> [&lt;extra_args&gt;&#8230;]</pre>
759 <div class="attribution">
760 </div></div>
761 </div>
762 </div>
763 <div class="sect1">
764 <h2 id="_description">DESCRIPTION</h2> 755 <h2 id="_description">DESCRIPTION</h2>
765 <div class="sectionbody"> 756 <div class="sectionbody">
766 <div class="paragraph"><p>Git map formats the output of <code>git log --graph</c ode> from all refs such that:</p></div> 757 <div class="paragraph"><p>The Chromium <a href="depot_tools.html">depot_tools(7) </a> suite contains many git workflow-enhancing
758 tools which are designed to work together to enable anyone to wrangle the
759 Chromium codebase expertly. This tutorial explains how to do development on
760 Chromium using these tools. This will cover:</p></div>
767 <div class="ulist"><ul> 761 <div class="ulist"><ul>
768 <li> 762 <li>
769 <p> 763 <p>
770 Current branch is <span class="aqua">cyan</span>. 764 <a href="#_setting_up">Setting up</a>
771 </p> 765 </p>
772 </li> 766 </li>
773 <li> 767 <li>
774 <p> 768 <p>
775 Local branches are <span class="green">green</span>. 769 <a href="#_getting_the_code">Getting the code</a>
776 </p> 770 </p>
777 </li> 771 </li>
778 <li> 772 <li>
779 <p> 773 <p>
780 Remote branches are <span class="red">red</span>. 774 <a href="#_creating_uploading_a_cl">Creating / Uploading a CL</a>
781 </p> 775 </p>
782 </li> 776 </li>
783 <li> 777 <li>
784 <p> 778 <p>
785 Tags are <span class="fuchsia">magenta</span>. 779 <a href="#_updating_the_code">Updating the code</a>
786 </p> 780 </p>
787 </li> 781 </li>
788 <li> 782 <li>
789 <p> 783 <p>
790 Merge Base markers are <span class="black-background white">white</span>. 784 <a href="#_managing_multiple_cls">Managing multiple CLs</a>
791 </p> 785 </p>
792 </li> 786 </li>
793 <li> 787 <li>
794 <p> 788 <p>
795 The currently checked out commit is highlighted with a <span class="yellow blue- background">blue background</span>. 789 <a href="#_managing_dependent_cls">Managing dependent CLs</a>
796 </p> 790 </p>
797 </li> 791 </li>
798 </ul></div> 792 </ul></div>
799 <div class="paragraph"><p>The output is automatically piped through the <code>le ss</code> pager command, even on 793 <div class="paragraph"><p>Please refer to the manpages (or <code>--help</code> o utput) for details about any of the
800 windows.</p></div> 794 commands mentioned in this tutorial.</p></div>
801 </div> 795 <div class="admonitionblock">
802 </div> 796 <table><tr>
803 <div class="sect1"> 797 <td class="icon">
804 <h2 id="_options">OPTIONS</h2> 798 <div class="title">Note</div>
805 <div class="sectionbody"> 799 </td>
800 <td class="content">If your platform does not support manpages (or you prefer so mething a bit more
801 expressive than plain text) you can find all documentation in <em>html</em> form in the
802 <code>[DEPOT_TOOLS]/docs/html</code> folder.</td>
803 </tr></table>
804 </div>
805 <div class="sect2">
806 <h3 id="_prerequisites">PREREQUISITES</h3>
807 <div class="paragraph"><p>This tutorial will assume some basic familarity with g it terminology and basic
808 premises. If you need to brush up on these, the following are very good
809 resources:</p></div>
810 <div class="ulist"><ul>
811 <li>
812 <p>
813 <a href="http://git-scm.com/book">Pro Git book</a> - Pretty good overview of git to
814 bootstrap a working knowledge.
815 </p>
816 </li>
817 <li>
818 <p>
819 <a href="http://gitimmersion.com/">Git Immersion Tutorial</a> - An in-depth git
820 tutorial.
821 </p>
822 </li>
823 <li>
824 <p>
825 <a href="http://pcottle.github.io/learnGitBranching">pcottle&#8217;s Visual Git
826 Branching</a> - An excellent interactive/graphical demo on how git handles
827 commits, branches, and shows the operations git performs on them.
828 </p>
829 </li>
830 </ul></div>
831 </div>
832 </div>
833 </div>
834 <div class="sect1">
835 <h2 id="_setting_up">SETTING UP</h2>
836 <div class="sectionbody">
837 <div class="sect2">
838 <h3 id="_get_depot_tools">GET DEPOT TOOLS</h3>
839 <div class="sect3">
840 <h4 id="_linux_mac">LINUX / MAC</h4>
841 <div class="paragraph"><p>Clone the <em>depot_tools</em> repository:</p></div>
842 <div class="listingblock">
843 <div class="content">
844 <pre><code><strong><span class="white">$ git clone https://chromium.googlesource .com/chromium/tools/depot_tools</span></strong></code></pre>
845 </div></div>
846 <div class="paragraph"><p>Add <em>depot_tools</em> to the <em>end</em> of your P ATH and MANPATH (you will probably want
847 to put this in your <code>~/.bashrc</code> or <code>~/.zshrc</code>). Assuming you cloned
848 <em>depot_tools</em> to <code>/path/to/depot_tools</code>:</p></div>
849 <div class="listingblock">
850 <div class="content">
851 <pre><code><strong><span class="white">$ export PATH=$PATH:/path/to/depot_tools< /span></strong>
852 <strong><span class="white">$ export MANPATH=$MANPATH:/path/to/depot_tools/docs< /span></strong> <b>&lt;1&gt;</b></code></pre>
853 </div></div>
854 <div class="colist arabic"><ol>
855 <li>
856 <p>
857 Observe that this path is <code>depot_tools/</code><strong><code>docs</code></st rong>.
858 </p>
859 </li>
860 </ol></div>
861 </div>
862 <div class="sect3">
863 <h4 id="_windows">WINDOWS</h4>
864 <div class="paragraph"><p>Download the <em>depot_tools</em>
865 <a href="https://src.chromium.org/svn/trunk/tools/depot_tools.zip">bundle</a> an d
866 extract it somewhere.</p></div>
867 <div class="admonitionblock">
868 <table><tr>
869 <td class="icon">
870 <div class="title">Warning</div>
871 </td>
872 <td class="content"><strong>DO NOT</strong> use drag-n-drop or copy-n-paste extr act from Explorer, this will not
873 extract the hidden &#8220;.git&#8221; folder which is necessary for <em>depot_to ols</em> to
874 autoupdate itself. You can use &#8220;Extract all&#8230;&#8221; from the context menu though.</td>
875 </tr></table>
876 </div>
877 <div class="paragraph"><p>Add <em>depot_tools</em> to the <em>end</em> of your P ATH. Assuming you unzipped the
878 bundle to <code>C:\workspace\depot_tools</code>:</p></div>
806 <div class="dlist"><dl> 879 <div class="dlist"><dl>
807 <dt class="hdlist1"> 880 <dt class="hdlist1">
808 &lt;extra_args&gt;&#8230; 881 With Administrator access:
809 </dt> 882 </dt>
810 <dd> 883 <dd>
811 <p> 884 <p>
812 Extra parameters to pass to the internal <a href="git-log.html">git-log(1)</a> invocation. This 885 <strong>Control Panel &#8594; System and Security &#8594; System &#8594; Advan ced system settings</strong>
813 can be used to restrict what refs <em>git map</em> operates on, etc. 886 </p>
814 </p> 887 <div class="paragraph"><p>Modify the PATH system variable to include <code>C:\wo rkspace\depot_tools</code>.</p></div>
815 <div class="paragraph"><p>If you run git map with a series of fixed arguments fr equently, you can use 888 </dd>
816 the depot-tools.map-extra configuration variable to pre-set arguments (See 889 <dt class="hdlist1">
817 <code>CONFIGURATION VARIABLES</code>)</p></div> 890 Without Administrator access:
891 </dt>
892 <dd>
893 <p>
894 <strong>Control Panel &#8594; User Accounts &#8594; User Accounts &#8594; Chan ge my environment variables</strong>
895 </p>
896 <div class="paragraph"><p>Add a PATH user variable: <code>%PATH%;C:\workspace\de pot_tools</code>.</p></div>
818 </dd> 897 </dd>
819 </dl></div> 898 </dl></div>
820 </div> 899 <div class="paragraph"><p>From a <code>cmd.exe</code> shell, run the command <co de>gclient</code> (without arguments). On first
821 </div> 900 run, gclient will install all the Windows-specific bits needed to work with the
822 <div class="sect1"> 901 code, including msysgit and python.</p></div>
823 <h2 id="_configuration_variables">CONFIGURATION VARIABLES</h2> 902 <div class="admonitionblock">
824 <div class="sectionbody"> 903 <table><tr>
904 <td class="icon">
905 <div class="title">Note</div>
906 </td>
907 <td class="content">
908 <div class="ulist"><ul>
909 <li>
910 <p>
911 If you run gclient from a non-cmd shell (e.g., cygwin, PowerShell), it
912 may appear to run properly, but msysgit, python, and other tools may not get
913 installed correctly.
914 </p>
915 </li>
916 <li>
917 <p>
918 If you see strange errors with the file system on the first run of gclient,
919 you may want to <a href="http://tortoisesvn.tigris.org/faq.html#cantmove2">dis able
920 Windows Indexing</a>.
921 </p>
922 </li>
923 <li>
924 <p>
925 If you are running Windows XP and see errors like &#8220;The system cannot execu te
926 the specified program&#8221;, try installing the
927 <a href="http://code.google.com/p/chromium/issues/detail?id=75886">&#8220;Micr osoft
928 Visual C++ 2008 Redistributable Package&#8221;</a>.
929 </p>
930 </li>
931 </ul></div>
932 </td>
933 </tr></table>
934 </div>
935 </div>
936 </div>
825 <div class="sect2"> 937 <div class="sect2">
826 <h3 id="_depot_tools_map_extra">depot-tools.map-extra</h3> 938 <h3 id="_bootstrapping_configuration">BOOTSTRAPPING CONFIGURATION</h3>
827 <div class="paragraph"><p>Each value of the <em>depot-tools.map-extra</em> confi g variable is applied as an 939 <div class="paragraph"><p>If you have never used git before, you’ll need to set some global git
828 additional argument to <code>git log</code> during the execution of git map. If you wish to 940 configurations; substitute your name and email address in the following
829 configure this, use git <code>config --add depot-tools.map-extra &lt;value&gt;</ code> to do so.</p></div> 941 commands:</p></div>
830 </div> 942 <div class="listingblock">
831 </div> 943 <div class="content">
832 </div> 944 <pre><code><strong><span class="white">$ git config --global user.name &#8220;Jo hn Doe&#8221;</span></strong>
833 <div class="sect1"> 945 <strong><span class="white">$ git config --global user.email &#8220;jdoe@email.c om&#8221;</span></strong>
834 <h2 id="_example">EXAMPLE</h2> 946 <strong><span class="white">$ git config --global core.autocrlf false</span></st rong>
835 <div class="sectionbody"> 947 <strong><span class="white">$ git config --global core.filemode false</span></st rong>
836 <div class="paragraph"><p>Running <em>git map</em> would result in an output som ething like:</p></div> 948 <strong><span class="white">$</span></strong> # and for fun!
949 <strong><span class="white">$ git config --global color.ui true</span></strong>< /code></pre>
950 </div></div>
951 </div>
952 </div>
953 </div>
954 <div class="sect1">
955 <h2 id="_getting_the_code">GETTING THE CODE</h2>
956 <div class="sectionbody">
957 <div class="paragraph"><p>Pick an empty directory and run one of the following:< /p></div>
958 <div class="listingblock">
959 <div class="content">
960 <pre><code><strong><span class="white">$ fetch chromium</span></strong> # Basic checkout for desktop Chromium
961 <strong><span class="white">$ fetch blink</span></strong> # Chromium code wi th blink checked out to tip-of-tree
962 <strong><span class="white">$ fetch android</span></strong> # Chromium checkou t for Android platform
963 <strong><span class="white">$ fetch ios</span></strong> # Chromium checkou t for iOS platform</code></pre>
964 </div></div>
965 <div class="paragraph"><p>When the <code>fetch</code> tool completes you should have the following in your working
966 directory:</p></div>
967 <div class="listingblock">
968 <div class="content">
969 <pre><code><strong><span class="white">.gclient</span></strong> # A configurat ion file for you source checkout
970 <strong><span class="white">src/</span></strong> # Top-level Chromium sour ce checkout.</code></pre>
971 </div></div>
972 <div class="paragraph"><p>If you are on linux, then you&#8217;ll need to run:</p ></div>
973 <div class="listingblock">
974 <div class="content">
975 <pre><code><strong><span class="white">$ cd src &amp;&amp; ./build/install-build -deps.sh</span></strong></code></pre>
976 </div></div>
977 <div class="paragraph"><p>And finally:</p></div>
978 <div class="listingblock">
979 <div class="content">
980 <pre><code><strong><span class="white">$ gclient sync</span></strong> <b>&lt;1&g t;</b></code></pre>
981 </div></div>
982 <div class="colist arabic"><ol>
983 <li>
984 <p>
985 This will pull all dependencies of the Chromium src checkout. You will need
986 to run this any time you update the main src checkout.
987 </p>
988 </li>
989 </ol></div>
990 </div>
991 </div>
992 <div class="sect1">
993 <h2 id="_creating_uploading_a_cl">CREATING / UPLOADING A CL</h2>
994 <div class="sectionbody">
995 <div class="admonitionblock">
996 <table><tr>
997 <td class="icon">
998 <div class="title">Note</div>
999 </td>
1000 <td class="content">The remainder of the tutorial assumes that your current work ing directory
1001 is the <code>src/</code> folder mentioned in <a href="#_getting_the_code">Gettin g the code</a>.</td>
1002 </tr></table>
1003 </div>
1004 <div class="paragraph"><p>Each CL corresponds exactly with a single branch in gi t. Any time you want to
1005 begin a new CL, just:</p></div>
1006 <div class="listingblock">
1007 <div class="content">
1008 <pre><code><strong><span class="white">$ git new-branch &lt;branch_name&gt;</spa n></strong></code></pre>
1009 </div></div>
1010 <div class="paragraph"><p>This will create and checkout a new branch named <code >branch_name</code> which will track
1011 the default upstream (which is <code>origin/master</code>). See <a href="git-new -branch.html">git-new-branch(1)</a>
1012 for more features, such as the ability to track <em>LKGR</em>.</p></div>
1013 <div class="paragraph"><p>Commit as many changes as you like to this branch. Whe n you want to upload it
1014 for review, run:</p></div>
1015 <div class="listingblock">
1016 <div class="content">
1017 <pre><code><strong><span class="white">$ git cl upload</span></strong></code></p re>
1018 </div></div>
1019 <div class="paragraph"><p>This will take the diff of your branch against it&#821 7;s upstream (<code>origin/master</code>),
1020 and will post it to the <a href="https://codereview.chromium.org">Chromium code
1021 review site</a>.</p></div>
1022 </div>
1023 </div>
1024 <div class="sect1">
1025 <h2 id="_updating_the_code">UPDATING THE CODE</h2>
1026 <div class="sectionbody">
1027 <div class="paragraph"><p>Inevitably, you&#8217;ll want to pull in changes from the main Chromium repo. This is
1028 pretty easy with <em>depot_tools</em>:</p></div>
1029 <div class="listingblock">
1030 <div class="content">
1031 <pre><code><strong><span class="white">$ git rebase-update</span></strong></code ></pre>
1032 </div></div>
1033 <div class="paragraph"><p>This command will update all of your CLs to contain th e latest code from their
1034 upstreams. It will also automatically clean up CLs which have been committed and
1035 a couple other nice things :). See <a href="git-rebase-update.html">git-rebase-u pdate(1)</a> for the full
1036 scoop.</p></div>
1037 <div class="paragraph"><p>One thing to look out for are <em>merge conflicts</em> . These happen for exactly the
1038 same as they do with SVN, but the experience is a little more controllable with
1039 git. <code>git rebase-update</code> will try to rebase all your branches for you , but if it
1040 encounters a merge conflict in one, it will halt and leave you in a rebase
1041 conflict state (see <a href="git-rebase.html">git-rebase(1)</a>). Resolving <cod e>git rebase</code> merge
1042 conflicts is beyond the scope of this tutorial, but there are many good sources
1043 online (see the <a href="#_prerequisites">Prerequisites</a> for some).</p></div>
1044 <div class="paragraph"><p>Sometimes you&#8217;re pretty certain that you&#8217;v e committed a certain branch, but <code>git
1045 rebase-update</code> isn&#8217;t able to tell that because your branch doesn&#82 17;t rebase
1046 cleanly, and you&#8217;d like to double check the diff of your branch against it s
1047 upstream before deleting it. If this is the case you can abort the rebase, and
1048 then run <a href="git-squash-branch.html">git-squash-branch(1)</a> to flatten yo ur branch into a single
1049 commit. When you run <code>git rebase-update</code> again, you&#8217;ll get a (h opefully) much
1050 smaller / saner diff. If it turns out you were wrong, you can use
1051 <a href="git-reflog.html">git-reflog(1)</a> to reset your branch back to where i t was.</p></div>
1052 <div class="paragraph"><p>Once you&#8217;re done resolving all of the merge conf lict, just run <code>git
1053 rebase-update</code>, and it will pick up where it left off. Once the command ha s
1054 finished updating all of your branches, it will return you back to the branch
1055 you started on.</p></div>
1056 <div class="admonitionblock">
1057 <table><tr>
1058 <td class="icon">
1059 <div class="title">Note</div>
1060 </td>
1061 <td class="content">Running <code>git rebase-update</code> will update all your branches, but it will not
1062 automatically run <code>gclient sync</code> to update your dependencies.</td>
1063 </tr></table>
1064 </div>
1065 </div>
1066 </div>
1067 <div class="sect1">
1068 <h2 id="_managing_multiple_cls">MANAGING MULTIPLE CLS</h2>
1069 <div class="sectionbody">
1070 <div class="paragraph"><p>Sometimes you want to work on more than one CL at once (say, you have a CL
1071 posted for review and want to work on something else). For each CL that you
1072 want to work on, just use <code>git new-branch &lt;branchname&gt;</code>.</p></d iv>
1073 <div class="paragraph"><p>Once you start to have more than one CL at a time, it can be easy to lose your
1074 bearings. Fortunately, <em>depot_tools</em> has two tools to help you out:</p></ div>
837 <div class="listingblock"> 1075 <div class="listingblock">
838 <div class="content"> 1076 <div class="content">
839 <pre><code><strong><span class="white">$ git map</span></strong> 1077 <pre><code><strong><span class="white">$ git map</span></strong>
840 <span class="white blue-background">*</span>&#8203;<strong><span class="blue-bac kground red"> 7dcfe47 </span></strong> <span class="green">(</span>&#8203; <strong><span class="aqua">frozen_changes</span></strong>&#8203;<span class="gre en">)</span> <span class="yellow">2014-03-12</span> ~ FREEZE.unindexed 1078 <span class="white blue-background">*</span>&#8203;<strong><span class="blue-bac kground red"> 7dcfe47 </span></strong> <span class="green">(</span>&#8203; <strong><span class="aqua">frozen_changes</span></strong>&#8203;<span class="gre en">)</span> <span class="yellow">2014-03-12</span> ~ FREEZE.unindexed
841 * <strong><span class="red">4b0c180</span></strong> <span class="yellow"> 2014-03-12</span> ~ modfile 1079 * <strong><span class="red">4b0c180</span></strong> <span class="yellow"> 2014-03-12</span> ~ modfile
842 * <strong><span class="red">59a7cca</span></strong> <span class="yellow"> 2014-03-12</span> ~ a deleted file 1080 * <strong><span class="red">59a7cca</span></strong> <span class="yellow"> 2014-03-12</span> ~ a deleted file
843 * <strong><span class="red">6bec695</span></strong> <span class="green">( </span>&#8203;<span class="red">origin/master</span>&#8203;<span class="green">) </span> <span class="yellow">2014-03-11</span> ~ Add neat feature <strong><sp an class="white">&lt;(frozen_changes)</span></strong> 1081 * <strong><span class="red">6bec695</span></strong> <span class="green">( </span>&#8203;<span class="red">origin/master</span>&#8203;<span class="green">) </span> <span class="yellow">2014-03-11</span> ~ Add neat feature <strong><sp an class="white">&lt;(frozen_changes)</span></strong>
844 * <strong><span class="red">d15a38a</span></strong> <span class="yellow"> 2014-03-11</span> ~ Epic README update 1082 * <strong><span class="red">d15a38a</span></strong> <span class="yellow"> 2014-03-11</span> ~ Epic README update
845 * <strong><span class="red">d559894</span></strong> <span class="green">( </span>&#8203;<strong><span class="lime">master</span></strong>&#8203;<span clas s="green">)</span> <span class="yellow">2014-03-11</span> ~ Important upstream c hange 1083 * <strong><span class="red">d559894</span></strong> <span class="green">( </span>&#8203;<strong><span class="lime">master</span></strong>&#8203;<span clas s="green">)</span> <span class="yellow">2014-03-11</span> ~ Important upstream c hange
846 <span class="red">|</span> * <strong><span class="red">9c311fd</span></strong> <span class="green">(</span>&#8203;<strong><span class="lime">cool_feature</ span></strong>&#8203;<span class="green">)</span> <span class="yellow">2014-03-1 1</span> ~ Respond to CL comments 1084 <span class="red">|</span> * <strong><span class="red">9c311fd</span></strong> <span class="green">(</span>&#8203;<strong><span class="lime">cool_feature</ span></strong>&#8203;<span class="green">)</span> <span class="yellow">2014-03-1 1</span> ~ Respond to CL comments
847 <span class="red">|</span> <span class="green">|</span> * <strong><span class="r ed">2a1eeb2</span></strong> <span class="green">(</span>&#8203;<strong><span class="lime">subfeature</span></strong>&#8203;<span class="green">)</span> <span class="yellow">2014-03-11</span> ~ integrate with CoolService 1085 <span class="red">|</span> <span class="green">|</span> * <strong><span class="r ed">2a1eeb2</span></strong> <span class="green">(</span>&#8203;<strong><span class="lime">subfeature</span></strong>&#8203;<span class="green">)</span> <span class="yellow">2014-03-11</span> ~ integrate with CoolService
848 <span class="red">|</span> <span class="green">|</span> * <strong><span class="r ed">d777af6</span></strong> <span class="yellow">2014-03-11</span> ~ slick co mmenting action 1086 <span class="red">|</span> <span class="green">|</span> * <strong><span class="r ed">d777af6</span></strong> <span class="yellow">2014-03-11</span> ~ slick co mmenting action
849 <span class="red">|</span> <span class="green">|/</span> 1087 <span class="red">|</span> <span class="green">|/</span>
850 <span class="red">|</span> * <strong><span class="red">265803a</span></strong> <span class="yellow">2014-03-11</span> ~ another improvement <strong><spa n class="white">&lt;(subfeature)</span></strong> 1088 <span class="red">|</span> * <strong><span class="red">265803a</span></strong> <span class="yellow">2014-03-11</span> ~ another improvement <strong><spa n class="white">&lt;(subfeature)</span></strong>
851 <span class="red">|</span> * <strong><span class="red">6d831ac</span></strong> <span class="green">(</span>&#8203;<strong><span class="fuchsia">spleen_tag< /span></strong>&#8203;<span class="green">)</span> <span class="yellow">2014-03- 11</span> ~ Refactor spleen 1089 <span class="red">|</span> * <strong><span class="red">6d831ac</span></strong> <span class="green">(</span>&#8203;<strong><span class="fuchsia">spleen_tag< /span></strong>&#8203;<span class="green">)</span> <span class="yellow">2014-03- 11</span> ~ Refactor spleen
852 <span class="red">|</span> * <strong><span class="red">82e74ab</span></strong> <span class="yellow">2014-03-11</span> ~ Add widget 1090 <span class="red">|</span> * <strong><span class="red">82e74ab</span></strong> <span class="yellow">2014-03-11</span> ~ Add widget
853 <span class="red">|/</span> 1091 <span class="red">|/</span>
854 * <strong><span class="red">d08c5b3</span></strong> <span class="green">( </span>&#8203;<strong><span class="lime">bogus_noparent</span></strong>&#8203;<s pan class="green">)</span> <span class="yellow">2014-03-11</span> ~ Wonderful be ginnings <strong><span class="white">&lt;(cool_feature)</span></strong></code ></pre> 1092 * <strong><span class="red">d08c5b3</span></strong> <span class="green">( </span>&#8203;<strong><span class="lime">bogus_noparent</span></strong>&#8203;<s pan class="green">)</span> <span class="yellow">2014-03-11</span> ~ Wonderful be ginnings <strong><span class="white">&lt;(cool_feature)</span></strong></code ></pre>
855 </div></div> 1093 </div></div>
856 <div class="paragraph"><p>As you can see, the structure of the commit history is visible, particularly 1094 <div class="paragraph"><p>Note that this example repo is in dire need of a <a hr ef="git-rebase-update.html">git-rebase-update(1)</a>!</p></div>
857 what the parents of each commit are. In order to see the <em>upstream</em> 1095 <div class="listingblock">
858 relationships of the branches (i.e. which branch is tracking which other 1096 <div class="content">
859 branch), use the <a href="git-map-branches.html">git-map-branches(1)</a> command .</p></div> 1097 <pre><code><strong><span class="white">$ git map-branches</span></strong>
1098 <span class="red">origin/master</span>
1099 <span class="green">cool_feature</span>
1100 <span class="green">subfeature</span>
1101 <span class="aqua">frozen_changes *</span>
1102 <span class="green">master</span></code></pre>
1103 </div></div>
1104 <div class="dlist"><dl>
1105 <dt class="hdlist1">
1106 <a href="git-map.html">git-map(1)</a>
1107 </dt>
1108 <dd>
1109 <p>
1110 This tool shows you the history of all of your branches in a pseudo-graphical
1111 format. In particular, it will show you which commits all of your branches
1112 are on, which commit you currently have checked out, and more. Check out the
1113 doc for the full details.
1114 </p>
1115 </dd>
1116 <dt class="hdlist1">
1117 <a href="git-map-branches.html">git-map-branches(1)</a>
1118 </dt>
1119 <dd>
1120 <p>
1121 This tool just shows you which branches you have in your repo, and thier
1122 upstream relationship to each other (as well as which branch you have checked
1123 out at the moment).
1124 </p>
1125 </dd>
1126 </dl></div>
1127 <div class="paragraph"><p>Additionally, sometimes you need to switch between bra nches, but you&#8217;ve got work
1128 in progress. You could use <a href="git-stash.html">git-stash(1)</a>, but that c an be tricky to
1129 manage because you need to remember which branches you stashed what changes on.
1130 Helpfully <em>depot_tools</em> includes two tools which can greatly assist in ca se:</p></div>
1131 <div class="paragraph"><p><a href="git-freeze.html">git-freeze(1)</a> allows you to put the current branch in 'suspended
1132 animation' by committing your changes to a specially-named commit on the top of
1133 your current branch. When you come back to your branch later, you can just run
1134 <a href="git-thaw.html">git-thaw(1)</a> to get your work-in-progress changes bac k to what they were.</p></div>
1135 <div class="paragraph"><p>Another useful tool is <a href="git-rename-branch.html ">git-rename-branch(1)</a>. No, I&#8217;m not going to
1136 explain what it does.</p></div>
1137 <div class="paragraph"><p>Finally, take a look at <a href="git-upstream-diff.htm l">git-upstream-diff(1)</a>. This will show you the
1138 combined diff for all the commits on your branch against the upstream tracking
1139 branch. This is <em>exactly</em> what <code>git cl upload</code> will push up to code review.
1140 Additionally, consider trying the <code>--wordwise</code> argument to get a colo rized
1141 per-word diff (instead of a per-line diff).</p></div>
860 </div> 1142 </div>
861 </div> 1143 </div>
862 <div class="sect1"> 1144 <div class="sect1">
863 <h2 id="_see_also">SEE ALSO</h2> 1145 <h2 id="_managing_dependent_cls">MANAGING DEPENDENT CLS</h2>
864 <div class="sectionbody"> 1146 <div class="sectionbody">
865 <div class="paragraph"><p><a href="git-map-branches.html">git-map-branches(1)</a ></p></div> 1147 <div class="paragraph"><p>Now that you know how to manage <a href="#_managing_mu ltiple_cls"><em>independent</em> CLs</a>,
1148 we&#8217;ll see how to manage <em>dependent</em> CLs. Dependent CLs are useful w hen your
1149 second (or third or fourth or &#8230;) CL depends on the changes in one of your
1150 other CLs (such as: CL 2 won&#8217;t compile without CL 1, but you want to submi t
1151 them as two separate reviews).</p></div>
1152 <div class="paragraph"><p>Like all of the other CLs we&#8217;ve created, we use <a href="git-new-branch.html">git-new-branch(1)</a>, but
1153 this time with a (not very surprising) twist. First, <code>git checkout</code> t he branch
1154 you want to base the new one on (i.e. CL 1), and then run:</p></div>
1155 <div class="listingblock">
1156 <div class="content">
1157 <pre><code><strong><span class="white">$ git new-branch --upstream_current &lt;b ranch_name&gt;</span></strong></code></pre>
1158 </div></div>
1159 <div class="paragraph"><p>This will make a new branch which tracks the <em>curre nt</em> branch as its upstream
1160 (as opposed to <em>origin/master</em>). All changes you commit to this branch wi ll be
1161 in addition to the previous branch, but when you <code>git cl upload</code>, you will only
1162 upload the diff for the dependent (child) branch. You may have as many branches
1163 nested in this fashion as you like.</p></div>
1164 <div class="paragraph"><p><a href="git-map.html">git-map(1)</a> and <a href="git -map-branches.html">git-map-branches(1)</a> are particularly helpful when
1165 you have dependent branches. In addition, there are two helper commands which
1166 let you traverse your working copy up and down this tree of branches:
1167 <a href="git-nav-upstream.html">git-nav-upstream(1)</a> and <a href="git-nav-dow nstream.html">git-nav-downstream(1)</a>.</p></div>
1168 <div class="paragraph"><p>Sometimes when dealing with dependent CLs, it turns ou t that you accidentally
1169 based a branch on the wrong upstream, but since then you&#8217;ve committed chan ges to
1170 it, or even based <em>another</em> branch off of that one. Or say that you have two
1171 independent CLs that would actually be much better off as dependent CLs. Not to
1172 worry, because you can just check out the offending branch and use
1173 <a href="git-reparent-branch.html">git-reparent-branch(1)</a> to move it around the tree.</p></div>
1174 </div>
1175 </div>
1176 <div class="sect1">
1177 <h2 id="_conclusion">CONCLUSION</h2>
1178 <div class="sectionbody">
1179 <div class="paragraph"><p>Well that wraps up the whirlwind tour of the <em>depot _tools</em> helper tools. If you
1180 have questions which weren&#8217;t answered by this tutorial or the man pages fo r the
1181 tools (see the index of all tools here: <a href="depot_tools.html">depot_tools(7 )</a>), please ask :).</p></div>
1182 </div>
1183 </div>
1184 <div class="sect1">
1185 <h2 id="_glossary">GLOSSARY</h2>
1186 <div class="sectionbody">
1187 <div class="dlist"><dl>
1188 <dt class="hdlist1">
1189 CL
1190 </dt>
1191 <dd>
1192 <p>
1193 A <em>change-list</em>. This is a diff which you would like to commit to the
1194 codebase.
1195 </p>
1196 </dd>
1197 <dt class="hdlist1">
1198 DEPS
1199 </dt>
1200 <dd>
1201 <p>
1202 A file in the chromium checkout which <code>gclient sync</code> uses to determ ine what
1203 dependencies to pull in. This file also contains <em>hooks</em>.
1204 </p>
1205 </dd>
1206 <dt class="hdlist1">
1207 LKGR
1208 </dt>
1209 <dd>
1210 <p>
1211 Last Known Good Revision. This is a <a href="git-tag.html">git-tag(1)</a> whic h tracks the last
1212 version of <code>origin/master</code> which has passed the full set of testing on the
1213 <a href="http://build.chromium.org">main Chromium waterfall</a>.
1214 </p>
1215 </dd>
1216 </dl></div>
866 </div> 1217 </div>
867 </div> 1218 </div>
868 <div class="sect1"> 1219 <div class="sect1">
869 <h2 id="_chromium_depot_tools">CHROMIUM DEPOT_TOOLS</h2> 1220 <h2 id="_chromium_depot_tools">CHROMIUM DEPOT_TOOLS</h2>
870 <div class="sectionbody"> 1221 <div class="sectionbody">
871 <div class="paragraph"><p>Part of the chromium <a href="depot_tools.html">depot_ tools(1)</a> suite. These tools are meant to 1222 <div class="paragraph"><p>Part of the chromium <a href="depot_tools.html">depot_ tools(7)</a> suite. These tools are meant to
872 assist with the development of chromium and related projects. Download the tools 1223 assist with the development of chromium and related projects. Download the tools
873 from <a href="https://chromium.googlesource.com/chromium/tools/depot_tools.git"> here</a>.</p></div> 1224 from <a href="https://chromium.googlesource.com/chromium/tools/depot_tools.git"> here</a>.</p></div>
874 </div> 1225 </div>
875 </div> 1226 </div>
876 </div> 1227 </div>
877 <div id="footnotes"><hr /></div> 1228 <div id="footnotes"><hr /></div>
878 <div id="footer"> 1229 <div id="footer">
879 <div id="footer-text"> 1230 <div id="footer-text">
880 Last updated 2014-03-25 15:09:11 PDT 1231 Last updated 2014-04-04 01:40:30 PDT
881 </div> 1232 </div>
882 </div> 1233 </div>
883 </body> 1234 </body>
884 </html> 1235 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698