[Toybox] [PATCH]patch: support unified diffs with unusual timestamp formats

Rob Landley rob at landley.net
Wed Aug 28 15:01:23 PDT 2019


On 8/28/19 4:44 PM, Rob Landley wrote:
> On 8/28/19 3:16 PM, William Haddon wrote:
>> This supports patches that have timestamp formats like
>> "--- a/libgomp/config/posix/time.c	Thu Dec 24 11:24:47 2015
>> -0500"
>> which do not begin with a digit. An example is the musl support patches 
>> for GCC 5 at https://github.com/GregorR/musl-gcc-patches , which seem 
>> to have been generated by Mercurial.
> 
> I.E. "drop support for filenames with tabs in them"?

Sigh. I can't even retarget xparsedate() for this because it's not a date format
supported by the existing date command, can't be used as an input to "tar" or
"touch"... It's not a date format that's actually comes _up_ before so it can't
be recognized AS a date.

Hmmm... although...

$ diff -u sub sub2
diff -u "sub/one\ttwo" "sub2/one\ttwo"
--- "sub/one\ttwo"	2019-08-28 16:57:21.431920511 -0500
+++ "sub2/one\ttwo"	2019-08-28 16:57:41.379919636 -0500
@@ -1,5 +1,4 @@
 one
 two
-three
 four
 five

Interesting? The gnu/dammit diff -u is _quoting_ filenames in certain
circumstances? Hmmm... Ok, under _what_ circumstances it it quoting...

(Today has been a day where everything I touch explodes into tangents that go on
the todo list. It's kind of frustrating. It looks like I start a new job and fly
to tokyo next week, fingers crossed, and I was trying to get the shell and make
root and such to a good stopping point and get a release out, so of COURSE it's
tangents and flying shrapnel.)

Rob



More information about the Toybox mailing list