diff

Interactively merge files tracked with git and untracked local files

人走茶凉 提交于 2019-12-10 01:24:08
问题 I use a couple of software packages (like gitlab) that you install by cloning from their git repo. They typically come with some config.example (under version control), which you copy to your own config file (not under version control or even ignored in .gitignore ) and adapt to your needs. When the upstream package is updated and for example changes the config file options that will obviously only be reflected in config.example . Is there a chain of git commands that i'm missing that can

How to use different merge and diff tool in git?

对着背影说爱祢 提交于 2019-12-09 23:45:19
问题 I prefer to use meld as the diff tool. However it doesn't have an option to quickly solve all simple conflicts so in case of merging I'd like to use kdiff3 I've set merge.tool to kdiff3 and diff.guitool to meld but git difftool still always run kdiff3 [merge] tool = kdiff3 conflictstyle = diff3 [diff] guitool = meld renames = copies mnemonicPrefix = true [difftool] prompt = false How to make git difftool run meld ? 回答1: diff.guitool only applies if you use the --gui flag. Setting diff.tool

how to using python to diff two html files

早过忘川 提交于 2019-12-09 16:24:29
问题 i want use python to diff two html files: example : html_1 = """ <p>i love it</p> """ html_2 = """ <h2>i love it </p> """ the diff file will like this : diff_html = """ <del><p>i love it</p></dev><ins><h2>i love it</h2></ins> """ is there such python lib help me do this ? 回答1: lxml can do something similar to what you want. From the docs: >>> from lxml.html.diff import htmldiff >>> doc1 = '''<p>Here is some text.</p>''' >>> doc2 = '''<p>Here is <b>a lot</b> of <i>text</i>.</p>''' >>> print

mercurial - see changes on the branch ignoring all the merge commits

自作多情 提交于 2019-12-09 16:19:50
问题 I have a branch that was developed for a long period of time. During the development default branch was merged into that branch several times. I would like now to review all the changes done on that branch ignoring merges, to decide whether it is safe to merge it to default. I tried hg diff -r "branch('myBranch') - merge()" but it still shows changes introduced by merges. Also tried following this How to show the diff specific to a named branch in mercurial but hg diff -r "branch('myBranch')

Version Control with XML diff and merge

白昼怎懂夜的黑 提交于 2019-12-09 16:11:43
问题 I'm looking for an open source version control tool which can diff and merge XML files. The difficulty I have to find such a tool is, that I need a correct merge of a XML file comparing the nodes and not the lines. Any idea? Thanks! 回答1: Something I've used in the past is diffxml. You might be able to use this as your diff command for a VCS like svn or git. 回答2: Unfortunately, there's no one-size-fits-all solution to this problem. XML diffing is very sensitive to what YOU consider different.

How to compare XML files

梦想与她 提交于 2019-12-09 16:02:09
问题 I have two XML files (XSD) which are generated by some tool. The tool doesn't preserve the order of elements so although the content is equal comparing it as text will result as the files are different. Is there some tool that can sort the elements before comparing and will enable text comparison of the documents? Of course the sorting needs to be done recursively. Data example: File A: <xml> <A/> <B/> </xml> File B: <xml> <B/> <A/> </xml> 回答1: I had a similar problem and I eventually found:

How to use Team Foundation's library to calculate unified diff?

我是研究僧i 提交于 2019-12-09 14:31:23
问题 I want to calculate a unified diff comparing two documents. (The diff is to go in an email, and Wikipedia says unified diff is the best plain text diff format.) Team Foundation has a command line interface do that > tf diff /format:unified alice.txt bob.txt - Alice started to her feet, + Bob started to her feet, (Example files at https://gist.github.com/hickford/5656513) Brilliant, but I'd rather use a library than start an external process, for the usual reasons. Searching MSDN, I found Team

Lotus Notes Diff Tool

强颜欢笑 提交于 2019-12-09 12:59:40
问题 Is there any diff tool for Lotus Notes which allows to compare scripts, design elements and documents? 回答1: If all else fails (and by "all else" I mean the often ridiculous corporate procurement system) you can always do a an export to DXL (or a Design Synopsis for code alone) and use any decent text editor with a diff function. It's not TeamStudio Delta, but it will get you where you want to go. 回答2: I see this is an old question, and most of the other answers are a little outdated now, so I

Eugene Myers' Diff Algorithm: Finding the Longest Common Subsequence of “A” and “B”

ぃ、小莉子 提交于 2019-12-09 11:20:45
问题 I've been reviewing Eugene Myers' Diff Algorithm Paper. This is the algorithm that is implemented in the popular diff program. On page 12 of the paper, it presents the pseudo-code for the algorithm to find the longest common sub-sequence of A and B : LCS(A, N, B, M) If N > 0 and M > 0 Then Find the middle snake and the length of an optimal path for A and B. Suppose it is from (x, y) to (u, v). If D > 1 Then LCS(A[1..x], x, B[1..y], y) Output A[x+1..u] LCS(A[u+1..N], N-u, B[v+1..M], M-v) Else

How to get diff for specified user between two dates from git?

ε祈祈猫儿з 提交于 2019-12-09 07:39:37
问题 Or, how to use git whatchanged command to list commits for specified user? Is there any none-scripting way? (builtin git command) 回答1: I believe there's no such a way to get a diff only knowing dates. As of today you can do the following: git log --since "OCT 4 2011" --until "OCT 11 2011" --pretty=format:"%H" And then git diff between first and last revisions. If the revision list is far too long, use the above git log ... with | head -1 and | tail -1 to get the first and the last revisions.