summaryrefslogtreecommitdiffstats
path: root/git-diff-files.html
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-06-11 15:23:52 -0700
committerJunio C Hamano <gitster@pobox.com>2013-06-11 15:23:52 -0700
commitf1f5a7b64053a592c7655df84079443328582b68 (patch)
tree9f7d07ba52ea6281993ea65e4805aeb31d2f080b /git-diff-files.html
parent8d74cd3acd56a5e53475ddc934fdf2e135a634e8 (diff)
downloadgit-htmldocs-f1f5a7b64053a592c7655df84079443328582b68.tar.gz
Autogenerated HTML docs for v1.8.3.1-377-g4d1c5
Diffstat (limited to 'git-diff-files.html')
-rw-r--r--git-diff-files.html34
1 files changed, 26 insertions, 8 deletions
diff --git a/git-diff-files.html b/git-diff-files.html
index c1f4410ed..7c076b728 100644
--- a/git-diff-files.html
+++ b/git-diff-files.html
@@ -1358,20 +1358,38 @@ of a delete/create pair.</p></div>
</dt>
<dd>
<p>
- Look for differences that introduce or remove an instance of
- &lt;string&gt;. Note that this is different than the string simply
- appearing in diff output; see the <em>pickaxe</em> entry in
- <a href="gitdiffcore.html">gitdiffcore(7)</a> for more details.
+ Look for differences that change the number of occurrences of
+ the specified string (i.e. addition/deletion) in a file.
+ Intended for the scripter&#8217;s use.
</p>
+<div class="paragraph"><p>It is useful when you&#8217;re looking for an exact block of code (like a
+struct), and want to know the history of that block since it first
+came into being: use the feature iteratively to feed the interesting
+block in the preimage back into <code>-S</code>, and keep going until you get the
+very first version of the block.</p></div>
</dd>
<dt class="hdlist1">
-G&lt;regex&gt;
</dt>
<dd>
<p>
- Look for differences whose added or removed line matches
- the given &lt;regex&gt;.
+ Look for differences whose patch text contains added/removed
+ lines that match &lt;regex&gt;.
</p>
+<div class="paragraph"><p>To illustrate the difference between <code>-S&lt;regex&gt; --pickaxe-regex</code> and
+<code>-G&lt;regex&gt;</code>, consider a commit with the following diff in the same
+file:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><code>+ return !regexec(regexp, two-&gt;ptr, 1, &amp;regmatch, 0);
+...
+- hit = !regexec(regexp, mf2.ptr, 1, &amp;regmatch, 0);</code></pre>
+</div></div>
+<div class="paragraph"><p>While <code>git log -G"regexec\(regexp"</code> will show this commit, <code>git log
+-S"regexec\(regexp" --pickaxe-regex</code> will not (because the number of
+occurrences of that string did not change).</p></div>
+<div class="paragraph"><p>See the <em>pickaxe</em> entry in <a href="gitdiffcore.html">gitdiffcore(7)</a> for more
+information.</p></div>
</dd>
<dt class="hdlist1">
--pickaxe-all
@@ -1388,8 +1406,8 @@ of a delete/create pair.</p></div>
</dt>
<dd>
<p>
- Make the &lt;string&gt; not a plain string but an extended POSIX
- regex to match.
+ Treat the &lt;string&gt; given to <code>-S</code> as an extended POSIX regular
+ expression to match.
</p>
</dd>
<dt class="hdlist1">