git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Marc Branchaud <marcnarc@xiplink.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: Help: Found odd git bug
Date: Mon, 04 Jun 2012 10:52:50 -0700	[thread overview]
Message-ID: <7vd35ft159.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <4FCCE433.7090007@xiplink.com> (Marc Branchaud's message of "Mon, 04 Jun 2012 12:37:07 -0400")

Marc Branchaud <marcnarc@xiplink.com> writes:

> A commit claims to add a line to a file.  Indeed, "git diff" shows the line
> being added.
>
> However, when I check out the commit, the file contains a *different* line,
> with slightly modified contents.
>
> What's more, "git show SHA:path/to/file" shows that the blob contains the
> wrong line.
>
> I found this using git 1.7.9, but 1.7.11.rc1 also shows the problem.
>
> How can I narrow down what's causing this problem?

Without any information useful to diagnose, I would say it probably
is not a bug but is an operator error when either of the "git diff"
or "check out the commit" steps were done.  Even if you cannot share
the repository, at least a _complete_ command line with arguments is
needed.

For example, we can _reproduce_ your symptom description like this.

	$ echo this line was added >file
        $ git add file
        $ git commit -m 'added a line'
        
	$ echo another addition >file
        $ git diff
	 some context
        +another addition

	Ok, the "git diff" shows the line "another addition" being
	added.  Let's check:

	$ git show HEAD:file

	Huh? The output does not contain "another addition". What is
	going on?

What is going on in the above is an operator error, thinking the
"git diff" gave the change introduced by the commit, while it asked
the change to the working tree _since_ the commit.

  reply	other threads:[~2012-06-04 17:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-04 16:37 Help: Found odd git bug Marc Branchaud
2012-06-04 17:52 ` Junio C Hamano [this message]
2012-06-04 19:52   ` Marc Branchaud

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vd35ft159.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=marcnarc@xiplink.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).