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
12
votes
2 answers

git apply a patch as much as possible when failing

I am moving from one repository to another and need to port some of the changes. The directory structure is mostly the same but the files not all identical. I am using 'git format-patch' and 'git am' or 'git apply' to port those changes. When it…
Matthieu
  • 16,103
  • 10
  • 59
  • 86
12
votes
1 answer

Prevent to patch if the area is already filled

This is quite a tough challenge I have with my code. First of all the code I am putting here is not runnable because I am using an Excel sheet (but I am happy to email it if people want to try using my code). What I have is an Excel sheet with data…
12
votes
3 answers

Create patch and apply patch in SmartGit

I have a online repository hosted at Bitbucket but one of the developers has Internet connection problems and most of the time can't connect to the repository. In order to mantain the same code at repository and shared between developers I think in…
ReynierPM
  • 17,594
  • 53
  • 193
  • 363
12
votes
1 answer

git apply : error trailing whitespace

Lately, I've been playing a little bit with git. I'm trying to simulate to apply a patch to my master branch, this patch comprehends a commit where I added some comments to a java operation. I generated the patch using git format-patch. Then I…
ben S
  • 123
  • 1
  • 1
  • 4
12
votes
3 answers

memory exhausted : for large files using diff

I am trying to create a patch using two large size folders (~7GB). Here is how I'm doing it : $ diff -Naurbw . ../other-folder > file.patch But maybe due to file sizes, patch is not getting created and giving an error: diff: memory exhausted I…
pritam
  • 2,452
  • 1
  • 21
  • 31
11
votes
1 answer

Create a patch from a multiple revisions in TortoiseSVN using a commandline

I tried to create a patch by using TortoiseSVN -> Create Patch.. but it only allows me to retrieve one of the most recent revision. I know that there is a way to create a patch from a set of revisions using a commandline. How do we do this?
Best
  • 2,200
  • 9
  • 30
  • 49
11
votes
3 answers

Create a patch to add a kubernetes annotation

I would like to write an mutating webhook to add a default ingress class to all ingress object, that do not explicitly provide one. According to the examples I found I need to provide a proper json patch for the webhook to return. I first tried my…
michas
  • 25,361
  • 15
  • 76
  • 121
11
votes
2 answers

check if git apply was already applied

This question is about git apply Is there a way to distinguish between: it failed because... ... the patch is already applied ... the source code is really different The directory i work in is not a git directory, therefore i can't use git log or…
ataraxis
  • 1,257
  • 1
  • 15
  • 30
11
votes
2 answers

How to mock in python and still allow the actual code of mocked function to execute

I have recently started using the mock framework in python. It seems that if I patch a function, the actual code is not called - which means that the database changes etc that this actual function does is not implemented. I have been trying to go…
dowjones123
  • 3,695
  • 5
  • 40
  • 83
11
votes
3 answers

Embedded Linux – mechanism for deploying firmware updates?

I am considering developing on the Yocto project for an embedded Linux project (an industrial application) and I have a few questions for those with experience with embedded Linux in general -- Yocto experience a bonus. Just need to get an idea of…
user5153351
11
votes
5 answers

How to apply a patch in android studio?

I have only a few months android experiece .Recently I updated to android studio 1.2 and the update broke the preview pane , i would like to help with this bug by checking what works and what doesnt , It says here in the Known issues page…
Sainath S.R
  • 3,074
  • 9
  • 41
  • 72
11
votes
1 answer

How to properly apply a patch with moved/renamed files using Git

I'm trying to properly create and apply patches using Git: I created a new git project, with two files: first.txt and second.txt I create a branch In this new branch, I modify the content of both files and commit I move the file second.txt to…
slaadvak
  • 4,611
  • 1
  • 24
  • 34
11
votes
3 answers

How to release patches for Java programs

I've recently released a cross platform Java application. For distribution we created a NSIS installer for Windows and used a DMG for Mac (that has JarBundled .app file). We also plan on creating Linux RPMs, DEBs and tarballs. In total that's 5…
cdmckay
  • 31,832
  • 25
  • 83
  • 114
11
votes
4 answers

Methods to hex edit binary files via Powershell

Am trying to perform binary hex edit from the command line using only powershell. Have had partial success performing a hex replace with this snip. Problem springs up when 123456 occurs multiple times and the replacement was only supposed to occur…
Knuckle-Dragger
  • 6,644
  • 4
  • 26
  • 41
11
votes
1 answer

How to write comments inside a patch/diff file?

I would like to review a patch of a colleague. We are unable to use a review tool. So I would like to comment the patch file he made. Is it possible to write inline comments to a (svn) patch file? I couldn't find any information in the svn red book…
SpaceTrucker
  • 13,377
  • 6
  • 60
  • 99