It's all about the answers!

Ask a question

How to use Patch?


Jirong Hu (1.5k9295258) | asked Oct 31 '11, 7:54 p.m.
What's exactly a patch? In what scenarios we use patch?

Thanks
Jirong

One answer



permanent link
Ulrich Eckhardt (23612223) | answered Nov 01 '11, 4:51 a.m.
What's exactly a patch? In what scenarios we use patch?


A patch is a description of changes made to a file (or a whole directory). In other words, it is the difference between two versions of the file.

Compared to a changeset, it is a bit more flexible and a bit less exact. A changeset is what changes a file from state A to state B. Neither A nor B are negotiable, they are set in stone once the changeset is completed. If you have the file in state C, which is similar to A but still different, you can't apply the changeset.

A patch can be applied to a changed file though, it tries to find the place inside the file where to change things and then applies the changes there. If the file was modified in between creating the patch and applying it, and those changes are where the patch would change the file, applying the patch fails because it can't establish the required context. If the changes are elsewhere, the patch can be applied without problem.

Uli

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.