Subject: Re: [PATCHv2 1/2] git-patch-id: test for "no newline" markers

From: Jakub Narebski <[email-masked]>
Date: Thu, 17 Feb 2011 03:55:46 -0800 (PST)

Michael J Gruber <[email-masked]> writes:

> Currently, patch-id trips over our very own diff extension for marking
> the absence of newline at EOF.

This is not *our* diff extension; it is either GNU diff extension, or
it is defined in diff/patch format standard.

diff.info states in chapter "Incomplete Lines":

     When an input file ends in a non-newline character, its last line is
  called an "incomplete line" because its last character is not a
  newline.  All other lines are called "full lines" and end in a newline
  character.  Incomplete lines do not match full lines unless differences
  in white space are ignored (*note White Space::).

     An incomplete line is normally distinguished on output from a full
  line by a following line that starts with `\'. [...]

     For example, suppose `F' and `G' are one-byte files that contain
  just `f' and `g', respectively.  Then `diff F G' outputs

       1c1
       < f
       \ No newline at end of file
       ---
       > g
       \ No newline at end of file

  (The exact message may differ in non-English locales.)

-- 
Jakub Narebski
Poland
ShadeHawk on #git