diff

How do I get mercurial to show the diff during `hg com`?

守給你的承諾、 提交于 2019-12-10 04:17:20
问题 Is there a way to configure hg com so that in the commit message file that pops up in the external editor, instead of just showing which files were changed (in the HG: lines) it actually shows the full diff? I'd rather view the output and compose my commit message simultaneously from the comfort of my text editor as opposed to doing hg diff on the command line separately beforehand. 回答1: TortoiseHg does this out of the box: a top panel for the commit message and below that, a left pane

p4 command line equivalent to “git log -p”?

旧时模样 提交于 2019-12-10 04:04:57
问题 I often use git log -p <file> or git log -p <directory> to get a comprehensive summary of the changes in a file or set of files. It outputs a history of the commits affecting the files, together with a unified diff of each commit. Using Perforce I can do p4 changes <file> or p4 changes <directory>/... to get a list of commits. But there does not seem to be an option to show the corresponding diffs. Is there a Perforce equivalent I could use? If shell scripting is necessary, a fully working

how to show whitespace differences with git --word-diff?

喜夏-厌秋 提交于 2019-12-10 04:03:00
问题 To illustrate the problem: see diff the only diff in this paragraph (starting with A macro that needs is whitespace differences (newlines inserted / removed in certain places); when running git diff it shows the paragraph before in red and paragraph after in red, making it hard to spot the difference when running git diff --word-diff , it shows the paragraph after in gray and doesn't show the whitespace changes when running git diff --word-diff-regex=. it shows the whitespace changes (great!)

Numpy diff inverted operation?

醉酒当歌 提交于 2019-12-10 03:39:28
问题 Working with numpy.diff function, suppose this simple case: >>> x = np.array([1, 2, 4, 7, 0]) >>> x_diff = np.diff(x) array([ 1, 2, 3, -7]) How can I get easily x back to original scale not differenced? I suppose there is something with numpy.cumsum(). 回答1: Concatenate with the first element and then use cumsum - np.r_[x[0], x_diff].cumsum() For concatenating, we can also use np.hstack , like so - np.hstack((x[0], x_diff)).cumsum() Or with np.concatenate for the concatenation - np.concatenate

A customizable diff tool that can produce report (in XML, HTML)

你。 提交于 2019-12-10 03:31:57
问题 I want to provide a diff report for a non regression test. My program is Java based but I did not found any API filling my needs. So I'm using an external tool (CSDiff) that take 2 files as arguments and return an HTML report. That's nice and easy to setup. Now the only problem I have is that the HTML report needs some tweaks to be used and I am messing around with the report, trying to transform it into something different (hidding some parts, changing the style, ...) Does someone know a

Git's blob data and diff information

拜拜、爱过 提交于 2019-12-10 02:58:42
问题 As far as I know, Git's blob has SHA1 hash as file name, in order not to duplicate the file in the repository. For example, if file A has a content of "abc" and has a SHA1 hash as "12345", as long as the content doesn't change, the commits/branches can point to the same SHA1. But, what would happen if file A is modified to "def" to have SHA hash "23456"? Does Git store file A, and modified file A (not the difference only, but the whole file)? If so, why is that? Isn't it better to store the

How to make git-diff create a “context” format diff?

一曲冷凌霜 提交于 2019-12-10 02:46:53
问题 I've got a Git repo from which I need to create a patch file in something other than the default git diff format. My use case is I've got a clunky old OSF/1 machine on which I need to apply the patch, and the /bin/patch program there doesn't understand unified diffs. If I use GIT_EXTERNAL_DIFF=diff , hoping that I can then use GIT_DIFF_OPTS=-c to request a context format diff, then my (modern) diff program complains about extra arguments on its command line: diff: extra operand

Git: How to diff two different files in different commits?

核能气质少年 提交于 2019-12-10 02:13:58
问题 I have a repository where a number of files have been renamed from .html to .php and further edited in a number of commits since my last pull. Using git diff to shows all the html contents removed and all the php content added. Is there a neat way to have git diff detect the renames (something like git log --follow does), or directly compare different filenames across different commits (something like the solution in Git: How to diff two different files in different branches? , but for

Is there a commonly-used filename extension for unified diff format?

▼魔方 西西 提交于 2019-12-10 02:04:31
问题 E.g. .difffile , .diff ? 回答1: actually most programmers use .patch and sometimes .diff 回答2: I've seen both .diff and .patch, but the most common practice seems to be having no filename extension except for the compression (usually .gz or .bz2). At least that's how it's done for the linux kernel. 来源: https://stackoverflow.com/questions/1260753/is-there-a-commonly-used-filename-extension-for-unified-diff-format

Can't convert string from 'UTF-8' to native encoding

拥有回忆 提交于 2019-12-10 01:52:18
问题 I am getting the following error message when I try to compare my project in eclipse (Team->Compare): (Can't convert string from 'UTF-8' to native encoding) *** diff --old /Users/admin/Documents/workspace_branch_2.8/Test --new https://192.168.1.202/svn/main_repository/tenios/Voxtelo/bundle/trunk/Server/Test Invalid argument svn: Kann Zeichenkette nicht von »UTF-8« in die eigene Codierung konvertieren: svn: Eigenschafts?\195?\164nderungen: /Users/admin/Documents/workspace_branch_2.8/Test/src