Based on my understanding, the command git blame
is supposed to show, for each line in a file, the author and the commit in which the line was last modified. So for example, if I run git blame -- "<filename>"
and get the following output for line 5:
106b77db (Walrus 2016-03-24 10:01:36 +0800 5) .root {
it means the line .root {
originated from the author Walrus
in the commit 106b77db
. In other words, if I inspect the patch produced by 106b77db
using git show -p 106b77db
, I would expect the line +.root {
to show up in the diff. Indeed, this is the case.
Snippet from 106b77db
's diff for <filename>
:
/* JavaFX CSS - Leave this comment until you have at least create one rule which uses -fx-Property */
+.root {
+ -fx-background-color: transparent;
+}
+
Now, when I run git blame -w -- "<filename>"
, (the -w
option ignores whitespace changes, i.e. traces each line backwards in time to find the last author which introduced non-whitespace changes to that line), I now get the following output for line 5:
b6a6e8a2 (Walrus 2016-03-31 23:32:50 +0800 5) .root {
However, when I inspect the patch for b6a6e8a2
using git show -p b6a6e8a2
, the diff shows .root {
rather than +.root {
as expected.
Snippet from b6a6e8a2
's diff for <filename>
:
+
+/* setting window to be transparent================================ */
.root {
-fx-background-color: transparent;
-}
-
Has Git given me erroneous output, because according to the diff, the line .root {
was not modified at all in the commit b6a6e8a2
?
I am using Git 2.13.3.windows.1.
EDIT: the repository is https://github.com/cs2103jan2016-f14-2j/main, and the file is JimplePlanner/src/application.css
. After upgrading to Git 2.16.1.windows.4, the issue still persists.