News for hackers. Stuff that matters.
Re:A 35-year-old bug in Patch found in efforts to restore 29... by pwg on Monday August 17, 2020 @02:28PM (#24190213)
If I'm understanding you correctly you are wondering why some filenames are named .old in the header of patch files.

If so, then that is likely an easy answer. No one creates patch files by hand, they are created by diff (or similar tools).

And diff, at least the Unix variant, is used to compare two files and produce an output that will change the first of the two into the second of the two (i.e., it outputs the 'differences' between the two files, hence the utility's name 'diff').

Well, to have two files, one of the files has to be given a different name. So if one is editing a single file, and is not using some kind of source control system that tracks changes, it is common to first do:

    cp file_to_be_edited file_to_be_edited.old
Then, edit "file_to_be_edited".

Then produce a patch by doing:

    diff -u file_to_be_edited.old file_to_be_edited > file_to_be_edited.diff
And since diff puts the filenames of the two files it compares into the header lines of the output unified diff format, you get a file named
.old showing up in the output patch file.
Re:A 35-year-old bug in Patch found in efforts to restore 29... by inopinatus on Monday August 17, 2020 @08:41PM (#24194070)
Well I just want to stop you right there and say that I have sinned and written diffs by hand, and what’s more they were for a sendmail.cf, and if this conjures visions of a cantankerous sandal-wearing Unix admin then so be it
Re:A 35-year-old bug in Patch found in efforts to restore 29... by rascul on Monday August 17, 2020 @09:23PM (#24194355)
I just got flashbacks. My night is now ruined.