diff

Diff without files

你说的曾经没有我的故事 提交于 2019-12-03 23:32:52
Is it possible to use the "diff" tool without having physical files? Something like this: diff "hello" "hell" Adam Rosenfield You can diff standard input with a file by using the special filename - : # diff the contents of the file 'some-file' with the string "foobar" echo foobar | diff - some-file With bash, you can also use anonymous named pipes (a bit of a misnomer) to diff two pipelines: # diff the string "foo" with the string "baz" diff <(echo foo) <(echo baz) See also How can you diff two pipelines with bash? . 来源: https://stackoverflow.com/questions/991722/diff-without-files

Tools for comparing minimized Javascript files [closed]

安稳与你 提交于 2019-12-03 23:29:38
Closed. This question is off-topic. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I need to compare two minimized Javascript files. Most common diff viewers list differences per line, but this isn't useful when the script is compressed to a few lines. Are there any good tools for comparing minimized Javascript files? Pretty Diff tool will diff two minified files or a minified to a beautified file with a single button click. http://prettydiff.com/ It operates by first minifing

diff files comparing only first n characters of each line

Deadly 提交于 2019-12-03 23:21:35
I have got 2 files. Let us call them md5s1.txt and md5s2.txt. Both contain the output of a find -type f -print0 | xargs -0 md5sum | sort > md5s.txt command in different directories. Many files were renamed, but the content stayed the same. Hence, they should have the same md5sum. I want to generate a diff like diff md5s1.txt md5s2.txt but it should compare only the first 32 characters of each line, i.e. only the md5sum, not the filename. Lines with equal md5sum should be considered equal. The output should be in normal diff format. Easy starter: diff <(cut -d' ' -f1 md5s1.txt) <(cut -d' ' -f1

TortoiseSVN : Good 'patch file' viewer?

折月煮酒 提交于 2019-12-03 22:35:38
The default patch file viewer is messy (ie. no side by side diff view etc). I tried setting the path of beyondCompare exe in "Settings->Unified Diff Viewer->custom", but beyond compare also behaves same as default diff tool. Is there a way to atleast allow side by side diff in patch files ? If so, what is the method ? My aim is to allow emailing of changes so that they can be reviewed before I commit them :) Mishal I've never found any, but the solution that I usually use is to simply apply the patch file to a pristine checkout of the tree, and then do a "regular" diff (my preferred tool is

How can I make `git diff` as fine-grained as StackExchange diff?

北慕城南 提交于 2019-12-03 21:44:24
Is there a diff tool which can highlight single character edits as such, and not just show the old and new version of the whole line (i.e. the kind of diff StackExchange shows you for edits to a post)? I'd prefer one I could use on the Linux command line as diff in git . You can try, from git diff : git diff --color-word=. Which is equivalent to --word-diff=color plus (if a regex was specified) --word-diff-regex=<regex> . That would transform this git diff : into this one: Images are from the section " Produce more useful diffs " of the article " 30 Git CLI options you should know about "

Any existing C# code (OSS) that will calculate diff between two strings and output html? [closed]

旧城冷巷雨未停 提交于 2019-12-03 20:22:59
I need to compare two strings and output the diff in HTML (similar to MS Word "track changes"). Language is C#, this is (not surprisingly) a .NET web app. There are a few similar questions (like this one for PHP/Python ), but no existing question on SO. I don't need a finished project, just anything that will cut out the extra work. I know this problem has been solved at least once. I'm looking to leverage from that starting place (source for an object, just a method, just an algorithm in C#, anything will be useful). Output for the diff needs to be in HTML. There is a C# class available from

How to get source code difference between two projects [closed]

落爺英雄遲暮 提交于 2019-12-03 18:51:46
问题 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 have created two java projects both have some common package structure and also same class. I want to compare these two projects and

Download Github pull request as unified diff

无人久伴 提交于 2019-12-03 18:18:03
问题 How can I download the changes contained in a Github pull request as a unified diff? 回答1: To view a commit as a diff/patch file, just add .diff or .patch to the end of the URL, for example: https://github.com/weppos/whois/pull/90 https://github.com/weppos/whois/pull/90.diff https://github.com/weppos/whois/pull/90.patch 回答2: Somewhat related, to let git download pull request 123 and patch it into mylocalbranch locally, run: git checkout -b mylocalbranch git pull origin pull/921/head 回答3: To

Manually merge two files using diff

久未见 提交于 2019-12-03 17:26:30
问题 I'd like to merge two files by doing the following: Output the diff of the two files into a temp file and Manually select the lines I want to copy/save. The problem here is that diff -u only gives me a file lines of context, while I want to output the entire file in a unified format. Is there any way diff can do this? 回答1: "I want to output the entire file in a unified format. Is there any way diff can do this?" Yes. diff -U 9999999 file1.txt file2.txt > diff.txt This should work, provided

Visual Studio Diff Window: How to Edit .sql Files

假装没事ソ 提交于 2019-12-03 16:59:03
问题 When using Visual Studio, select a pending change to a .sql file. Select "Compare with Latest" or "Compare with Workspace Version." The file opens in the Diff Window. Is there any way to be able to edit the .sql file in the Diff Window? This functionality is available when comparing other file types. 回答1: What you want is not currently possible. This link from the Visual Studio Developer Community says: We have determined that this issue will not be addressed in the upcoming release. We will