Questions tagged [diff]

The act of identifying differences between two or more files in order to support various software development activities (bug tracking, patch creation, ...)

diff
Filter by
Sorted by
Tagged with
1 vote
0 answers
20 views

How to get non-zero exit code from git diff --no-index only on errors?

I'm using git diff --no-index to compare two directories outside a GIT repository because git diff handles renames efficiently as opposed to GNU diff. The man page says that --no-index implies --exit-...
57 votes
8 answers
76k views

How to count differences between two files on linux?

I need to work with large files and must find differences between two. And I don't need the different bits, but the number of differences. To find the number of different rows I come up with diff --...
0 votes
2 answers
1k views

Laravel collection opposite of diff [duplicate]

I have 2 collections: $collection = collect([1,2,3,4]); $collection2 = collect([1,5,6,4]); with: $collection->diff($collection2); I get [2,3] I want is to have the opposite values: [1,4] Is there ...
0 votes
2 answers
2k views

Get the diff between two dates based on 360 days [duplicate]

How do I get the difference between two dates based on a 360 days? 360-days: http://en.wikipedia.org/wiki/360-day_calendar I want to get the difference in days, years and months. for example: $...
0 votes
2 answers
310 views

Difference between two dates with 360 days/year, 30 days/month format in php [duplicate]

I want to ask a question regarding the answer given in this post (How to get the difference between two dates with 360 days/year, 30 days/month format?) which i can't comment because i don't have the ...
1 vote
3 answers
3k views

How to get the difference between two dates with 360 days/year, 30 days/month format?

I can get the difference between two dates (DD/MM/YY format) with the following code; $date1 = new DateTime("1986-04-27"); $today = new DateTime("now"); $interval = $date1->diff($today); $...
0 votes
0 answers
28 views

Copying text files while preserving some differences

I'm trying to build a "homemade" CI/CD pipeline for .NET framework projects + JS clients. After building the binaries, I need to copy a bunch of files, mainly DLLs and minified JS, to the ...
-2 votes
0 answers
16 views

How do I create a mass distributable patch file for windows? [closed]

I am trying to figure out how to generate a patch file on windows that will let me mass distribute edits I've made to a directory. Ideally a solution that could be handed to people that aren't ...
24 votes
5 answers
27k views

How do I prettily print out a git-diff output?

I am required to print out the git diff output for the appendix of a thesis paper. I really like the output of git diff --color-words, but I have absolutely no idea how to bring this formatting, with ...
34 votes
3 answers
19k views

Python difflib: highlighting differences inline?

When comparing similar lines, I want to highlight the differences on the same line: a) lorem ipsum dolor sit amet b) lorem foo ipsum dolor amet lorem <ins>foo</ins> ipsum dolor <del>...
0 votes
0 answers
10 views

cygwin diff: missing the plus- and minus-characters in the output

in cygwin, the diff-command started each of its output-lines with some minus- or plus-characters. I build a script which relys on this leading minus- or plus-characters. I had to install a newer ...
0 votes
2 answers
168 views

Does Java Git API (JGit or others) Support finding renamed files between commits?

Does Java Git API, Example JGit support finding files between two commits that were renamed? As example with command line git if I use git status I could see a view along the lines of renamed: old-...
11 votes
2 answers
8k views

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

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, ...
0 votes
0 answers
18 views

patch_fromText and lines breaks issue when inserting in google/diff-match-patch Python

I'm attempting to patch files using the google/diff-match-patch library, but I'm encountering issues with line breaks on inserted lines. I've tried using patch_make for comparison, and it seems to ...
2 votes
1 answer
71 views

DOM diff algorithm with HTML streaming?

Does anybody know if the DOM diff algorithm can be applied in Depth-first search (DFS) instead of Breadth-first search (BFS)? I've been trying for days to get the DOM diff algorithm to work with ...
0 votes
3 answers
670 views

How to create a patch file for text files only in a directory

I have a directory with hundreds of text files and object files. I had a copy of this directory somewhere else and I edited it and recompiled it. the object files are now different, but I want to ...
7 votes
1 answer
942 views

How can I make git diff always use the --word-diff option?

What do I have to write in the .gitconfig file in order for git diff to behave as it was git diff --word-diff? For now, searching for \bword in man git-config I've found diff.wordRegex, and given that ...
2 votes
3 answers
5k views

