diff

Compare XML ignoring element order

大兔子大兔子 提交于 2019-12-01 16:20:42
With XMLUnit 2 how do you compare two documents without taking the element order into account? I got this question for XMLUnit 1 , but apparently the new API in v2 doesn't have the mentioned method anymore. This is my current code: Diff diff = DiffBuilder.compare(expected) .withTest(actual) .ignoreComments() .ignoreWhitespace() .checkForSimilar() .build(); assertFalse(diff.hasDifferences()); Edit to Stefan Bodewigs comment: These are the two strings i compare with above snippet: String expected = "<root><foo>FOO</foo><bar>BAR</bar></root>"; String actual = "<root><bar>BAR</bar><foo>FOO</foo><

Merge/diff tool that can show authors (supports blame or annotate) in files under version control

◇◆丶佛笑我妖孽 提交于 2019-12-01 16:03:58
When merging files it will be helpful (as for me) to show an author of each line. Is there any diff or merge tool supporting that? The bundled gitk tool is not really a merge tool, but it shows conflicted lines with red and blue and "+"'s in front, and you can Rightclick->"Show origin of this line" on any of them, to go to the commit which introduced the line: You can run your mergetool, or just a text editor with diffmarks in parallel So what you really want is a tool that can easily identify your changes relative to other's changes in a merge conflict, rather actually identify the author of

Does Github have a view that shows diffs between file versions?

别来无恙 提交于 2019-12-01 14:48:19
I'm looking for a view that highlights changes to files, similar to the changes you can see viewing the Edits button for an SO item, or the history of a wiki page. For example https://github.com/clojure/clojure/commit/c89bf2e9bcfc1bca62e36dee2d78a48f8c38c15c You are looking for 'diffs' aka 'changesets'. VonC Note: the change set view not only offer a diff (line by line or side-by-side ), it now (Sept. 4th 2014) offer a word-by-word diff . See: " Better Word Highlighting in Diffs " Commits, compare views, and pull requests now highlight individual changed words instead of the entire changed

ruby difference engine

痞子三分冷 提交于 2019-12-01 14:30:48
Looking for a Ruby differencing engine. So you can do some of the same things meld viewer does. For example you have this first set of code per line: String1 String2 String3 2nd set: String1 String3 String4 The diff would come out to show lines 2 and 3 are different. I already am using this one: http://github.com/pvande/differ , but it's definitely not perfect but pretty good. I would like to add on to it, however I'm trying to find some knowledge on another one before going further with this differ. The "standard" solution is Austin Ziegler's diff-lcs library, which – as the name implies –

How do I do a one way diff in Linux?

本秂侑毒 提交于 2019-12-01 05:33:18
How do I do a one way diff in Linux? Normal behavior of diff: Normally, diff will tell you all the differences between a two files. For example, it will tell you anything that is in file A that is not in file B, and will also tell you everything that is in file B, but not in file A. For example: File A contains: cat good dog one two File B contains: cat some garbage one a whole bunch of garbage something I don't want to know If I do a regular diff as follows: diff A B the output would be something like: 2c2 < good dog --- > some garbage 4c4,5 < two --- > a whole bunch of garbage > something I

How do I do a one way diff in Linux?

纵然是瞬间 提交于 2019-12-01 03:44:46
问题 How do I do a one way diff in Linux? Normal behavior of diff: Normally, diff will tell you all the differences between a two files. For example, it will tell you anything that is in file A that is not in file B, and will also tell you everything that is in file B, but not in file A. For example: File A contains: cat good dog one two File B contains: cat some garbage one a whole bunch of garbage something I don't want to know If I do a regular diff as follows: diff A B the output would be

MySQL DATETIME DIFF query

我的梦境 提交于 2019-12-01 03:20:11
I have a MySQL query that runs via cron every 30 minutes to delete old property listings, the query is: DELETE FROM $wpdb->posts WHERE post_type = 'rentals' AND DATEDIFF(NOW(), post_date_gmt) >=2 right now its in a testing phase and set to delete when the listing is 2 days old, this it does without a problem, the problem that i do have is that i need it to recognise the time from when the listing was posted and the time to when it should be deleted, Basically the table column of post_date_gmt is in the format of 2011-05-26 13:10:56 and the column type is DATETIME when i have the DATEDIFF (NOW(

How to apply a Perforce patch?

前提是你 提交于 2019-12-01 03:05:41
I generated a patch some time ago using the p4 diff command. However, now that I want to apply it, I realize that there is no way to apply a patch in Perforce. Since I did not use the -du option, the patch is in that obscure perforce format and can't be applied with patch(1) . The original changes have been lost. Also, that patch is over 300kb long so manual editing isn't really an option. What are my options ? Are there patch converters, or some Perforce extension allowing the application of these kind of patchs ? Perhaps Perforce's diff output format has changed, but @RumburaK's answer didn

Python - Compare 2 files and output differences

丶灬走出姿态 提交于 2019-12-01 02:38:39
I'm aiming to write a script that will compare each line within a file, and based upon this comparison, create a new file containing the lines of text which aren't in the second file. For example; **File 1:** Bob:20 Dan:50 Brad:34 Emma:32 Anne:43 **File 2:** Dan:50 Emma:32 Anne:43 The new output (File 3): Bob:20 Brad:34 I have some idea of how this needs to be done, but not exactly: def compare(File1,File2): with open(File1, "a") as f1: lines = f1.readlines() string = line.split(':') with open(File2, "a") as f2: lines = f2.readlines() string2 = line.split(':') if string[0] == string[1]: with

How to Diff Files Directly from the Linux Kernel GIT Repository?

 ̄綄美尐妖づ 提交于 2019-11-30 22:18:44
I'd like to be able to diff files / directories directly from the Linux Kernel GIT repository without having to download full source. Specifically, I'm interested in two potential solutions: The ability to do diff's via a web browser ( firefox ) A GUI utility for Ubuntu that can do remote diffs. A tutorial how to setup option #2 Edit As an example of what I'm looking for, I used to use CrossVC for the above tasks on a CVS repo. Gitweb at kernel.org allows to view diff between arbitrary commits, see for example the following link for diff between v2.6.32-rc6 and v2.6.32-rc7: http://git.kernel