diff

How to apply `git diff` patch without Git installed?

六月ゝ 毕业季﹏ 提交于 2019-11-27 16:35:00
How can my client apply patch created by git diff without git installed? I have tried to use patch command but it always asks file name to patch. Andrey Kuznetsov git diff > patchfile and patch -p1 < patchfile work but as many people noticed in comments and other answers patch does not understand adds, deletes and renames. There is no option but git apply patchfile if you need handle file adds, deletes and renames. EDIT December 2015 Latest versions of patch command (2.7, released in September 2012) support most features of the "diff --git" format, including renames and copies, permission

Filtering a diff with a regular expression

断了今生、忘了曾经 提交于 2019-11-27 16:04:06
It seems that it would be extremely handy to be able to filter a diff so that trivial changes are not displayed. I would like to write a regular expression which would be run on the line and then pass it another string that uses the captured arguments to generate a canonical form. If the lines before and after produce the same output, then they would be removed from the diff. For example, I am working on a PHP code base where a significant number of array accesses are written as my_array[my_key] when they should be my_array["my_key"] to prevent issues if a my_key constant is defined. It would

Is there a metadata exclusion filter for the SVN DIFF command?

最后都变了- 提交于 2019-11-27 15:51:06
问题 I use SVN as the source control system, and I wonder how to compare directories while ignoring any metadata differences. Is there a way to tell svn diff to compare only the actual content and ignore any metadata? I mean metadata like SVN properties, etc. that don't affect the file content. Assume file X has an additional property in branch B compared to trunk T. Unfortunately it will show up in 'svn diff T B' even though the actual content of file X is the same. I look for something like this

Create “patch” between revisions?

穿精又带淫゛_ 提交于 2019-11-27 14:30:02
问题 It seems SVN's "patch" functionality is not exactly what I want. What I really want is to create a diff of files between revisions. So, I'd choose rev1 and rev 2 and end up with a folder containing all files that were changed or added between those revisions. Can this be done with Tortoise SVN or plain-old svn? 回答1: This can be achieved in tortoise SVN itself. Right click on the branch(folder) from where you want to create the patch >> Show Log >> Select All the revisions for which you need

Change default SVN diffing tool

a 夏天 提交于 2019-11-27 13:58:48
问题 Following a blog, I created a batch file, wm.bat: "d:\svnroot\external\winmerge\WinMerge.exe" /B /WAIT "d:\svnroot\external\winmerge\WinMergeU.exe" /e /ub /dl %3 /dr %5 %6 %7 And I tried calling svn diff | wm but that didn't work. So how do I integrate WinMerge or similar utility with svn diff ? Extending on David's answer below, changing the default for Windows requires editing the configuration file located at (for Windows XP) C:\Documents and Settings\%USERNAME%\Application Data\Subversion

Getting a diff of two json-objects

删除回忆录丶 提交于 2019-11-27 13:57:57
Scenario: I want a function that compares two JSON-objects, and returns a JSON-object with a list of the differences and if possible more data such as coverage metrics. var madrid = '{"type":"team","description":"Good","trophies":[{"ucl":"10"}, {"copa":"5"}]}'; var barca = '{"type":"team","description":"Bad","trophies":[{"ucl":"3"}]}'; If i ran compare(madrid, barca) the returned object could look something like: {"description" : "Bad", "trophies":[{"ucl":"3"}, {"copa":"5"}]}; Or something similar, you get the idea. Does anyone know of a solution to this? I've already found one plugin , but I

.NET Assembly Diff / Compare Tool - What's available? [closed]

早过忘川 提交于 2019-11-27 13:10:05
I'd like to be able to do a code-level diff between two assemblies; the Diff plug-in for Reflector is the closest thing I've found so far, but to compare the entire assembly is a manual process requiring me to drill-down into every namespace/class/method. The other tools I've found so far appear to be limited to API-level (namespaces, classes, methods) differences--which won't cut it for what I'm looking for. Does anyone know of such a tool? My requirements (from highest to lowest) are: Be able to analyze / reflect the code content of two versions of the same assembly and report the

R how can I calculate difference between rows in a data frame

时光怂恿深爱的人放手 提交于 2019-11-27 13:09:43
Here is a simple example of my problem: > df <- data.frame(ID=1:10,Score=4*10:1) > df ID Score 1 1 40 2 2 36 3 3 32 4 4 28 5 5 24 6 6 20 7 7 16 8 8 12 9 9 8 10 10 4 > diff(df) Error in r[i1] - r[-length(r):-(length(r) - lag + 1L)] : non-numeric argument to binary operator Can anyone tell me why this error occurs? diff wants a matrix or a vector rather than a data frame. Try data.frame(diff(as.matrix(df))) Perhaps you are looking for something like this: > tail(df, -1) - head(df, -1) ID Score 2 1 -4 3 1 -4 4 1 -4 5 1 -4 6 1 -4 7 1 -4 8 1 -4 9 1 -4 10 1 -4 You can subtract or add two data.frame

Why would Vim add a new line at the end of a file?

限于喜欢 提交于 2019-11-27 13:04:15
I work with wordpress a lot, and sometimes I changed wordpress core files temporarily in order to understand what is going on, especially when debugging. Today I got a little surprise. When I was ready to commit my changes to my git repository, I noticed that git status was marking one of wordpress' files as not staged for commit. I remember I had reverted all the changes I did to that file before closing it, so I decided to use diff to see what had changed. I compared the file on my project with the file on the wordpress copy that I keep in my downloads directory. It turns out the files

Highlighting added/deleted lines, ignoring moves, in a patch file

£可爱£侵袭症+ 提交于 2019-11-27 12:58:50
问题 I'm reviewing a patch that moved a lot of things around, added a few things, and removed a few things. I'm wondering if anyone's written a utility for picking out the unique adds/removes in a universal diff? That is, an add and a remove of the same line should cancel themselves out. Obviously this isn't useful all the time, but sometimes it's exactly what I want :) 回答1: This is what I ended up using. Example usage: git diff -w | /path/to/ignore_moves.py | less -R ignore_moves.py #!/usr/bin