diff

How to perform a three-way diff in Git without merging?

百般思念 提交于 2019-11-27 12:55:15
问题 I want to perform a three-way diff between two git branches with a common merge base, and view it with kdiff3. I've found lots of guidance on SO (and a few very similar questions (1, 2, 3) ) but I haven't found a direct answer. Notably, a comment on this answer implies that what I want is possible, but it didn't work for me. Hopefully that user might chime in here :) For background, when I perform merges I use a "diff3" conflict style: git config --global merge.conflictstyle diff3 And I have

Pandas: Diff of two Dataframes

老子叫甜甜 提交于 2019-11-27 11:40:41
I need to compare two dataframes of different size row-wise and print out non matching rows. Lets take the following two: df1 = DataFrame({ 'Buyer': ['Carl', 'Carl', 'Carl'], 'Quantity': [18, 3, 5, ]}) df2 = DataFrame({ 'Buyer': ['Carl', 'Mark', 'Carl', 'Carl'], 'Quantity': [2, 1, 18, 5]}) What is the most efficient way to row-wise over df2 and print out rows not in df1 e.g: Buyer Quantity Carl 2 Mark 1 Important: I do not want to have row: Buyer Quantity Carl 3 included in the diff: I have already tried: Comparing two dataframes of different length row by row and adding columns for each row

Git: How can I find a commit that most closely matches a directory?

橙三吉。 提交于 2019-11-27 11:33:48
Someone took a version (unknown to me) of Moodle, applied many changes within a directory, and released it ( tree here ). How can I determine which commit of the original project was most likely edited to form this tree? this would allow me to form a branch at the appropriate commit with this patch. Surely it came from either the 1.8 or 1.9 branches, probably from a release tag, but diffing between particular commits doesn't help me much. Postmortem Update: knittl's answer got me as close as I'm going to get. I first added my patch repo as the remote "foreign" (no commits in common, that's OK)

Python - difference between two strings

Deadly 提交于 2019-11-27 11:32:19
I'd like to store a lot of words in a list. Many of these words are very similar. For example I have word afrykanerskojęzyczny and many of words like afrykanerskojęzycznym , afrykanerskojęzyczni , nieafrykanerskojęzyczni . What is the effective (fast and giving small diff size) solution to find difference between two strings and restore second string from the first one and diff? You can use ndiff in the difflib module to do this. It has all the information necessary to convert one string into another string. A simple example: import difflib cases=[('afrykanerskojęzyczny',

Textually diffing JSON

此生再无相见时 提交于 2019-11-27 11:19:57
问题 As part of my release processes, I have to compare some JSON configuration data used by my application. As a first attempt, I just pretty-printed the JSON and diff'ed them (using kdiff3 or just diff). As that data has grown, however, kdiff3 confuses different parts in the output, making additions look like giant modifies, odd deletions, etc. It makes it really hard to figure out what is different. I've tried other diff tools, too (meld, kompare, diff, a few others), but they all have the same

Using git diff, how can I get added and modified lines numbers?

纵然是瞬间 提交于 2019-11-27 10:59:50
Assuming I have a text file alex bob matrix will be removed git repo and I have updated it to be alex new line here another new line bob matrix git Here, I have added lines number (2,3) and updated line number (6) How can I get these line numbers info using git diff or any other git command? git diff --stat will show you the output you get when committing stuff which is the one you are referring to I guess. git diff --stat For showing exactly the line numbers that has been changed you can use git blame -p <file> | grep "Not Committed Yet" And the line changed will be the last number before the

Java MongoDB Object Versioning

穿精又带淫゛_ 提交于 2019-11-27 10:59:38
问题 I need to do versioning on (simple) Java object graphs stored in a document-oriented database (MongoDB). For relational databases and Hibernate, I discovered Envers and am very amazed about the possibilities. Is there something similar that can be used with Spring Data Documents? I found this post outlining the thoughts I had (and more...) about storing the object versions, and my current implementation works similar in that it stores copies of the objects in a separate history collection

What does the “@@…@@” meta line with at signs in svn diff or git diff mean?

為{幸葍}努か 提交于 2019-11-27 10:51:06
When I use svn diff or git diff it shows lines like: @@ -1,5 +1,9 @@ What do they mean? manojlds Those are called (c)hunk headers and contain the range information. They are surrounded by double at signs @@ . They are of the format: @@ -l,s +l,s @@ where l is the starting line number and s is the number of lines the change (c)hunk applies to for each respective file. The - indicates the original file and the + indicates the new (modified) file. Note that it not only shows affected lines, but also context lines. The -1,5 is in the original file (indicated by the - ). It shows that that first

How to make svn diff produce file that patch would apply, when svn cp or svn mv was used?

亡梦爱人 提交于 2019-11-27 10:36:19
The scenario is: svn cp or mv some file modify that file svn diff > mypatch On other machine (same working copy, but no changes): Try to apply mypatch. Fail -> tries to modify unexistant file. How can I make svn diff produce patch-appliable patch, or cleanly apply patch produced by svn diff in this case? I can't commit. I would like to preserve mergeinfo (because the obvious workaround is to add the file as totally new, without connection to the previous one). Ray With subversion, you can specify which diff binary to use, and parameters to pass to it. See the manual on svn diff. You'd want to

How to view diff of a forked github project

走远了吗. 提交于 2019-11-27 10:30:51
问题 I have forked a project on github and need to have a set of changes I made since I forked, in diff format. If you wonder - I've forked Apache httpd and I'm changing some code in core. Currently I'm not commiting any changes, running git diff, and use its output as a patch against vanilla httpd sources in an RPM building process. It is, of course, wrong, but I don't know how to do it properly. All I know is I need a diff in the end. 回答1: Add the original GitHub repo (the one you have forked)