1 <?xml version="1.0" encoding="UTF-8"?>
\r
2 <!DOCTYPE sect1 SYSTEM "../../../dtd/dblite.dtd">
\r
3 <sect1 id="tsvn-dug-blame">
\r
4 <title>Who Changed Which Line?</title>
\r
6 <primary>blame</primary>
\r
9 <primary>annotate</primary>
\r
12 <primary>praise</primary>
\r
14 <?dbhh topicname="HIDD_BLAME"?>
\r
16 Sometimes you need to know not only what lines have changed, but also
\r
17 who exactly changed specific lines in a file. That's when the
\r
19 <guimenu>TortoiseGit</guimenu>
\r
20 <guimenuitem>Blame...</guimenuitem>
\r
22 command, sometimes also referred to as <firstterm>annotate</firstterm>
\r
23 command comes in handy.
\r
26 This command lists, for every line in a file, the author and the revision
\r
27 the line was changed.
\r
29 <sect2 id="tsvn-dug-blame-simple">
\r
30 <title>Blame for Files</title>
\r
32 <figure id="tsvn-dug-blame-dia-1">
\r
33 <title>The Annotate / Blame Dialog</title>
\r
34 <graphic fileref="../images/BlameDialog.png"/>
\r
36 If you're not interested in changes from earlier revisions you can
\r
37 set the revision from which the blame should start. Set this to <literal>1</literal>,
\r
38 if you want the blame for <emphasis>every</emphasis> revision.
\r
41 By default the blame file is viewed using <firstterm>TortoiseBlame</firstterm>,
\r
42 which highlights the different revisions to make it easier to read.
\r
43 If you wish to print or edit the blame file, select
\r
44 <guilabel>Use Text viewer to view blames</guilabel>
\r
47 You can specify the way that line ending and whitespace changes are handled.
\r
48 These options are described in <xref linkend="tsvn-dug-diff-eol-whitespace"/>.
\r
49 The default behaviour is to treat all whitespace and line-end differences
\r
50 as real changes, but if you want to ignore an indentation change and find
\r
51 the original author, you can choose an appropriate option here.
\r
54 Once you press <guibutton>OK</guibutton> TortoiseGit starts retrieving
\r
55 the data to create the blame file. Please note: This can take several
\r
56 minutes to finish, depending on how much the file has changed and
\r
57 of course your network connection to the repository. Once the blame
\r
58 process has finished the result is written into a temporary file and
\r
59 you can view the results.
\r
62 <figure id="tsvn-dug-blame-dia-2">
\r
63 <title>TortoiseBlame</title>
\r
64 <graphic fileref="../images/TortoiseBlame.png"/>
\r
66 TortoiseBlame, which is included with TortoiseGit, makes the blame file
\r
67 easier to read. When you hover the mouse over a line in the blame info
\r
68 column, all lines with the same revision are shown with a darker
\r
69 background. Lines from other revisions which were changed by the same author
\r
70 are shown with a light background.
\r
71 The colouring may not work as clearly if you have your display set to
\r
75 If you <action>left click</action>
\r
76 on a line, all lines with the same revision are highlighted, and lines from
\r
77 other revisions by the same author are highlighted in a lighter colour.
\r
78 This highlighting is sticky, allowing you to move the mouse without losing
\r
79 the highlights. Click on that revision again to turn off highlighting.
\r
82 The revision comments (log message) are shown in a hint box whenever
\r
83 the mouse hovers over the blame info column. If you want to copy the
\r
84 log message for that revision, use the context menu which appears when
\r
85 you right click on the blame info column.
\r
88 You can search within the Blame report using
\r
90 <guimenu>Edit</guimenu>
\r
91 <guimenuitem>Find...</guimenuitem>
\r
93 This allows you to search for revision numbers, authors and the content of
\r
94 the file itself. Log messages are not included in the search - you should
\r
95 use the Log Dialog to search those.
\r
98 You can also jump to a specific line number using
\r
100 <guimenu>Edit</guimenu>
\r
101 <guimenuitem>Go To Line...</guimenuitem>
\r
105 When the mouse is over the blame info columns, a context menu is
\r
106 available which helps with comparing revisions and examining history,
\r
107 using the revision number of the line under the mouse as a reference.
\r
109 <guimenu>Context menu</guimenu>
\r
110 <guimenuitem>Blame previous revision</guimenuitem>
\r
111 </menuchoice> generates a blame report for the same file, but using
\r
112 the previous revision as the upper limit. This gives you the blame
\r
113 report for the state of the file just before the line you are looking
\r
114 at was last changed.
\r
116 <guimenu>Context menu</guimenu>
\r
117 <guimenuitem>Show changes</guimenuitem>
\r
118 </menuchoice> starts your diff viewer, showing you what changed in
\r
119 the referenced revision.
\r
121 <guimenu>Context menu</guimenu>
\r
122 <guimenuitem>Show log</guimenuitem>
\r
123 </menuchoice> displays the revision log dialog starting with the
\r
124 referenced revision.
\r
127 If you need a better visual indicator of where the oldest and newest
\r
128 changes are, select
\r
130 <guimenu>View</guimenu>
\r
131 <guimenuitem>Color age of lines</guimenuitem>
\r
133 This will use a colour gradient to show newer lines in red and older lines
\r
134 in blue. The default colouring is quite light, but you can change it using
\r
135 the TortoiseBlame settings.
\r
138 If you are using Merge Tracking, where lines have changed as a result of
\r
139 merging from another path, TortoiseBlame will show the revision and author
\r
140 of the last change in the original file rather than the revision where the
\r
141 merge took place. These lines are indicated by showing the revision and
\r
143 If you do not want merged lines shown in this way, uncheck the
\r
144 <guilabel>Include merge info</guilabel> checkbox.
\r
147 If you want to see the paths involved in the merge, select
\r
149 <guimenu>View</guimenu>
\r
150 <guimenuitem>Merge paths</guimenuitem>
\r
154 The settings for TortoiseBlame can be accessed using
\r
156 <guimenu>TortoiseGit</guimenu>
\r
157 <guimenuitem>Settings...</guimenuitem>
\r
159 on the TortoiseBlame tab. Refer to
\r
160 <xref linkend="tsvn-dug-settings-tortoiseblame"/>.
\r
163 <sect2 id="tsvn-dug-blame-diffs">
\r
164 <title>Blame Differences</title>
\r
166 One of the limitations of the Blame report is that it only shows the file as
\r
167 it was in a particular revision, and shows the last person to change each line.
\r
168 Sometimes you want to know what change was made, as well as who made it. What
\r
169 you need here is a combination of the diff and blame reports.
\r
172 The revision log dialog includes several options which allow you to do this.
\r
175 <term>Blame Revisions</term>
\r
178 In the top pane, select 2 revisions, then select
\r
180 <guimenu>Context menu</guimenu>
\r
181 <guimenuitem>Blame revisions</guimenuitem>
\r
183 This will fetch the blame data for the 2 revisions, then
\r
184 use the diff viewer to compare the two blame files.
\r
189 <term>Blame Changes</term>
\r
192 Select one revision in the top pane, then pick one file
\r
193 in the bottom pane and select
\r
195 <guimenu>Context menu</guimenu>
\r
196 <guimenuitem>Blame changes</guimenuitem>
\r
198 This will fetch the blame data for the selected revision
\r
199 and the previous revision, then use the diff viewer to
\r
200 compare the two blame files.
\r
205 <term>Compare and Blame with Working BASE</term>
\r
208 Show the log for a single file, and in the top pane, select
\r
209 a single revision, then select
\r
211 <guimenu>Context menu</guimenu>
\r
212 <guimenuitem>Compare and Blame with Working BASE</guimenuitem>
\r
214 This will fetch the blame data for the selected revision,
\r
215 and for the file in the working BASE, then use the diff
\r
216 viewer to compare the two blame files.
\r