patch

PATCH vs PUT for Update Bill

核能气质少年 提交于 2019-12-10 11:25:32
问题 We have an inventory feature where we generate Bills. There is a Edit Bill API call. We are confused to implement this as PATCH Or PUT. let's say our BillLineItem consists of { stockId quantity rate } A Bill with id = 1 has 2 LineItems : | Stock Id | Qty | Rate | | 10 | 2 | 10 | | 11 | 3 | 20 | Now lets say I want to change the quantity for stock Id : 10 to 5 and I want to change the rate for stock Id : 11 to 40 Should I represent this as PUT Call like : bill : { id : 1 lineItems : [ {

git update/patch on remote host without internet

情到浓时终转凉″ 提交于 2019-12-10 10:05:09
问题 I have a host with access threw vpn for example: 10.0.0.2 That host has no access to my git repository, and to the internet at all. i do not want to copy all the time zip archive with full project and unzip it on 10.0.0.2. git format-patch mybranch --root --stdout > ~/Downloads/mypatch.patch creates me 1gb patch, and i cant apply it. git format-patch -1 HEAD here i can't understand how many commits i need, and how to apply them. So the question is: how can i update my project on that host?

Is there a commonly-used filename extension for unified diff format?

▼魔方 西西 提交于 2019-12-10 02:04:31
问题 E.g. .difffile , .diff ? 回答1: actually most programmers use .patch and sometimes .diff 回答2: I've seen both .diff and .patch, but the most common practice seems to be having no filename extension except for the compression (usually .gz or .bz2). At least that's how it's done for the linux kernel. 来源: https://stackoverflow.com/questions/1260753/is-there-a-commonly-used-filename-extension-for-unified-diff-format

ASP.NET Web API 2 and partial updates

本小妞迷上赌 提交于 2019-12-09 18:15:08
问题 We are using ASP.NET Web API 2 and want to expose ability to partially edit some object in the following fashion: HTTP PATCH /customers/1 { "firstName": "John", "lastName": null } ... to set firstName to "John" and lastName to null . HTTP PATCH /customers/1 { "firstName": "John" } ... in order just to update firstName to "John" and do not touch lastName at all. Suppose we have a lot of properties that we want to update with such semantic. This is quite convenient behavior that is exercised by

How to patch a ConfigMap in Kubernetes

一个人想着一个人 提交于 2019-12-09 16:57:47
问题 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 know I can use kubectrl edit to edit the coredns ConfigMap is there some way I can take the above file containing only the settings I want to insert or update and have it merged on top of or patched over the existing ConfigMap ? The reason for this is

Git apply skips patches

☆樱花仙子☆ 提交于 2019-12-09 14:18:04
问题 I'm trying to apply a patch that includes binary files with git apply but only the files are added. I tried running git apply failing.patch -v and it prints something like: Skipped patch 'file.txt'. Checking patch file.bin... Applied patch file.bin cleanly. How can I find out what's the reason of the skip? As the current message is not very enlightening. 回答1: I found out the problem by running patch -p1 < failing.patch which printed: can't find file to patch at input line 5 and reminded me

TortoiseSVN Apply Patch error

孤人 提交于 2019-12-09 00:30:42
问题 I am trying to apply patch but I get a blank error message (there is no text in it or anything). I have latest version of TortoiseSVN. 回答1: I had the same issue, if you have created the patch from the revision, using "Show changes as unified diff", check the paths in your patch file, this one is correct: Folder/FileName.cs But this one (with absolute path) will cause issues: c:/Folder/FileName.cs Just convert absolute to relative paths. 回答2: Having a look here, seems to be 3 possible root

hatched rectangle patches without edges in matplotlib

做~自己de王妃 提交于 2019-12-08 18:11:00
问题 When trying to add a rectangle patch with a hatch pattern to a plot it seems that it is impossible to set the keyword argument edgecolor to 'none' when also specifying a hatch value. In other words I am trying to add a hatched rectangle WITHOUT an edge but WITH a pattern filling. This doesnt seem to work. The pattern only shows up if I also allow an edge to be drawn around the rectangle patch. Any help on how to achieve the desired behaviour? 回答1: You should use the linewidth argument, which

(git) diff output relative path?

我与影子孤独终老i 提交于 2019-12-08 15:26:54
问题 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 --- a/path/to/file +++ b/path/to/file But what I want is something like: git diff --prefix=/new/path/to diff --git a/new/path/to/file b/new/path/to/file index 0cc125e..9bf911e 100644 --- a/new/path/to/file +++ b/new/path/to/file I have looked over the --relative

How do I create a patch from diff between revisions using TortoiseSVN?

自闭症网瘾萝莉.ら 提交于 2019-12-08 15:11:33
问题 I'm working on a project where Subversion is used to maintain version control. I use TortoiseSVN to access the project repository. Some changes were made between two revisions on a project (let's call them rev1 and rev2), and I want to be able to apply these changes to a working copy somewhere that temporarily does not have access to the repository. I right-clicked on a project folder, clicked 'SVN show log', selected the two revisions and selected 'Show changes as unified diff'. This causes