diff

C# compare algorithms [closed]

删除回忆录丶 提交于 2019-11-28 03:58:56
Are there any open source algorithms in c# that solve the problem of creating a difference between two text files? It would be super cool if it had some way of highlighting what exact areas where changed in the text document also. There's also a c# port of Google's (Neil Fraser) diff, match and patch . There is Menees Diff which will provide you with a C# diff implementation. The source code is included. I've used it in the past with good success wrapping it in my own implemenation. Robert Swift How about this one? : DIFFPLEX Check out diff . Here it is in the gnu project (open source, of

git diff renamed file

纵饮孤独 提交于 2019-11-28 03:52:40
I have a file a.txt . cat a.txt > hello The contents of a.txt is "hello". I make a commit. git add a.txt git commit -m "first commit" I then move a.txt into a test dir. mkdir test mv a.txt test I then make my second commit. git add -A git commit -m "second commit" Finally, I edit a.txt to say "goodbye" instead. cat a.txt > goodbye I make my last commit. git add a.txt git commit -m "final commit" Now here is my question: How do I diff the contents of a.txt between my last commit and my first commit? I've tried: git diff HEAD^^..HEAD -M a.txt , but that didn't work. git log --follow a.txt

How to do a git diff on moved/renamed file?

岁酱吖の 提交于 2019-11-28 03:37:26
I moved a file using git mv . Now I would like to do a diff on the new file to compare it with the old file (with the old, now non-existent name). How do I do this? You need to use -M to let git autodetect the moved file when diffing. Using just git diff as knittl mentioned does not work for me. So simply: git diff -M should do it. The documentation for this switch is: -M[<n>], --find-renames[=<n>] Detect renames. If n is specified, it is a threshold on the similarity index (i.e. amount of addition/deletions compared to the file’s size). For example, -M90% means git should consider a delete

Three Way Merge Algorithms for Text

流过昼夜 提交于 2019-11-28 03:35:27
So I've been working on a wiki type site. What I'm trying to decide on is what the best algorithm for merging an article that is simultaneously being edited by two users. So far I'm considering using Wikipedia's method of merging the documents if two unrelated areas are edited, but throwing away the older change if two commits conflict. My question is as follows: If I have the original article, and two changes to it, what are the best algorithms to merge them and then deal with conflicts as they arise? Kyle Wiens Bill Ritcher's excellent paper " A Trustworthy 3-Way Merge " talks about some of

diff to html (diff2html) program [closed]

纵饮孤独 提交于 2019-11-28 03:27:19
I'm looking for a "diff to html" program, which would generate a static html page from a given diff/patch file. I've googled for it of course, but apart from some scripts I've found there's no "real project" (e.g. no package in Debian/Ubuntu). Have I missed something? Can you recommend anything? zer0 You can use diff2html.py that is able to create a side-by-side diff in a static html page, from an unified diff input. The script is written in python. cat foo.diff | python diff2html.py > foo.html pygments has syntax highlighting for diff (and for lots of other languages), and can be used as a

Can I make git diff ignore permission changes

血红的双手。 提交于 2019-11-28 03:26:40
I unadvertedly change the permissions of my entire tree and commit that change alone with other content changes. I use something like : tar -czf deploy.tar git diff --name-only v1 v2 to generate a tar with the modified files between two tags, the problem is that now because of the permissions change almost all my tree is listed as modified. Is there a way that i could tell git diff to ignore those files which only has the permissions changed? This is an old question, and the answer is already in the comments but: Use the -G<regex> option ("Look for differences whose patch text contains added

Why does git diff on Windows warn that the “terminal is not fully functional”?

亡梦爱人 提交于 2019-11-28 03:17:09
I'm using msysgit 1.7.7.1 on Windows. I get an error when using git diff . What is causing this? Is there no diff tool included in msysgit? What should I do? WARNING: terminal is not fully functional manojlds For Git Bash, this can be fixed by adding the following line to ~/.bashrc: export TERM=cygwin -or- export TERM=msys The first seems to be the original by git for windows, the second a popular known form to "heal" as well. The problem can be caused if some other program (like for example Strawberry Perl ) sets the TERM system environment variables. http://code.google.com/p/msysgit/issues

How do document diff algorithms work?

给你一囗甜甜゛ 提交于 2019-11-28 03:16:16
I want to implement word document differ, what algorithms does it requires to implement? The Most optimize solution of lcs is O(ND) Myer 's algorithm , and here is an algorithmic approach which I used to implement to diff office 2007 documents. Link to algorithm paper Well, generally speaking, diff 'ing is usually solved by the Longest common subsequence problem . Also see the " Algorithm" section of the Wikipedia article on Diff : The operation of diff is based on solving the longest common subsequence problem. In this problem, you have two sequences of items: a b c d f g h j q z a b c d e f

Using Visual Studio 2012's built-in merge tool with Git

女生的网名这么多〃 提交于 2019-11-28 03:04:47
So, I don't know if anyone's noticed but the new Merge Tool packaged with VS2012 is sick-o to the max. I've recently moved to Git for my source control and really want to be able to set up VS2012 as my default difftool/mergetool. Any suggestions as to how to do this? I'd rather the diff/merge is started in the active VS2012 window and not a new instance if possible. If you are using Git Source Control Provider with Visual Studio, it looks like this feature was implemented and is available as of version 1.0.0. Or if you start using Microsoft's tools for git , that will also use the built-in

Compare two folders which has many files inside contents

天涯浪子 提交于 2019-11-28 02:58:31
Have two folders with approx. 150 java property files. In a shell script, how to compare both folders to see if there is any new property file in either of them and what are the differences between the property files. The output should be in a report format. reko_t To get summary of new/missing files, and which files differ: diff -arq folder1 folder2 a treats all files as text, r recursively searched subdirectories, q reports 'briefly', only when files differ John Kugelman diff -r will do this, telling you both if any files have been added or deleted, and what's changed in the files that have