clearcase create diff between parent and child branches

So the typical way I would create a diff log/patch between two branches in clearcase would to simply create two views and do a typical unix diff. But I have to assume that there is a more clearcase ...
0 votes
0 answers
12 views

Does markdown support diff and syntax highlighting at the same time? [closed]

What languages are supported in markdown codeblocks and is there anyway to support multiple to get for example both diff and python? Similar questions: Syntax Highlighted Diffs Diff syntax ...
2 votes
1 answer
47 views

Git diff between commits on a file in the interval line1 up to line2

As I can do on git blame to find the results of line intervals git blame -L 10,23 file.ext . I wanted to do a gif diff between commits hash1, hash2, on file file.ext, in the interval of lines 10,23. ...
0 votes
0 answers
13 views

Show compared strings in Diff2HtmlUI when there is no difference

I'm comparing two json objects then rendering them with Diff2Html First I'm gnerating a diff string using Diff libbary const diffString = diff.createTwoFilesPatch('file', 'file', this.reference, this....
129 votes
5 answers
55k views

How to ignore SVN folders in WinMerge?

I'm trying to recursively compare two Subversion working copy folders using WinMerge. Unfortunately, WinMerge displays lots of differencing files inside of the subversion control folders (.svn or _svn)...
2 votes
2 answers
153 views

How to hide all files outside the project folder from CTRL + P (Go to file..)'s recently opened in VS Code?

When I open VS Code Diff from the command line using vscode diff file1 ../other-project/file2, then press CTRL + P, the diffed file from the other project shows up in my recently opened files. Is ...
363 votes
13 answers
546k views

What is the Windows equivalent of the diff command?

I know that there is a post similar to this : here. I tried using the comp command like it mentioned, but if I have two files, one with data like "abcd" and the other with data "abcde", it just says ...
-1 votes
2 answers
43 views

diff3 output in git conflict style, including mergeable hunks

I would like to produce a file consisting of the three-way diff of three files, with every difference represented as a conflict in the git style. That is, common lines are shown verbatim, and ...
0 votes
1 answer
26 views

diff files for whitespace changes while ignoring indentation

I am trying to see the effects of a formatter I am using. Many lines will have indentation changes, while a few will other changes, like a newline between an open and close brace. I want to ignore all ...
2 votes
3 answers
83 views

how can I keep the first entry by ID? pandas python

pk_cid means client id Each pk_partition represents the current state of the month of em_acount(which is a product sold). So if a client has 1 in january and also has 1 in February that means that he ...
0 votes
0 answers
17 views

Have the git gutter show the diff between the current HEAD and a selected commit/branch in Visual Studio Code

I'm referring to this gutter that shows the diff between the working directory and HEAD. How do I make it show the diff between the working directory (or the HEAD) and a branch of my choosing (say, ...
18 votes
4 answers
9k views

How to have mocha show entire object in diff on assertion error?

I have a unit test test case created with mocha and chai's expect where I deeply compare an array of value objects to the parsed content of a JSON file. My record object has about 20 properties, and ...
1934 votes
22 answers
634k views

How to grep (search through) committed code in the Git history

I have deleted a file or some code in a file sometime in the past. Can I search through the content (not just the commit messages)? A very poor solution is to grep the log: git log -p | grep <...
114 votes
9 answers
124k views

How to diff a directory for only files of a specific type?

I have a question about the diff command if I want a recursive directory diff but only for a specific file type, how to do that? I tried using the exclude option but can only use one pattern only: $ ...
19 votes
2 answers
39k views

Is it possible to compare two directories in Git [duplicate]

I have installed Meld as diff tool in Git. Is it possible to compare two folders using Git or any other way? I tried the following command but nothing happened. git diff /c/sample/folder1/ /c/sample/...
292 votes
19 answers
173k views

'git status' shows changed files, but 'git diff' doesn't

I've had a look at all similar questions. However, I've double checked and something strange is definitely happening. On one server (Solaris with Git 1.8.1) I cloned the Git repository then copied ...
0 votes
1 answer
28 views

git diff show changes where surrounding lines contain search term

For my Swift project, I'm trying to identify changes in the project.pbxproj file that have a particular word or regex in the surrounding context lines (not within the actual diff changes). I've tried ...
24 votes
1 answer
69k views

Is it possible to see what you changed in Visual Studio before you commit/push it to TFS? (Gui of Git Diff)

Using TFS-2013 with a project that is using git, is it possible to see the changes I made in Visual Studio 2013 Pro before I commit them? If so how? Ie lets say I have /project and i change line ...
120 votes
14 answers
30k views

Highlight changed lines and changed bytes in each changed line

Open Source project Trac has an excellent diff highlighter — it highlights changed lines and changed bytes in each changed line! See here or here for examples. Is there way to use the same ...
8 votes
3 answers
17k views

Compare 2 large sql files and find differences to recover data

I have 2 large SQL files of around 8GB each. But, in the latest backup I find that one file has 300MB data missing. I just want to compare which data is missing, so that I can check that was it just ...
0 votes
0 answers
20 views

i want to compare and obtain new data of 2 files, but the place of the content changes lines

lest say i have 2 files with the following content: file1.txt 1- cat 2- dog 3- fish 4- lion and the file 2: file2.txt 1- fish 2- lion 3- "new data" 4- cat 5-dog with the methods that I ...
384 votes
13 answers
250k views

Can I use git diff on untracked files?

Is it possible to ask git diff to include untracked files in its diff output, or is my best bet to use git add on the newly created files and the existing files I have edited, then use: git diff --...
0 votes
1 answer
32 views

Calculate Difference between columns where criteria in another column is met [duplicate]

I have a dataset as follows: import pandas as pd df = pd.DataFrame( {"Time": [1,2,3,1,2,3], "Prop1": ["A","B","A","A","B",...
10 votes
3 answers
3k views

How to view inline diff of multiple files at once in VS Code?

In VS Code, for a given commit I would like to see inline diffs from all files in one view or page, so that I would not have to click to see diffs for each file separately. I can't find any extension ...
34 votes
8 answers
7k views

Context-aware merge?

Is there any diff/merge tool for programming languages, that works in a syntax-aware way (like XML Diff Tool), doing more than compare line-by-line (and optionally ignoring whitespace). I'm ...
7 votes
3 answers
2k views

How to pass a filename argument gitconfig diff textconv?

The documentation on textconv at https://git.wiki.kernel.org/index.php/Textconv has the succinct wording: ~/.gitconfig must indicate the command to execute for the the textconv driver: [diff "<...
3 votes
3 answers
8k views

Symfony 3 - difference between 2 arraycollection

Is there a way to differentiate 2 ArrayCollection ? (like array_diff) today I loop on the first and check if $it->contains() match, but I think it can be refactored.
63 votes
5 answers
25k views

Is possible to change the default diff tool in Mercurial?

Every time I do an hg diff file.ext I end up using a console diff application. I would like to use Kdiff3 or WinMerge (I'm using Windows). Is there a way to change that? I can't find a reference in ...
43 votes
5 answers
30k views

What is MAUI? and what are differences between MAUI and Xamarin

So, What happens to Xamarin.Forms? What is Multi-platform App UI? What are the key differences or advantages that MAUI offers over Xamarin for cross-platform app development? Where can developers ...
4 votes
1 answer
2k views

git for Windows: can't seem to avoid CR/LF diff to patch apply errors

So I'm running git in Windows with a repo that runs on *nix, where git checks out Windows-style newlines (line ending CRLF) but commits *nix-style (LF), however I can't get a diff/apply to work ...
52 votes
3 answers
3k views

git diff algorithm that does not rip functions apart? (language-aware diff)

Is it possible to configure git diff to respect indentation and syntax? I am not talking about ignoring indentation and spaces, but rather to use blank lines, indentation levels and possibly brackets, ...
1 vote
1 answer
135 views

diff: How to use another diff algorithm [closed]

Not git diff, just plain diff or an equivalent tool: How to diff files using another diff algorithm, like histogram? I'm tired of seeing unrelated curly braces being matched up. I tried diff --minimal,...
4 votes
2 answers
2k views

Using git hooks to create a diff report for every file that has changed for the current commit

I'm trying to create a git hook to create a diff report for every file that has changed between my code and the server's code. Most solutions I have seen say to use git's diff command to create the ...

1
2 3 4 5
94