git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Cc: "rocketscienc01100101 ." <rocketscienc01100101@gmail.com>,
	git@vger.kernel.org
Subject: Re: Bug in git-diff output
Date: Thu, 03 Apr 2014 11:10:19 -0700	[thread overview]
Message-ID: <xmqqeh1eqo6s.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <vpqmwg4c4q8.fsf@anie.imag.fr> (Matthieu Moy's message of "Wed, 02 Apr 2014 14:09:51 +0200")

Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:

> "rocketscienc01100101 ." <rocketscienc01100101@gmail.com> writes:
>
>> http://i.imgur.com/BoJSjm9.png
>>
>> Here's a screenshot that shows the problem.
>
> (better cut-and-paste the text than sending a PNG image)
>
>> There's always a misplaced line in the output (most of the time
>> a[href^=tel] { }), no matter where in the file the changes are.
>
> The part after the @@ are ignored by patch tools. They are here just for
> convenience. They are a guess of what the patch hunk belongs to. For
> C/Java/Ada/... programs, it's the function name. Git does not know about
> CSS syntax, so it guesses wrong (last line starting with a letter I
> guess, not sure exactly what happens when Git doesn't know the syntax).

Ask "git grep -A14 'long def_ff' xdiff/" for details ;-)

This was an attempt to be compatible with stock behaviour of GNU
diff: a line that begins with an alpha, _ or $.

>> Sometimes it's even in the wrong position, above the @@ numbers.
>
> That is strange. Do you have a way to reproduce this?

That indeed is unusual.  If the payload that was identified by the
find_func function has a funny escape sequence or something, you may
get funkiness like that in the output on the terminal, which we may
want to take notice and sanitize in xdl_emit_hunk_hdr(), instead of
straight memcpy() there, but I do not see how that would be an issue
in a css source.

      reply	other threads:[~2014-04-03 18:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-01 10:49 Bug in git-diff output rocketscienc01100101 .
2014-04-01 11:46 ` Jeff King
2014-04-02 10:59 ` rocketscienc01100101 .
2014-04-02 11:05 ` rocketscienc01100101 .
2014-04-02 12:09   ` Matthieu Moy
2014-04-03 18:10     ` Junio C Hamano [this message]

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=xmqqeh1eqo6s.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --cc=git@vger.kernel.org \
    --cc=rocketscienc01100101@gmail.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).