{"thread":{"id":"30703","subject":"Help: Found odd git bug","startedAt":"2012-06-04T16:37:07Z","lastAt":"2012-06-04T19:52:07Z","messageCount":3,"participants":["Marc Branchaud","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"192812","messageId":"4FCCE433.7090007@xiplink.com","threadId":"30703","inReplyTo":null,"subject":"Help: Found odd git bug","fromName":"Marc Branchaud","fromEmail":"marcnarc@xiplink.com","sentAt":"2012-06-04T16:37:07Z","receivedAt":"2012-06-04T16:37:07Z","isPatch":false,"sender":{"key":"marcnarc@xiplink.com","avatar":"https://avatars.githubusercontent.com/u/14980203?v=4"},"body":"Hi all,\n\nA commit claims to add a line to a file.  Indeed, \"git diff\" shows the line\nbeing added.\n\nHowever, when I check out the commit, the file contains a *different* line,\nwith slightly modified contents.\n\nWhat's more, \"git show SHA:path/to/file\" shows that the blob contains the\nwrong line.\n\nI found this using git 1.7.9, but 1.7.11.rc1 also shows the problem.\n\nHow can I narrow down what's causing this problem?\n\n\t\tM.\n"},{"id":"192829","messageId":"7vd35ft159.fsf@alter.siamese.dyndns.org","threadId":"30703","inReplyTo":"4FCCE433.7090007@xiplink.com","subject":"Re: Help: Found odd git bug","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-06-04T17:52:50Z","receivedAt":"2012-06-04T17:52:50Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Marc Branchaud <marcnarc@xiplink.com> writes:\n\n> A commit claims to add a line to a file.  Indeed, \"git diff\" shows the line\n> being added.\n>\n> However, when I check out the commit, the file contains a *different* line,\n> with slightly modified contents.\n>\n> What's more, \"git show SHA:path/to/file\" shows that the blob contains the\n> wrong line.\n>\n> I found this using git 1.7.9, but 1.7.11.rc1 also shows the problem.\n>\n> How can I narrow down what's causing this problem?\n\nWithout any information useful to diagnose, I would say it probably\nis not a bug but is an operator error when either of the \"git diff\"\nor \"check out the commit\" steps were done.  Even if you cannot share\nthe repository, at least a _complete_ command line with arguments is\nneeded.\n\nFor example, we can _reproduce_ your symptom description like this.\n\n\t$ echo this line was added >file\n        $ git add file\n        $ git commit -m 'added a line'\n        \n\t$ echo another addition >file\n        $ git diff\n\t some context\n        +another addition\n\n\tOk, the \"git diff\" shows the line \"another addition\" being\n\tadded.  Let's check:\n\n\t$ git show HEAD:file\n\n\tHuh? The output does not contain \"another addition\". What is\n\tgoing on?\n\nWhat is going on in the above is an operator error, thinking the\n\"git diff\" gave the change introduced by the commit, while it asked\nthe change to the working tree _since_ the commit.\n"},{"id":"192840","messageId":"4FCD11E7.2060509@xiplink.com","threadId":"30703","inReplyTo":"7vd35ft159.fsf@alter.siamese.dyndns.org","subject":"Re: Help: Found odd git bug","fromName":"Marc Branchaud","fromEmail":"marcnarc@xiplink.com","sentAt":"2012-06-04T19:52:07Z","receivedAt":"2012-06-04T19:52:07Z","isPatch":false,"sender":{"key":"marcnarc@xiplink.com","avatar":"https://avatars.githubusercontent.com/u/14980203?v=4"},"body":"On 12-06-04 01:52 PM, Junio C Hamano wrote:\n> Marc Branchaud <marcnarc@xiplink.com> writes:\n> \n>> A commit claims to add a line to a file.  Indeed, \"git diff\" shows the line\n>> being added.\n>>\n>> However, when I check out the commit, the file contains a *different* line,\n>> with slightly modified contents.\n>>\n>> What's more, \"git show SHA:path/to/file\" shows that the blob contains the\n>> wrong line.\n>>\n>> I found this using git 1.7.9, but 1.7.11.rc1 also shows the problem.\n>>\n>> How can I narrow down what's causing this problem?\n> \n> Without any information useful to diagnose, I would say it probably\n> is not a bug but is an operator error when either of the \"git diff\"\n> or \"check out the commit\" steps were done.  Even if you cannot share\n> the repository, at least a _complete_ command line with arguments is\n> needed.\n\n(Apply egg to face...)\n\nIndeed, not a bug, nor a misunderstanding of git's workings.  Rather, the\noffending file already had a line that the no-longer-problematic commit\nshould have replaced, instead of adding a nearly-identical new line later on\nin the file.  So all this basically stems from not paying enough attention to\nthe diff's context surrounding the change.\n\nSorry for the false alarm, and thanks for the patient reply!\n\n\t\tM.\n"}]}