git log -Sfoo ignores indentation (whitespace?) changes...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commits where only the indentation of 'foo' is changed are not shown with "git log -Sfoo". Is there any way to force showing them along with other changes involving foo? (E.g. for python, indentation matters!)

Why doesn't the second commit show up in the following?

$ git init

# Create text containing 'line' without whitespace
$ echo 'line' > text
$ git add text
$ git commit -m "first" text

# Here, I add one space of indentation in front of 'line'
$ echo ' line' > text
$ git commit -m "second" text

# git log -Sline shows only the first commit, not the second,
# where the indentation changed.
$ git log -Sline
commit c4481e4b38bb521d91583e5c5a3b2b98f08b7ec0
Author: pvm <pvm@xxxxxxxxxxxx>
Date:   Tue Mar 3 14:45:38 2009 +0100

    first

# But clearly, the second commit *also* has changes
# containing 'line':
$ git log -p HEAD~..HEAD
commit 6cb883409aa9ccda00d7720ee9bf4fa59918c5fd
Author: pvm <pvm@xxxxxxxxxxxx>
Date:   Tue Mar 3 14:45:39 2009 +0100

    second

diff --git a/text b/text
index a999a0c..d650980 100644
--- a/text
+++ b/text
@@ -1 +1 @@
-line
+ line

I would like to see both "first" and "second" somehow - can I do that?

--
Peter Valdemar Mørch
http://www.morch.com
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux