diff

Show non-merge differences for two commits in git

血红的双手。 提交于 2019-11-27 02:42:36
问题 I have two commits, once of which is the ancestor of another. (They happen to be the start and end points of a branch. I don't think that matters, but I'll include it if it does). I want to see the diff between the two commits, but excluding changes made during merge commits (that is, all commits with more than one parent) that were made between the two commits. (Basically, I want any "real" commit that was made to the branch, excluding the merges.) Is this possible? If so, how do you

How to do text DIFF using PHP?

倖福魔咒の 提交于 2019-11-27 02:32:03
问题 What is the best way to do this for PHP? Is there any PHP function that can do this, considering the column content could be very large? If PHP function is not available, what shell utility can I call? thanks 回答1: there aren't any built in diff functions in PHP. but, hooray for PEAR: Text_Diff (never used it tough, but in PEAR i trust). and there's even a PECL package, xdiff hint: pear classes are pure php, pecl packages are modules. normally, modules are faster than classes, but it also

Compare two files in Visual Studio

限于喜欢 提交于 2019-11-27 02:20:21
I saw new comparsion tool in VS 2012 for comparing two files or two versions of file. I like it. But when I tried to find it I can't because I don't use TFS. Is there a way how can I just compare two files with builtin feature in VS but without TFS? You can invoke devenv.exe /diff list1.txt list2.txt from the command prompt or, if a Visual Studio instance is already running, you can type Tools.DiffFiles in the Command window, with a handy file name completion: You can try VSCommands extension from Visual Studio Gallery . Latest release allows you to select two file and compare them: Inspired

Generate formatted diff output in Java

回眸只為那壹抹淺笑 提交于 2019-11-27 02:08:25
问题 Are there any libraries out there for Java that will accept two strings, and return a string with formatted output as per the *nix diff command? e.g. feed in test 1,2,3,4 test 5,6,7,8 test 9,10,11,12 test 13,14,15,16 and test 1,2,3,4 test 5,6,7,8 test 9,10,11,12,13 test 13,14,15,16 as input, and it would give you test 1,2,3,4 test 1,2,3,4 test 5,6,7,8 test 5,6,7,8 test 9,10,11,12 | test 9,10,11,12,13 test 13,14,15,16 test 13,14,15,16 Exactly the same as if I had passed the files to diff -y

syntax aware diff tools? [closed]

。_饼干妹妹 提交于 2019-11-27 01:49:49
问题 Are there any (ideally GUI) diff tools that are aware of syntax? As an example of the kind of thing I'm looking for, I keep finding that my current tool miss aligns repetitive code: Foo = { 'hello': 'world', | Foo = { 'hello': 'world', 'goodnight': 'moon' | 'goodnight': 'moon' } < < Bar = { 'picture': 1000, < } | } I'd like a tool that would try and make matching braces on one side align with matching braces on the other. Edit: I'm looking for a tool that can automatically spot that condition

How to set patience as default git diff algorithm

不打扰是莪最后的温柔 提交于 2019-11-27 01:27:01
问题 In .git/config I tried: [diff] patience = true But no luck Do I have to do: git diff --patience git show --patience HEAD etc., every time? 回答1: Since Git 1.8.2, Git will use diff.algorithm : git config --global diff.algorithm patience It took a few iterations: [PATCH v3 0/3] Rework git-diff algorithm selection [PATCH v2 0/3] Rework git-diff algorithm selection [PATCH 0/3] Rework git-diff algorithm selection [PATCH] diff: Introduce diff.algorithm variable. [PATCH] config: Introduce --patience

How to make git diff ignore comments

徘徊边缘 提交于 2019-11-27 01:18:20
问题 I am trying to produce a list of the files that were changed in a specific commit. The problem is, that every file has the version number in a comment at the top of the file - and since this commit introduces a new version, that means that every file has changed . I don't care about the changed comments, so I would like to have git diff ignore all lines that match ^\s*\*.*$ , as these are all comments (part of /* */). I cannot find any way to tell git diff to ignore specific lines. I have

Show git diff, ignoring file permission changes?

非 Y 不嫁゛ 提交于 2019-11-27 01:16:01
问题 I have run several chmod in my live server. Right now when I do a git diff there, I see lots of old mode 100644 new mode 100755 I have also changed some files there. But I would just git diff just to show the changes on the files, ignoring the file permissions changes. How can I do that? BTW, I don't want GIT to ignore those file permissions changes. Actually I want to commit them, I just want git diff to not show them for a very specific moment. 回答1: This will tell git to ignore permissions:

Java library for free-text diff [closed]

纵饮孤独 提交于 2019-11-27 01:08:16
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I need to match up two almost-the-same long freetext strings; i.e., to find index-to-index correspondences wherever possible. Because

Text comparison algorithm

心不动则不痛 提交于 2019-11-27 00:33:19
We have a requirement in the project that we have to compare two texts (update1, update2) and come up with an algorithm to define how many words and how many sentences have changed. Are there any algorithms that I can use? I am not even looking for code. If I know the algorithm, I can code it in Java. Typically this is accomplished by finding the Longest Common Subsequence (commonly called the LCS problem). This is how tools like diff work. Of course, diff is a line-oriented tool, and it sounds like your needs are somewhat different. However, I'm assuming that you've already constructed some