views:

133

answers:

2

This was one of my interview questions which i couldn't answer.... Is it related to web developement?

  • What really is a patch?

and my interview question was

  • how will u start new patch?
+4  A: 

A patch is a small release of source code that fixes a specific (and usually critical) issue in a product. Patches are also usually released outside of a normal release cycle due to an urgent issue.

Andrew Hare
Should a patch be a small release of `binary` instead of `source code`?
SiLent SoNG
It *can* be a binary patch.
nos
Better say "a small release of `software`".
SiLent SoNG
I am merely being as general as possible - even a binary patch was at some point source code.
Andrew Hare
+2  A: 

patch(1) is a program that comes with most every Unix or Linux type system which takes a diff file as input and applies the differences that file contains. This means one developer can run the diff(1) tool on two versions of a bit of source code, then send the resulting diff file to someone else with one of these source versions, and they can patch their copy to look like the other version.

There are several different diff formats. patch(1) likes unified diffs best.

It is common for open source projects to request patches from outsiders in unified diff format. This lets the outsider make their changes, then produce a patch (that is, a unified diff file) that someone with checkin rights can apply to the source repository directly. Some source management systems -- Subversion, for example -- make this easy: "svn diff" gets you a unified diff, which isn't the default with the regular Unix diff command. You can thus say something like "svn diff > my-changes.patch" and get a patch file.

Warren Young