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

Git produces Unidiff - Does it really?

From
JEJan Engelhardt <jengelh@medozas.de>
Date
May 24, 2009, 23:15 UTC
Message-ID
<alpine.LSU.2.00.0905250105410.22963@fbirervta.pbzchgretzou.qr>
Hi,

so I noticed that the diff output generated by git tools, such as "git diff", "git log -p", etc. is not accepted by TortoiseSVN, but is accepted by patch(1). Now I wondered which program could be at fault. Git produces:

	--- a/src/foo.c
	+++ b/src/foo.c
	@@ your hunk goes here... @@
	etc.
Random webpages[1,2] have a tendency wanting to tell me unidiff is
	--- a/src/foo.c	$TIMESTAMP
	+++ b/src/foo.c	$TIMESTAMP
	@@ hunks... @@

instead, i.e. with the timestamp. Since the diff format is known to be sketchy (are there _any_ uptodate specs that are actually followed?), which tool(s) is/are to blame?

 * git for not producing unidiff(-with-a-timestamp)
 * TSVN for not accepting unidiff(-without-a-timestamp)
(* patch for accepting unidiff body together with a non-unidiff file 
   header)
Any insights?
Jan
Next: Junio C Hamano
Message 1 of 3 in “Git produces Unidiff - Does it really?”
  1. Jan EngelhardtMay 24, 2009
  2. Junio C HamanoMay 25, 2009
  3. Jan EngelhardtMay 25, 2009

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.