Questions tagged [patch]

A patch is a piece of software designed to fix problems with, or update a computer program or its supporting data. This includes fixing security vulnerabilities and other bugs, and improving the usability or performance.

Programmers publish and apply patches in various forms. Because proprietary software authors withhold their source code, their patches are distributed as binary executables instead of source. This type of patch modifies the program executable—the program the user actually runs—either by modifying the binary file to include the fixes or by completely replacing it.

Patches can also circulate in the form of source code modifications. In these cases, the patches consist of textual differences between two source code files. These types of patches commonly come out of open source projects. In these cases, developers expect users to compile the new or changed files themselves.

Because the word "patch" carries the connotation of a small fix, large fixes may use different nomenclature. Bulky patches or patches that significantly change a program may circulate as "service packs" or as "software updates". Microsoft Windows NT and its successors (including Windows 2000, Windows XP, and later versions) use the "service pack" terminology.

In several Unix-like systems, particularly Linux, updates between releases are delivered as new software packages. These updates are in the same format as the original installation so they can be used either to update an existing package in-place (effectively patching) or be used directly for new installations.

2809 questions
15
votes
3 answers

How to prevent Vista from requiring elevation on patch.exe?

[I'm sorry that this isn't directly a programming question. But I have recently switched to a new Vista machine where I am keeping UAC enabled (please don't tell me to disable it, it's not an option).] Every time I run gnu's patch.exe I get an…
scobi
  • 14,252
  • 13
  • 80
  • 114
15
votes
1 answer

Python mock.patch decorators affecting other unit tests in the same test suite

I wrote a unit test for main_function and asserted that it calls the function get_things inside it with an instance of a class, mocked with patch as a parameter: @patch("get_something") @patch("MyClass.__new__") def test(self,…
F F
  • 151
  • 6
15
votes
2 answers

Python: patching function defined in same module of tested function

I have been working with Python's unittest.mock library quite a bit, but right now I'm struggling with a use case that may not be approached correctly. Consider a file mymodule/code.py containing the following snippet: def sum(): pass def mul(): …
15
votes
1 answer

Mocking a class method and changing some object attributes in Python

I am new to mock in Python. I want to know how to replace (mock) a class method while testing with another one, knowing that the original just changes some attributes of self without returning any value. For example: def some_method(self): …
Ahmed Ayadi
  • 183
  • 1
  • 1
  • 6
15
votes
3 answers

How do diff/patch work and how safe are they?

Regarding how they work, I was wondering low-level working stuff: What will trigger a merge conflict? Is the context also used by the tools in order to apply the patch? How do they deal with changes that do not actually modify source code behavior?…
cenouro
  • 715
  • 3
  • 15
15
votes
1 answer

How to Prevent "svn diff" from Generating Unicode Output on Windows

On my Windows box, I tried to create a Subversion patch by using the command svn diff > my_patch.diff. The resulting file was encoded with UTF-16, rather than UTF-8 or ASCII, so when I tried to use patch (from GnuWin32) to apply the patch, it…
Kristopher Johnson
  • 81,409
  • 55
  • 245
  • 302
15
votes
4 answers

How do I send a patch to another developer and avoid merge conflicts?

How do I get a patch from a commit in order to send it to another developer? And how do I best avoid a merge conflict with this patch when merging our trees at a later date? If you know how please explain how to do this in your VCS of choice such as…
Spoike
  • 119,724
  • 44
  • 140
  • 158
15
votes
2 answers

applying email patch with git

I would like to apply a patch sent with git-send-email. Currently I have to type everything to the specific files.This is a hacky and very slow as my workload is increasing.I would like to know how I could get a fairly large patch into my git tree…
nevanom
  • 370
  • 1
  • 3
  • 14
15
votes
4 answers

How to create a patch in IntelliJ IDEA?

I've been using IntelliJ IDEA 9.0 Community Edition for some time after years living in Eclipse. One thing seems to be hard to find in it. I'd like to create a patch on some subfolder in my project. In Eclipse it is done using right click, Team,…
Boris Pavlović
  • 63,078
  • 28
  • 122
  • 148
15
votes
6 answers

Is it possible to Create Patch in Eclipse from changes that have already been committed?

I've used the Create Patch facility in Eclipse to create patches for uncommitted changes. I'm looking for a way to create patches in Eclipse for changes that have already been committed to the VCS. Unless I've missed something I don't think this is…
mikej
  • 65,295
  • 17
  • 152
  • 131
15
votes
2 answers

how to apply a git patch as if the author committed to my repo?

Lets suppose there is a central repository where commits from satellite ones are pushed some time. Developer A makes some commits on his repo while B makes some on his own too. Now, A wants to incorporate one of B's commits into his repo (which he…
a1an
  • 3,526
  • 5
  • 37
  • 57
15
votes
3 answers

Creating a git diff from nothing

I am trying to create a patch file to be used via reviewboard. It will be the initial patch. diff -ruN --exclude=.git empty_dir working_dir > mypatch_00.patch works but I am getting a "The selected file does not appear to be a diff." error. Is there…
rxdazn
  • 1,380
  • 1
  • 14
  • 30
15
votes
1 answer

Why is matplotlib.PatchCollection messing with color of the patches?

I make a number of patches like so - node.shape = RegularPolygon((node.posX, node.posY), 6, radius = node.radius, edgecolor = 'none', …
Sterling
  • 3,835
  • 14
  • 48
  • 73
14
votes
3 answers

How do you apply a patch to ruby on rails?

I'd like to apply the action_mailer patch mentioned in this thread but I have never applied a patch before and I'm not sure how these work: https://rails.lighthouseapp.com/projects/8994/tickets/2263 My action mailer gem is here:…
Brian Armstrong
  • 19,707
  • 17
  • 115
  • 144
14
votes
3 answers

Ollydbg equivalent for Mac OS X

is there any good equivalent debugger for Mac OS X? Something that allows patching and saving of the assembly as well (with graphic interface?) Thanks!
Dig
  • 3,850
  • 3
  • 27
  • 33