diff

Is there a way to configure vimdiff to ignore ALL whitespaces?

家住魔仙堡 提交于 2019-11-28 17:09:10
I'm using vim -d file1 file2 in order to see the differences between them. This works fine, but I want to ignore whitespace changes - they are irrelevant for source code files. Vim help states that the following command will do the magic: set diffopt+=iwhite But unfortunately, this command only adds -b to diff tool command line, and that only ignores trailing whitespaces. The correct command line key for diff should be -w , to ignore all whitespace changes. But I can't find how to modify the diff command line directly from Vim. Of course I can compile a custom diff, or replace diff with diff

SVN diff across 2 different repositories

和自甴很熟 提交于 2019-11-28 16:53:43
I have 2 repositories. As the trunk code was in one repository, which was protected, I did a checkout and then checked in to the other repository (as users did not have permission to the first protected one). Now the issue is that both the repositories have been worked on and we wish to finally merge the code/branch in the second unprotected one with the protected one. But, there will be conflicts in these. Is there a way to find out the diff for the 2 repository branches? Also, if there are whitespace changes, how do I ignore those? I don't know of a built-in subversion feature that would

Python difflib: highlighting differences inline?

陌路散爱 提交于 2019-11-28 16:52:50
When comparing similar lines, I want to highlight the differences on the same line: a) lorem ipsum dolor sit amet b) lorem foo ipsum dolor amet lorem <ins>foo</ins> ipsum dolor <del>sit</del> amet While difflib.HtmlDiff appears to do this sort of inline highlighting, it produces very verbose markup. Unfortunately, I have not been able to find another class/method which does not operate on a line-by-line basis. Am I missing anything? Any pointers would be appreciated! For your simple example: import difflib def show_diff(seqm): """Unify operations between two compared strings seqm is a difflib

How to compare two files not in repo using git

做~自己de王妃 提交于 2019-11-28 16:27:33
I'd like to compare two css files which are not in any git repository. Is there such a functionality in git? Kyle Burton git 's diff is more functional than the standard unix diff . I often want to do this and since this question ranks highly on google, I want this answer to show up. This question: How to use git diff --color-words outside a Git repository? Shows how to use git to diff files where at least one of them is not in the repository by using --no-index : git diff --no-index file1.txt file2.txt It doesn't matter which one is tracked by git and which is not - one or both can be

Creating a patch file from a diff of 2 folders

人走茶凉 提交于 2019-11-28 16:17:35
问题 I made some changes to an open source project without taking time to create proper patch files. Now, the maintainer of the project released a new version, and among new and edited files, there are a bunch of renamed files. Whats is the best way to apply my changes to the new version ? I'm completely new to diff/patch use, and If I can get it done with git, it would be better. 回答1: If you have two directories a and b that are similar, and you want b to be the same as a , you can create and

Differences for a certain folder between git branches [duplicate]

好久不见. 提交于 2019-11-28 16:06:45
问题 This question already has answers here : How do I git diff on a certain directory (5 answers) Closed 2 years ago . As in the title, I want to have a diff file for a certain folder between the master branch and a branch I have created. 回答1: You can use git diff master..yourbranch path/to/folder 回答2: git diff compares trees (as in hierarchies of source files at two different points in time), so it can't extract the changes done by a certain author. If you want to see what changes a user

Unable to diff files in two separate branches in Git

蓝咒 提交于 2019-11-28 15:52:31
I have FileA in branchA and FileB in branchB. The problem is that I can access only one file at time. I would like to be able to compare the files by FileMerge or meld, since they are the only diffTools whichI have found for Mac. How can you diff by meld/FileMerge the two files ? [Solved]: 1st developed Problem: FileMerge does not allow standard input Masi: You can use opendiff to allow FileMerge to have files from standard input. So the next problem is to find how to make git's diff tool to use opendiff. 2nd developed Problem: to make Git's diff tool to use opendiff in Mac Jakub Narębski You

How to view revision history for Mercurial file?

牧云@^-^@ 提交于 2019-11-28 15:50:58
For a given file in a Mercurial repository, how can you see the revision history? And how can you diff two revisions of the file? Ideally doing all this with visual tools (we use ExamDiff to do some other diffs). I'd say this is basic source control functionality but I can't seem to figure out how to do this with Mercurial. hg log file hg diff -r 10 -r 20 file Geoffrey Zheng The hgk extension gives you hg view file command that shows a visual history, from which you can diff/vdiff arbitrary pair of revisions. TortoiseHg gives you thg log file command that does the same thing but looks better.

Is there a diff-like algorithm that handles moving block of lines?

烈酒焚心 提交于 2019-11-28 15:47:45
The diff program, in its various incarnations, is reasonably good at computing the difference between two text files and expressing it more compactly than showing both files in their entirety. It shows the difference as a sequence of inserted and deleted chunks of lines (or changed lines in some cases, but that's equivalent to a deletion followed by an insertion). The same or very similar program or algorithm is used by patch and by source control systems to minimize the storage required to represent the differences between two versions of the same file. The algorithm is discussed here and

How to download a single commit-diff from GitHub?

雨燕双飞 提交于 2019-11-28 15:46:19
I would like to get a single commit (let's call it ${SHA} ) from GitHub via the web-interface. For example, something like: $ git clone http://github.com/foo/bar $ cd bar $ git format-patch -o .. ${SHA}~1..${SHA} $ cd .. $ rm -rf bar ...but without having to clone the entire repository (the repo in question is large). Obviously GitHub can display the diff of a given commit via the web interface, but how I can extract that into a (unified) diff-file (ideally, with the commit-message intact)? umläute OK, found the answer myself. Adding .patch (or .diff ) to the commit-URL will give a nice patch: