Merge branch 'ap/diff-ignore-blank-lines'
authorJunio C Hamano <gitster@pobox.com>
Sun, 30 Jun 2013 22:39:53 +0000 (15:39 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sun, 30 Jun 2013 22:39:53 +0000 (15:39 -0700)
"git diff" learned a mode that ignores hunks whose change consists
only of additions and removals of blank lines, which is the same as
"diff -B" (ignore blank lines) of GNU diff.

* ap/diff-ignore-blank-lines:
diff: add --ignore-blank-lines option

1  2 
Documentation/diff-options.txt
index a85288f23ef13512042a783460c5dfcd347b83f1,80f06b771bd42d2696ba7643d8fb15f7e9ebd3d8..19f78a7d5cca0c4a08681605d31a57158a869298
@@@ -383,36 -383,14 +383,36 @@@ ifndef::git-format-patch[
        that matches other criteria, nothing is selected.
  
  -S<string>::
 -      Look for differences that introduce or remove an instance of
 -      <string>. Note that this is different than the string simply
 -      appearing in diff output; see the 'pickaxe' entry in
 -      linkgit:gitdiffcore[7] 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's use.
 ++
 +It is useful when you'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 `-S`, and keep going until you get the
 +very first version of the block.
  
  -G<regex>::
 -      Look for differences whose added or removed line matches
 -      the given <regex>.
 +      Look for differences whose patch text contains added/removed
 +      lines that match <regex>.
 ++
 +To illustrate the difference between `-S<regex> --pickaxe-regex` and
 +`-G<regex>`, consider a commit with the following diff in the same
 +file:
 ++
 +----
 ++    return !regexec(regexp, two->ptr, 1, &regmatch, 0);
 +...
 +-    hit = !regexec(regexp, mf2.ptr, 1, &regmatch, 0);
 +----
 ++
 +While `git log -G"regexec\(regexp"` will show this commit, `git log
 +-S"regexec\(regexp" --pickaxe-regex` will not (because the number of
 +occurrences of that string did not change).
 ++
 +See the 'pickaxe' entry in linkgit:gitdiffcore[7] for more
 +information.
  
  --pickaxe-all::
        When `-S` or `-G` finds a change, show all the changes in that
        in <string>.
  
  --pickaxe-regex::
 -      Make the <string> not a plain string but an extended POSIX
 -      regex to match.
 +      Treat the <string> given to `-S` as an extended POSIX regular
 +      expression to match.
  endif::git-format-patch[]
  
  -O<orderfile>::
@@@ -461,6 -439,9 +461,9 @@@ endif::git-format-patch[
        differences even if one line has whitespace where the other
        line has none.
  
+ --ignore-blank-lines::
+       Ignore changes whose lines are all blank.
  --inter-hunk-context=<lines>::
        Show the context between diff hunks, up to the specified number
        of lines, thereby fusing hunks that are close to each other.
@@@ -502,7 -483,7 +505,7 @@@ endif::git-format-patch[
  
  --ignore-submodules[=<when>]::
        Ignore changes to submodules in the diff generation. <when> can be
 -      either "none", "untracked", "dirty" or "all", which is the default
 +      either "none", "untracked", "dirty" or "all", which is the default.
        Using "none" will consider the submodule modified when it either contains
        untracked or modified files or its HEAD differs from the commit recorded
        in the superproject and can be used to override any settings of the