15 02 | 2013

.diff or .patch?

Written by Tanguy

Classified in : Homepage, Debian, Command line

Silly question: when you use diff(1) to produce a file to be applied with patch(1), do you call the result a diff or a patch? Do you name it foo.diff or foo.patch?

Tags : diff, patch

11 comments

friday 15 february 2013 à 19:50 Josh Triplett said : #1

Both, depending on the semantics of what I've diffed. If I diff (or git diff) two sources with the intent of producing a patch to apply later, I'll call the result .patch . If I diff two sources to compare them without any intent of applying the result as a patch to transform one into the other, I'll call the result .diff .

friday 15 february 2013 à 20:30 Marko Lindqvist said : #2

I used .diff when it was standard. Nowadays .patch is more standard, and in some cases better supported. http://gna.org/patch/?3359

friday 15 february 2013 à 20:41 ®om said : #3

Exactly like comment #1.
http://tanguy.ortolo.eu/blog/article95/diff-or-patch#c1360954248-1

friday 15 february 2013 à 21:24 Mich said : #4

I don't want to apply anything with `patch` anymore since we got git, a more modern interface to patches, including three-way merging and the default atomic apply or fail.

With git in mind, a .diff file is diff or git diff output and .patch is a file in git patch format, with commit message and diff together.

saturday 16 february 2013 à 08:06 Giancarlo said : #5

Never thought about it, but I'm not a developer.
I'll take as a good suggestion, thanks.

saturday 16 february 2013 à 13:48 Peter Eisentraut said : #6

Agreed with Josh (first comment)

saturday 16 february 2013 à 14:38 barak said : #7

bike shed dogpile!

saturday 16 february 2013 à 16:49 Alex said : #8

I use .diff unless I intend to send it to someone else to apply as a patch. I can handle the disconnect between the .diff ending and application as a patch, but I don't assume that others can.

monday 18 february 2013 à 15:57 mirabilos said : #9

Both, but I’d still like to see a good three-letter word for it.

You know, for 8.3 filenames.

monday 18 february 2013 à 16:00 Tanguy said : #10

@mirabilos : If I was in such a case, I would use .dif I think. But I do not use so outdated and poorly conceived systems, fortunately.

tuesday 11 june 2013 à 02:58 wa said : #11

I use .diff and if I get a .patch file, it gets renamed to .diff immediately. Either is fine, they both represent the DIFFerences between files.

Write a comment

What is the last letter of the word cdxzdu? : 

Archives