diff

How do diff/patch work and how safe are they?

给你一囗甜甜゛ 提交于 2019-11-30 08:44:31
Regarding how they work, I was wondering low-level working stuff: What will trigger a merge conflict? Is the context also used by the tools in order to apply the patch? How do they deal with changes that do not actually modify source code behavior? For example, swapping function definition places. Regarding safety, truth be told, the huge Linux kernel repository is a testament for their safety. But I wondering about the following points: Are there any caveats/limitations regarding the tools that the user should be aware of? Have the algorithms been proven to not generate wrong results? If not,

Team Foundation Server (TFS) File Difference viewer - customize with other tool

梦想的初衷 提交于 2019-11-30 08:12:06
I am using Team Foundation Server (TFS) for Visual Studio 2005. Whenever i wish to compare two file's versions TFS displays a window with the differences. The problem is that it is always split vertically. In fact, almost every time, i would prefer to have it split horizontally. I've already looked at TFS options and googled but i found nothing. I'm appalled to think that such option is not available! Is there any way to configure TFS to split it horizontally? I've found the built in differencing tool in TFS woefully lacking so I set up WinMerge ( http://www.winmerge.org/ ) in my environment

is it possible to add a comment to a diff file (unified)?

前提是你 提交于 2019-11-30 08:08:14
I wonder if it's possible to add a certain amount of unparsed content to a diff file (unified) that is ignored as a comment. One good use of this would be having git diffs augmented with important information such as from which branch is that diff from (especially when using the --full-index option, which merely displays the blob references). The unified diff starts with two line header: --- from-file from-file-modification-time +++ to-file to-file-modification-time Anything before this header is ignored, so you can add any comment here, for example: This may be some useful description of this

What are the error exit values for diff?

限于喜欢 提交于 2019-11-30 07:48:09
On the diff man-page I've found these exit values: 0 No differences were found. 1 Differences were found. >1 An error occurred. Are there different exit values above 1 for different errors? It depends on your diff command. Mine (GNU diffutils 3.0) says: An exit status of 0 means no differences were found, 1 means some differences were found, and 2 means trouble. Normally, differing binary files count as trouble, but this can be altered by using the -a or --text option, or the -q or --brief option. David W. There maybe, or there may not be different error codes depending upon the version of

Using Mercurial, is there an easy way to diff my working copy with the tip file in the default remote repository

有些话、适合烂在心里 提交于 2019-11-30 06:51:35
When using mercurial, I'd like to be able to diff the working copy of a file with the tip file in my default remote repository. Is there an easy way to do this? I know I can do an "hg incoming -p" to see the patch sets of changes coming in, but it'd be nice to just directly see the actual changes for a particular file that I'd get if I do a pull of the latest stuff (or what I might be about put push out). The easiest thing I can think of right now is to create a little script that takes a look at the default location in .hg/hgrc and downloads the file using curl (if it's over http, otherwise

How to make “git diff” output normal diff format (non-unified, non-context)?

倖福魔咒の 提交于 2019-11-30 06:46:18
I want git diff to output normal, plain old diff output (not unified diff, and not context diff). I want this: $ diff file1 file2 2c2 < b --- > B 4d3 < d 5a5 > f I do NOT want unified output: $ diff -u file1 file2 --- file1 2012-07-04 07:57:48.000000000 -0700 +++ file2 2012-07-04 07:58:00.000000000 -0700 @@ -1,5 +1,5 @@ a -b +B c -d e +f I do NOT want context output: $ diff -c file1 file2 *** file1 2012-07-04 07:57:48.000000000 -0700 --- file2 2012-07-04 07:58:00.000000000 -0700 *************** *** 1,5 **** a ! b c - d e --- 1,5 ---- a ! B c e + f I tried the various git difftool --tool= args

'Best' Diff Algorithm [closed]

人盡茶涼 提交于 2019-11-30 06:28:05
I need to implement a Diff algorithm in VB.NET to find the changes between two different versions of a piece of text. I've had a scout around the web and have found a couple of different algorithms. Does anybody here know of a 'best' algorithm that I could implement? Calanus Well I've used the c# version on codeproject and its really good for what I wanted... http://www.codeproject.com/KB/recipes/diffengine.aspx You can probably get this translated into VB.net via an online converter if you can't do it yourself... I like An O(ND) Difference Algorithm and Its Variations by Eugene Myers. I

How to download a single commit-diff from GitHub?

守給你的承諾、 提交于 2019-11-30 06:12:57
问题 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)?

python dict update diff

。_饼干妹妹 提交于 2019-11-30 05:40:58
Does python have any sort of built in functionality of notifying what dictionary elements changed upon dict update? For example I am looking for some functionality like this: >>> a = {'a':'hamburger', 'b':'fries', 'c':'coke'} >>> b = {'b':'fries', 'c':'pepsi', 'd':'ice cream'} >>> a.diff(b) {'c':'pepsi', 'd':'ice cream'} >>> a.update(b) >>> a {'a':'hamburger', 'b':'fries', 'c':'pepsi', 'd':'ice cream'} I am looking to get a dictionary of the changed values as shown in the result of a.diff(b) No, but you can subclass dict to provide notification on change. class ObservableDict( dict ): def _

Why doesn't `git diff` invoke external diff tool?

孤者浪人 提交于 2019-11-30 04:28:56
In my repository, if I type $ git diff some-file or $ git difftool some-file I get the in-terminal diff display. I think this should not happen, because I have set up an external diff tool, as shown by the output of git config -l : $ git config -l user.name=blah blah user.email=blah blah http.sslverify=true diff.external=/home/daniel/bin/git-diff <--This is the important line push.default=simple core.filemode=false core.editor=gedit alias.tree=log --all --graph --decorate=short --color --format=format:'%C(bold blue)%h%C(reset) %C(auto)%d%C(reset) %C(black)[%cr]%C(reset) %x09%C(black)%an: %s %C