{"thread":{"id":"47861","subject":"Is the -w option for git blame bugged?","startedAt":"2018-02-16T09:47:51Z","lastAt":"2018-02-16T10:58:06Z","messageCount":2,"participants":["hgfds jhgfds","Konstantin Khomoutov"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"339529","messageId":"CAOrVMvvM4XUsE0v7oxotD8yPHkmstG-mQYuhF0OsC-bETGQ-Og@mail.gmail.com","threadId":"47861","inReplyTo":null,"subject":"Is the -w option for git blame bugged?","fromName":"hgfds jhgfds","fromEmail":"lvl100p@gmail.com","sentAt":"2018-02-16T09:47:41Z","receivedAt":"2018-02-16T09:47:51Z","isPatch":false,"sender":{"key":"lvl100p@gmail.com","avatar":null},"body":"Hi,\n\nI recently asked a question on stackoverflow regarding what seemed to\nbe erroneous output from git blame when the -w option is specified.\nHowever, no one answered my question, so I decided to ask here\ninstead.\n\nThe question is available at\nhttps://stackoverflow.com/questions/48808281/git-blame-ignore-whitespace-option-bugged\n\nHope someone can help to shed light on this issue soon.\n\nThanks!\n"},{"id":"339530","messageId":"20180216105755.ouexuzktevnxrqwf@tigra","threadId":"47861","inReplyTo":"CAOrVMvvM4XUsE0v7oxotD8yPHkmstG-mQYuhF0OsC-bETGQ-Og@mail.gmail.com","subject":"Re: Is the -w option for git blame bugged?","fromName":"Konstantin Khomoutov","fromEmail":"kostix@bswap.ru","sentAt":"2018-02-16T10:57:56Z","receivedAt":"2018-02-16T10:58:06Z","isPatch":false,"sender":{"key":"kostix@bswap.ru","avatar":null},"body":"On Fri, Feb 16, 2018 at 05:47:41PM +0800, hgfds jhgfds wrote:\n\n> I recently asked a question on stackoverflow regarding what seemed to\n> be erroneous output from git blame when the -w option is specified.\n> However, no one answered my question, so I decided to ask here\n> instead.\n> \n> The question is available at\n> https://stackoverflow.com/questions/48808281/git-blame-ignore-whitespace-option-bugged\n> \n> Hope someone can help to shed light on this issue soon.\n\nThis is indeed the correct place to ask such questions.\nStill, the next time please literally ask the question - inclusing its\nfull text - rather than dropping a link: few people bother do to that,\nand even fewer of them have an SO account to actually answer it.\nSo it's both just basic netiquette and increasing the circle of the\npotentional helpers ;-)\n\nIn order to remove the churn, I've copied and pasted your question here;\nhope you have no issues with me doing this.\n\n--------------------------------8<--------------------------------\nBased on my understanding, the command `git blame` is supposed to show, for\neach line in a file, the author and the commit in which the line was last\nmodified.  So for example, if I run\n\ngit blame -- \"<filename>\"\n\nand get the following output for line 5:\n\n106b77db (Walrus 2016-03-24 10:01:36 +0800   5) .root {\n\nit means the line\n\n.root {\n\noriginated from the author Walrus in the commit 106b77db.\nIn other words, if I inspect the patch produced by 106b77db using\n`git show -p 106b77db`, I would expect the line\n\n+.root {\n\nto show up in the diff. Indeed, this is the case.\n\nSnippet from 106b77db's diff for <filename>:\n\n /* JavaFX CSS - Leave this comment until you have at least create one rule       which uses -fx-Property */\n+.root {\n+   -fx-background-color: transparent;\n+}\n+\n\nNow, when I run\n\ngit blame -w -- \"<filename>\"\n\n(the -w option ignores whitespace changes, i.e. traces each line backwards in\ntime to find the last author which introduced non-whitespace changes to that\nline), I now get the following output for line 5:\n\nb6a6e8a2 (Walrus 2016-03-31 23:32:50 +0800   5) .root {\n\nHowever, when I inspect the patch for b6a6e8a2 using\n\ngit show -p b6a6e8a2\n\nthe diff shows\n\n.root {\n\nrather than\n\n+.root {\n\nas expected.\n\nSnippet from b6a6e8a2's diff for <filename>:\n\n+\n+/* setting window to be transparent================================ */\n .root {\n    -fx-background-color: transparent;\n-}\n-\n\nHas Git given me erroneous output, because according to the diff, the line\n.root { was not modified at all in the commit b6a6e8a2?\n\nI am using Git 2.13.3.windows.1.\n\nEDIT: the repository is https://github.com/cs2103jan2016-f14-2j/main,\nand the file is JimplePlanner/src/application.css.\nAfter upgrading to Git 2.16.1.windows.4, the issue still persists.\n--------------------------------8<--------------------------------\n\n"}]}