diff

How can I visualize per-character differences in a unified diff file?

安稳与你 提交于 2019-11-27 05:56:42
Say I get a patch created with git format-patch . The file is basically a unified diff with some metadata. If I open the file in Vim, I can see which lines have been modified, but I cannot see which characters in the changed lines differ. Does anyone know a way (in Vim, or some other free software that runs on Ubuntu) to visualize per-character differences? A counter example where per-character diff is visualized is when executing vimdiff a b . update Fri Nov 12 22:36:23 UTC 2010 diffpatch is helpful for the scenario where you're working with a single file. update Thu Jun 16 17:56:10 UTC 2016

Semantic Diff Utilities [closed]

杀马特。学长 韩版系。学妹 提交于 2019-11-27 05:52:58
I'm trying to find some good examples of semantic diff/merge utilities. The traditional paradigm of comparing source code files works by comparing lines and characters.. but are there any utilities out there (for any language) that actually consider the structure of code when comparing files? For example, existing diff programs will report "difference found at character 2 of line 125. File x contains v-o-i-d, where file y contains b-o-o-l". A specialized tool should be able to report "Return type of method doSomething() changed from void to bool". I would argue that this type of semantic

View differences of branches with meld?

非 Y 不嫁゛ 提交于 2019-11-27 05:48:54
I know that I can view the difference between HEAD and current state with meld . . But how can I view the differences between branches, for example master and devel with meld? At the moment I do the following steps: Rename folder of working copy For example mv /projectA /projectA_master ) Clone the project again git clone url Switch to devel branch cd projectA && git -b devel origin/devel View differences with meld meld /projectA_Master projectA Isn't there an easier way to get the same result in meld? I only need it to review the changes and not primarily for merging. I also found this issue

How to see the changes between two commits without commits in-between?

Deadly 提交于 2019-11-27 05:45:21
How do you make git diff only show the difference between two commits, excluding the other commits in-between? you can simply pass the 2 commits to git diff like : -> git diff 0da94be 59ff30c > my.patch -> git apply my.patch Asking for the difference /between/ two commits without including the commits in-between makes little sense. Commits are just snapshots of the contents of the repository; asking for the difference between two necessarily includes them. So the question then is, what are you really looking for? As William suggested, cherry-picking can give you the delta of a single commit

Git Diff of same files in two directories always result in “renamed”

假装没事ソ 提交于 2019-11-27 05:41:39
git diff --no-index --no-prefix --summary -U4000 directory1 directory2 This works as expected in that it returns a diff of all the files between the two directories. Files that are added output as expected, files that are deleted also result in the expected diff output. However because the diff takes into account the file path as part of the file name, files with the same name, in the two different directories, result in a diff output with the renamed flag instead of changed. Is there a way to tell git to not take into account the full file path in the diff and only look at the file name, as

Is there a way to diff files from C++?

▼魔方 西西 提交于 2019-11-27 05:22:13
问题 I'm looking for a C or C++ diff library. I know I can use the Unix diff tool in combination with system or exec , but I really want a library. It would be handy if the library could perform patches as well, like the Unix patch tool. 回答1: I think I've found a good solution, finally: The DTL - Diff Template Library --- Tutorial It supports patch. I had to type "diff.cpp" into Google to find it. Hopefully it works! 回答2: It seems like the Google Diff, Match and Patch libraries are what you need.

How to diff ansible vault changes?

十年热恋 提交于 2019-11-27 05:17:35
问题 I'd like to see the actual git commit changes in the ansible vault file. Is there an easy way how to achieve this? 回答1: You can do this very neatly, so that the normal git tools like git log and git diff can see inside the vaulted files, using a custom git diff driver and .gitattributes . Make sure that your vault password is in .vault_password and that that file is not committed - you should also add it to .gitignore . Add a .gitattributes file that matches any files in your repository that

C# compare algorithms [closed]

一笑奈何 提交于 2019-11-27 05:15:29
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . 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. 回答1: There's also a c# port of Google's (Neil Fraser) diff, match and patch. 回答2:

How to compare two files not in repo using git

戏子无情 提交于 2019-11-27 05:10:10
问题 I'd like to compare two css files which are not in any git repository. Is there such a functionality in git? 回答1: 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

Can I make git diff ignore permission changes

冷暖自知 提交于 2019-11-27 05:07:27
问题 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? 回答1: This is an old question, and the answer is