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
39
votes
5 answers

How to patch a ConfigMap in Kubernetes

Kubernetes ships with a ConfigMap called coredns that lets you specify DNS settings. I want to modify or patch a small piece of this configuration by adding: apiVersion: v1 kind: ConfigMap data: upstreamNameservers: | ["1.1.1.1", "1.0.0.1"] I…
Muhammad Rehan Saeed
  • 35,627
  • 39
  • 202
  • 311
39
votes
2 answers

Why is git apply of a patch with binary files not creating the binary files?

I have a git patch with two binary files (it's libraries, newly added). I tried to apply the patches but the binary files are not created. I tried git apply with the --binary option. Is there any other option to add the binary files from git patch?…
Anjo John
  • 533
  • 1
  • 5
  • 7
39
votes
1 answer

How / Where to find Linux Kernel Bugs to Fix?

I'm trying to find bugs that needs to be fixed in the Linux Kernel but I don't know where to look. I watched the video "How to Submit Your First Linux Kernel Patch" by Greg Kroah-Hartman on Youtube, but he doesn't really mention where to find bugs…
GHe
  • 499
  • 1
  • 4
  • 10
38
votes
1 answer

Patch - Why won't the relative patch target name work?

I've imported a class from a module, but when I try to patch the class name without it's module as a prefix I get a type error: TypeError: Need a valid target to patch. You supplied: 'MyClass' For example, the following code gives me the above…
golmschenk
  • 11,736
  • 20
  • 78
  • 137
37
votes
2 answers

(git) diff output relative path?

I need to get some diffs in my repo that are not relative to the base of the repo, but instead relative to a given base or given path. By default I get: git diff diff --git a/path/to/file b/path/to/file index 0cc125e..9bf911e 100644 ---…
user318904
  • 2,968
  • 4
  • 28
  • 37
35
votes
6 answers

Git: How to create patches for a merge?

When I use git format-patch, it doesn't seem to include merges. How can I perform a merge and then e-mail it to someone as a set of patches? For example, let's say that I merge two branches and perform another commit on top of the merge: git…
geofflee
  • 3,513
  • 2
  • 23
  • 23
35
votes
6 answers

Is there a way to diff files from C++?

I'm looking for a C or C++ diff library. I know I can use the Unix diff tool in combination with system or exec, but I really want a library. It would be handy if the library could perform patches as well, like the Unix patch tool.
Matt Fichman
  • 5,458
  • 4
  • 39
  • 59
35
votes
2 answers

Does the jQuery ajax call support PATCH?

When I send this ajax rquest: $.ajax({ headers : { 'Accept' : 'application/json', 'Content-Type' : 'application/json' }, url : 'http://localhost:8080/wutup/venues/12', …
Sam
  • 831
  • 2
  • 8
  • 16
33
votes
2 answers

Including new files in SVN diff

I have a script which builds my application, uploads it to a remote machine, runs a performance test there and captures some metrics that I care about. The script creates a patch file for the local modifications I make in my workspace and shows it…
Binil Thomas
  • 13,699
  • 10
  • 57
  • 70
31
votes
9 answers

I don't "get" how a program can update itself. How can I make my software update?

Say I make an .exe file and everything is peachy. Wonderful it works. Say I worked on a new feature on the software and I want it to be available for people who already have the older version, how can I make the software find my new version, patch…
Sergio Tapia
  • 40,006
  • 76
  • 183
  • 254
30
votes
3 answers

How to read patch .rej files

I'm having trouble applying a patch to my source tree, and it's not the usual -p stripping problem. patch is able to find the file to patch. Specifically, my question is how to read / interpret the .rej files patch creates when it fails on a few…
Rudy
30
votes
2 answers

Replace a class within the Java class library with a custom version

The class BasicLabelUI in javax/swing/plaf/basic is affected by a confirmed bug. In my application I need functionality provided by the fixed version (filed for v9). Due to both legal and technical reasons, I'm still bound to the affected JDK…
bogus
  • 867
  • 6
  • 14
  • 24
30
votes
6 answers

How do patches work in Git?

I'm new to Git, but familiar with SVN. As a test I made a repository in a local directory with git init. Then I cloned the empty repository (over SSH using 127.0.0.1, which is another thing I wanted to test) to another local directory. I added some…
Pieter
  • 31,619
  • 76
  • 167
  • 242
30
votes
8 answers

How to create a patch file on windows?

On windows, I have two source files and want to create a patch with difference, like this one. But I'm unsure, what format this patch is and what app to use in order to create it? GNU diff output is very different from the patch I can see in the…
grigoryvp
  • 40,413
  • 64
  • 174
  • 277
30
votes
3 answers

Can I modify git-add's hunk size?

I have a file that I've been working on and then realized that I had a mistake in it a few lines above where I've been working. I quickly fixed the mistake and want to commit it before I commit the rest of my work. Great, this is where git add…
pr1001
  • 21,727
  • 17
  • 79
  • 125