diff

Cygwin diff won't exclude files if a directory is included in the pattern

做~自己de王妃 提交于 2020-01-15 15:36:06
问题 I need to do a recursive diff using cygwin that needs do exclude all .xml files from certain directories, but not from other directories. According to the --help option I should be able to do this with with the --exclude=PAT option where PAT is a pattern describing the files I want to exclude from the diff. If I do this: diff -rw --exclude="classes/Services.xml" the diff does not ignore the Services.xml file in the classes directory. If I do this diff -rw --exclude="Services.xml" the diff

Diffing a file against last Mercurial changeset, should it be different?

a 夏天 提交于 2020-01-15 11:09:14
问题 I'm seeing something I don't expect in my Mercurial repo. A change that has been made in a branch is showing up in default. There is no changeset in the log, merge or otherwise, accounting for the change moving into default from the branch. I checked the basics: I'm in default, did an 'hg pull', 'hg update -C', 'hg purge', and an 'hg st' which came back clean. If I look at the file locally the change I am expecting is not there. If I do an 'hg diff -r ' then it tells me that my local file is

Shorthand to view diff of previous version of file

泄露秘密 提交于 2020-01-14 06:57:07
问题 I can easily find out what changed for a file since the last commit with git diff HEAD^ -- <filename> but is there an equivalent shorthand to view a diff for a particular file since it was last committed , regardless of how many commits have happened since? Or to go back N commits of that particular file? Context: I found an error in a file and I want to track down when it snuck in. It's easy enough to get a log report for a particular file with git log -<n> <filename> to show only the

Can difflib be used to make a plagiarism detection program?

喜欢而已 提交于 2020-01-14 05:25:08
问题 I am trying to figure this out... Can the difflib.* library in Python be used to make some kind of plagiarism detection program? If so how? Maybe anyone could help me to figure out this question. 回答1: It could be used, but you're going to face all the same general issues you find in automated plagiarism detection. It might give you a little bit of a head start on implementing some of the algorithms you need, but I don't think it is likely to take you very far. 回答2: The short answer is yes.

XMLDiff fails to recognize differences correcly?

自闭症网瘾萝莉.ら 提交于 2020-01-14 04:21:11
问题 What am I missing here? Is there an option that XMLDiff should care about element names and seek for best match to recognize following changes correctly? a Helper class for making comparisons between two XML files: public class XMLDiffer { public XDocument Diff(string originalXML, string changedXML) { //http://msdn2.microsoft.com/en-us/library/aa302294.aspx XmlDiff xmlDiff = new XmlDiff(XmlDiffOptions.IgnoreChildOrder | XmlDiffOptions.IgnoreComments | XmlDiffOptions.IgnoreWhitespace); xmlDiff

Import changes into a git repository from universal diff

百般思念 提交于 2020-01-13 18:30:33
问题 I'm trying to import changes from one source control system (proprietary and complicated) into a git repository. I'm doing this currently by running a script that simply syncs to each revision in order and commits this to the git repository, but for various reasons this has become unworkable. For each revision, I can get a universal diff describing the change. To me it seems that this should be enough to import history to git, but I can't for the life of me figure out how to get git to do

Github: comparing across forks?

白昼怎懂夜的黑 提交于 2020-01-13 08:23:07
问题 Short version When I compare two forks on Github, it does not compare the latest states, but the current state of the base fork with the last common commit (or am I wrong?); so how can I compare the latest states/heads on Github? Longer version I am trying to compare two repositories on Github. It does not seem to compare the latest states of both repository. Instead, it compares: the base fork as it was when both repositories where identical (last common commit?) with the head fork as it is

Is there a ruby gem that does diff between HTML documents?

老子叫甜甜 提交于 2020-01-13 05:33:07
问题 Doing a diff of two different html documents turns out to be an entirely different problem than simply doing a diff of plain text. For example, if I do a naive LCS diff between: Google</p> and Google</a></p> the diff result is NOT: </a> but /a></ I've tried most gems out there that claim to be html diff but all of them seem to be just implementing text based LCS diff. Is there any gem that does a diff while taking html tags into account? 回答1: After much searching for a gem to do this for me,

How to do the opposite of diff? [duplicate]

半城伤御伤魂 提交于 2020-01-11 19:43:42
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: how to show lines in common (reverse diff)? Is there a command to do the opposite of diff? I want to compare two files if the same thing exists in both create a list of them. i am trying to figure out what entry's exist in both files. 回答1: Here is a solution that WILL NOT change the order of the lines: fgrep -x -f file1 file2 回答2: Use the join command: join a.txt b.txt assuming the files are sorted; if not: sort

How to do the opposite of diff? [duplicate]

不羁的心 提交于 2020-01-11 19:43:06
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: how to show lines in common (reverse diff)? Is there a command to do the opposite of diff? I want to compare two files if the same thing exists in both create a list of them. i am trying to figure out what entry's exist in both files. 回答1: Here is a solution that WILL NOT change the order of the lines: fgrep -x -f file1 file2 回答2: Use the join command: join a.txt b.txt assuming the files are sorted; if not: sort