diff

How do I diff utf-16 files with GNU diff?

橙三吉。 提交于 2019-11-29 16:37:34
问题 GNU diff doesn't seem to be smart enough to detect and handle UTF-16 files, which surprises me. Am I missing an obvious command-line option? Is there a good alternative? 回答1: From the GNU diff documentation: Handling Multibyte and Varying-Width Characters diff, diff3 and sdiff treat each line of input as a string of unibyte characters. This can mishandle multibyte characters in some cases. For example, when asked to ignore spaces, diff does not properly ignore a multibyte space character.

How to efficiently work with gettext PO files when making small edits to large text values

雨燕双飞 提交于 2019-11-29 14:17:46
问题 Looking for tips and/or tools on how to efficiently work with gettext PO files when making small edits to large msgid values. Example: We have lots of multi-sentence/multi-paragraph messages that are stored in our PO message catalog files. If we make a very minor change to a message, perhaps editing a single sentence or even correcting punctuation, we lose our original translation when we run the msgmerge utility. Rather than re-translate long messages (that have already gone through an

Subversion diff for zipped xml file

笑着哭i 提交于 2019-11-29 14:07:24
问题 I'm using MySQL Workbench to maintain the database schema for an application. The .mwb file that Workbench uses, which is a zipped XML document, is kept in a Subversion repository. The file is treated as binary data by Subversion, so I cannot use svn diff to show the changes, for example before committing. Since the data is really XML, I'm thinking there might be some way to show the diff anyway, maybe some script that unzips the file before, or some plugin to svn diff . The ideal solution

What is the diff version git use? diff2 or diff3?

匆匆过客 提交于 2019-11-29 12:40:57
Does anyone has clue which is the diff version used by git? This article for example explain in details the diff algorithm for dummies but whats is the actual algorithm which is used? For general knowledge here specs for diff2 & diff3 . diff2 : http://www.xmailserver.org/diff2.pdf diff3 : http://www.cis.upenn.edu/~bcpierce/papers/diff3-short.pdf I know you can configure git to use diff2 or diff3 git config --global merge.conflictstyle diff3 You seem to be confusing 3 different things The unix command line tool diff3 provided by GNU diffutils The output format of the diff that git provides (in

Diff between two dataframes in pandas

佐手、 提交于 2019-11-29 11:47:04
I have two dataframes both of which have the same basic schema. (4 date fields, a couple of string fields, and 4-5 float fields). Call them df1 and df2 . What I want to do is basically get a "diff" of the two - where I get back all rows that are not shared between the two dataframes (not in the set intersection). Note, the two dataframes need not be the same length. I tried using pandas.merge(how='outer') but I was not sure what column to pass in as the 'key' as there really isn't one and the various combinations I tried were not working. It is possible that df1 or df2 has two (or more) rows

is it possible to add a comment to a diff file (unified)?

泄露秘密 提交于 2019-11-29 10:42:20
问题 I wonder if it's possible to add a certain amount of unparsed content to a diff file (unified) that is ignored as a comment. One good use of this would be having git diffs augmented with important information such as from which branch is that diff from (especially when using the --full-index option, which merely displays the blob references). 回答1: The unified diff starts with two line header: --- from-file from-file-modification-time +++ to-file to-file-modification-time Anything before this

xml diff in ruby? [closed]

南笙酒味 提交于 2019-11-29 07:39:04
What is the best/fastest way to merge two xml documents with ruby? I have two xml files, one that's formatted so it is visually appealing, one that isn't (and it has comments and whitespaces stripped) that has a few changes to some of the nodes throughout, and it gets changed often. So I'm trying to figure out a simple and efficient solution to check what's changed (they may not all have IDs), and merge the old document with the formatted document. Ara Howard posted a snippet a few months ago for comparing XML documents: Comparing XML . There's a gem for this equivalent-xml Are the changes

Using Mercurial, is there an easy way to diff my working copy with the tip file in the default remote repository

纵然是瞬间 提交于 2019-11-29 07:14:59
问题 When using mercurial, I'd like to be able to diff the working copy of a file with the tip file in my default remote repository. Is there an easy way to do this? I know I can do an "hg incoming -p" to see the patch sets of changes coming in, but it'd be nice to just directly see the actual changes for a particular file that I'd get if I do a pull of the latest stuff (or what I might be about put push out). The easiest thing I can think of right now is to create a little script that takes a

How to make “git diff” output normal diff format (non-unified, non-context)?

扶醉桌前 提交于 2019-11-29 06:58:58
问题 I want git diff to output normal, plain old diff output (not unified diff, and not context diff). I want this: $ diff file1 file2 2c2 < b --- > B 4d3 < d 5a5 > f I do NOT want unified output: $ diff -u file1 file2 --- file1 2012-07-04 07:57:48.000000000 -0700 +++ file2 2012-07-04 07:58:00.000000000 -0700 @@ -1,5 +1,5 @@ a -b +B c -d e +f I do NOT want context output: $ diff -c file1 file2 *** file1 2012-07-04 07:57:48.000000000 -0700 --- file2 2012-07-04 07:58:00.000000000 -0700 *************

git gui - can it be made to display UTF16?

我与影子孤独终老i 提交于 2019-11-29 05:14:38
Is there any way to make git gui display and show diffs for UTF16 files somehow? I found some information , but this is mostly referring to the command line rather than the gui. I have been working on a much better solution with help from the msysGit people, and have come up with this clean/smudge filter. The filter uses the Gnu file and iconv commands to determine the type of the file, and convert it to and from msysGit's internal UTF-8 format. This type of Clean/Smudge Filter gives you much more flexibility. It should allow Git to treat your mixed-format files as UTF-8 text in most cases: