diff

git diff for custom 2 files outside of any repository?

十年热恋 提交于 2019-12-02 05:10:28
I need git diff functionality for 2 files that I have outside of any repository. Is there a way to do it? Something like git diff --file1 /path/file1.txt --file2 /path/file2.txt If not, what may be an alternative solution? The answer is right in the git diff documentation (though I admit it's easy to miss): git diff [<options>] --no-index [--] <path> <path> This form is to compare the given two paths on the filesystem. You can omit the --no-index option when running the command in a working tree controlled by Git and at least one of the paths points outside the working tree, or when running

ImageMagick compare: Disregard white matches from the PSNR result

◇◆丶佛笑我妖孽 提交于 2019-12-02 04:56:21
问题 I'm using compare to diff two similar color PNG files. They get a PSNR value of ~27. The images contain a lot of white areas that will always match between the two images. Correct me if i'm wrong, but these white areas are increasing the PSNR values (making the images more similar as an average). Therefore I don't want to take white pixels into account, IF they match. Is there a way to do this using compare or by factoring in some other tool? I tried setting -transparent-color to white, but

perforce diff to git

别来无恙 提交于 2019-12-02 03:09:47
问题 Taking perforce diff when I try to patch this using git am , it says "Patch format detection failed". How do I get my changes from perforce and apply it to git branch? This is the first few lines of diff ==== //depot/a.c#162 - /asdf/a.c ==== 4326a4327,4642 > /* > *---------------------------------------------------------------------------- > * > * -- 回答1: Make sure you produce the diff with p4 diff -du to get the unified diff format, which works much better with tools like patch, and is (I

diff algorithm implementation in python

泄露秘密 提交于 2019-12-02 02:06:58
Hi all: I checked out the source code of Python 2.6, and I want to study the diff implementation in python. However, I can not find the right source file. Could any one give me some information which source file contained the algorithm implementation in Python Thanks for any information! Sven Marnach If by "diff implementation in Python" you mean the difflib module , then here is the source . There is also a simple diff implementation based on this module in the Python source distribution. 来源: https://stackoverflow.com/questions/5897983/diff-algorithm-implementation-in-python

Multilevel JSON diff in python

99封情书 提交于 2019-12-02 01:58:42
Please link me to answer if this has already been answered, my problem is i want to get diff of multilevel json which is unordered. x=json.loads('''[{"y":2,"x":1},{"x":3,"y":4}]''') y=json.loads('''[{"x":1,"y":2},{"x":3,"y":4}]''') z=json.loads('''[{"x":3,"y":4},{"x":1,"y":2}]''') import json_tools as jt import json_delta as jd print jt.diff(y,z) print jd.diff(y,z) print y==z print x==y output is [{'prev': 2, 'value': 4, 'replace': u'/0/y'}, {'prev': 1, 'value': 3, 'replace': u'/0/x'}, {'prev': 4, 'value': 2, 'replace': u'/1/y'}, {'prev': 3, 'value': 1, 'replace': u'/1/x'}] [[[2], {u'y': 2, u

diff algorithm implementation in python

大兔子大兔子 提交于 2019-12-02 01:55:12
问题 Hi all: I checked out the source code of Python 2.6, and I want to study the diff implementation in python. However, I can not find the right source file. Could any one give me some information which source file contained the algorithm implementation in Python Thanks for any information! 回答1: If by "diff implementation in Python" you mean the difflib module, then here is the source. There is also a simple diff implementation based on this module in the Python source distribution. 来源: https:/

ImageMagick compare: Disregard white matches from the PSNR result

这一生的挚爱 提交于 2019-12-02 00:50:12
I'm using compare to diff two similar color PNG files. They get a PSNR value of ~27. The images contain a lot of white areas that will always match between the two images. Correct me if i'm wrong, but these white areas are increasing the PSNR values (making the images more similar as an average). Therefore I don't want to take white pixels into account, IF they match. Is there a way to do this using compare or by factoring in some other tool? I tried setting -transparent-color to white, but this had no effect. Here is my command: compare -compose src -metric PSNR img1.png img2.png diff.png

File Compare and Highlight - Java [closed]

◇◆丶佛笑我妖孽 提交于 2019-12-01 21:24:09
I want to compare two text files and want to highlight the differences. Can any one of you help me in doing that thro Java program. Thanks in advance. The google-diff-match-path library seems to provide the functionality you need. Here's a demo of it in action. In Eclipse right click on filename in navigator bar, then select "Compare With". aioobe Copying one of my answers from a related question : I would go for netbeans diff api. How to use the diff api in netbeans and, NetBeans Diff API From the later url: Although not a visual implementation, you also have a translation of gnu diff in java

Teamcity - which external diff viewer

廉价感情. 提交于 2019-12-01 17:33:32
Do You know any tools that can be used as external diff viewer for Teamcity's Visual Studio plugin? I'm using Visual Studio 2010 Pro and Teamcity 5.1.2. Noffls We use Beyond Compare 3 which is very easy to use with the TeamCity Plugin (set the path to the executable (BComp.exe) and set %1 %2 /lefttitle="%3" /righttitle="%4" as the Command Arguments. A good open source alternative is WinMerge . With Beyond Compare 3, I use %1 %2 /lefttitle="%3" /righttitle="%4" /leftreadonly The last option makes it so you can't accidentally edit base file For WinMerge (set path to WinMergeU.exe), I use the

Teamcity - which external diff viewer

若如初见. 提交于 2019-12-01 16:42:44
问题 Do You know any tools that can be used as external diff viewer for Teamcity's Visual Studio plugin? I'm using Visual Studio 2010 Pro and Teamcity 5.1.2. 回答1: We use Beyond Compare 3 which is very easy to use with the TeamCity Plugin (set the path to the executable (BComp.exe) and set %1 %2 /lefttitle="%3" /righttitle="%4" as the Command Arguments. A good open source alternative is WinMerge. 回答2: With Beyond Compare 3, I use %1 %2 /lefttitle="%3" /righttitle="%4" /leftreadonly The last option