Reputation: 32354
As far as I know, a patch is a file describing the differences between some files. It seem like a neat way to communicate changes in source code.
But a git commit does that, and so much more. Why send patch files over the email when you could do pull requests (with all the associated metainformation, git mechanisms, and automation)?
Essentially, why/when is one used over the other?
Upvotes: 2
Views: 120
Reputation: 3801
Good question.
Let’s just assume that everyone is using Git. Then why ever use patches?
Some downsides of using commits:
git format-patch
and git send-email
you just need to have
an email provider configured to send emails on your behalfIf you’re—skilled—I can’t comment personally on this point—, you can go from having a regular conversation to proposing changes immediately. For example: [1]
> So we should do such-and-such.
Makes sense to me. How about this patch?
-- >8 --
Subject: [IA64] Put ia64 config files on the Uwe Kleine-König diet
arch/arm config files were slimmed down using a python script
man git format-patch
Upvotes: 1
Reputation: 2263
One reason is that a patch is generic mechanism and is supported in every version control system (svn, cvs etc.). You can create patches of any changes in your file system, not even being under version control! Pull requests, on the other hand, are quite handy, but this is github (bitbucket etc.) specific mechanism, so it's less generic.
I think also some projects use patches because of historical reasons/habits.
Upvotes: 1