git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Don't use $author_name undefined when $from contains no /\s</.

From
Jim Meyering <jim@meyering.net>
Date
Oct 19, 2006, 18:16 UTC
Message-ID
<878xjckw7x.fsf@rho.meyering.net>
In-Reply-To
<7vbqo8uvkn.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> wrote:
Show 7 quoted lines
> Jim Meyering <jim@meyering.net> writes:
>
>> I noticed a case not handled in a recent patch.
>
> Thanks. Will apply.
>
> Curiously your patch was whitespace damaged.

I wondered what you meant, so compared what I sent with the output of the command I ran:

  git-format-patch --stdout --signoff HEAD~1

There were two differences, both involving removed trailing blanks. The first was a part of the diff: a line consisting of a single space denoting an empty line in the context. I understood that those types of lines may safely be truncated (removing the trailing blank), and in fact, GNU diff -u (cvs) now does this by default:

2006-09-05  Paul Eggert  <eggert@cs.ucla.edu>
        * NEWS: diff -u no longer outputs trailing white space unless the
        input data has it.  Suggested by Jim Meyering.
        * doc/diff.texi (Detailed Unified): Document this.
        * src/context.c (pr_unidiff_hunk): Implement this.

The only other difference was the removal of the trailing blank following the "--" signature introducer.

I see that git-apply does not handle this new format:
  $ git-apply patch
  fatal: corrupt patch at line 47
That diagnostic comes from builtin-apply.c:
		if (len <= 0)
			die("corrupt patch at line %d", linenr);

It would be nice if git would accept such unified diff output, since no other program we know of rejects them. Paul Eggert has even submitted revised wording to make POSIX allow this style of output.

For reference, the GNU diff thread started here:
  http://lists.gnu.org/archive/html/bug-gnu-utils/2006-09/msg00005.html
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 10 in “Don't use $author_name undefined when $from contains no /\s</.”
  1. Don't use $author_name undefined when $from contains no /\s</.Jim Meyering, Oct 19, 2006
  2. Junio C HamanoOct 19, 2006
  3. Jim MeyeringOct 19, 2006
  4. Junio C HamanoOct 19, 2006
  5. Paul EggertOct 19, 2006
  6. Junio C HamanoOct 19, 2006
  7. Paul EggertOct 19, 2006
  8. Junio C HamanoOct 20, 2006
  9. Linus TorvaldsOct 20, 2006
  10. Jakub NarebskiOct 20, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.