diff

How to apply a Perforce patch?

二次信任 提交于 2019-11-30 22:15:01
问题 I generated a patch some time ago using the p4 diff command. However, now that I want to apply it, I realize that there is no way to apply a patch in Perforce. Since I did not use the -du option, the patch is in that obscure perforce format and can't be applied with patch(1) . The original changes have been lost. Also, that patch is over 300kb long so manual editing isn't really an option. What are my options ? Are there patch converters, or some Perforce extension allowing the application of

git: cumulative diff with commit-limiting

怎甘沉沦 提交于 2019-11-30 21:53:03
git log has some very useful commit-limiting options , such as --no-merges and --first-parent . I'd like to be able to use these options when generating a cumulative diff patch/stat/numstat for a range of commits. With these commands: git log --oneline --first-parent --no-merges --patch 29665b0..0b76a27 git log --oneline --first-parent --no-merges --stat 29665b0..0b76a27 git log --oneline --first-parent --no-merges --numstat 29665b0..0b76a27 the diff is not cumulative (the changes are listed individually for each commit). With these commands: git diff --patch 29665b0..0b76a27 git diff --stat

diff operation within a group, after a dplyr::group_by()

て烟熏妆下的殇ゞ 提交于 2019-11-30 18:25:53
Let's say I have this data.frame (with 3 variables) ID Period Score 123 2013 146 123 2014 133 23 2013 150 456 2013 205 456 2014 219 456 2015 140 78 2012 192 78 2013 199 78 2014 133 78 2015 170 Using dplyr I can group them by ID and filter these ID that appear more than once data <- data %>% group_by(ID) %>% filter(n() > 1) Now, what I like to achieve is to add a column that is: Difference = Score of Period P - Score of Period P-1 to get something like this: ID Period Score Difference 123 2013 146 123 2014 133 -13 456 2013 205 456 2014 219 14 456 2015 140 -79 78 2012 192 78 2013 199 7 78 2014

How to find duplicate lines across 2 different files? Unix

怎甘沉沦 提交于 2019-11-30 17:55:29
From the unix terminal, we can use diff file1 file2 to find the difference between two files. Is there a similar command to show the similarity across 2 files? (many pipes allowed if necessary. Each file contains a line with a string sentence; they are sorted and duplicate lines removed with sort file1 | uniq . file1 : http://pastebin.com/taRcegVn file2 : http://pastebin.com/2fXeMrHQ And the output should output the lines that appears in both files. output : http://pastebin.com/FnjXFshs I am able to use python to do it as such but i think it's a little too much to put into the terminal: x =

Show the permission of a indexed file in git

不问归期 提交于 2019-11-30 17:44:23
This is related to another question I recently asked about storing a non-bare repository in Dropbox for easy movement between computers, so it may be helpful to read that question for background. The gist is that the fileMode keeps reporting a diff for some number of files. I can't find a way to reproduce it consistently, but it happens frequently. What I've noticed is that the file, which has 644 permissions on both machines often reports a diff from 755 on one of the machines. This makes me think that Git believes the executable bit is set, but I can't figure out whether I can actually see

Can i specify the module version id (MVID) when building a .net assembly?

谁说我不能喝 提交于 2019-11-30 17:26:58
问题 We have some shared assemblies that get build automatically every night. When there are no changes made to the sources, i would expect the assembly binaries to be exactly the same as a previous version. However, there seem to be minor differences between assemblies. I have done some effort to determine the difference between two builds. I used ildasm to generate an il version, and compared the resulting text versions. The only difference (in IL) is the MVID (a random guid) in the module. Some

How to Diff Files Directly from the Linux Kernel GIT Repository?

∥☆過路亽.° 提交于 2019-11-30 17:07:51
问题 I'd like to be able to diff files / directories directly from the Linux Kernel GIT repository without having to download full source. Specifically, I'm interested in two potential solutions: The ability to do diff's via a web browser ( firefox ) A GUI utility for Ubuntu that can do remote diffs. A tutorial how to setup option #2 Edit As an example of what I'm looking for, I used to use CrossVC for the above tasks on a CVS repo. 回答1: Gitweb at kernel.org allows to view diff between arbitrary

How to find duplicate lines across 2 different files? Unix

天大地大妈咪最大 提交于 2019-11-30 16:49:58
问题 From the unix terminal, we can use diff file1 file2 to find the difference between two files. Is there a similar command to show the similarity across 2 files? (many pipes allowed if necessary. Each file contains a line with a string sentence; they are sorted and duplicate lines removed with sort file1 | uniq . file1 : http://pastebin.com/taRcegVn file2 : http://pastebin.com/2fXeMrHQ And the output should output the lines that appears in both files. output : http://pastebin.com/FnjXFshs I am

Viewing git filters output when using meld as a diff tool

自闭症网瘾萝莉.ら 提交于 2019-11-30 15:34:16
I set up some git filters in order to preprocess certain files (in my case IPython Notebooks) before committing them. To be more exact I'm following these instructions: https://stackoverflow.com/a/20844506/578770 This works fine and the files are correctly filtered if I commit my changes or if I review the change using the command line "git diff ". However, if I'm reviewing my changes using meld, the files are not filtered. I tried several way to set up meld as a diff tool for git: by calling git difftool by calling meld from a custom script But none of the solutions I've found for using meld

Implementing Google's DiffMatchPatch API for Python 2/3

自古美人都是妖i 提交于 2019-11-30 14:01:30
问题 I want to write a simple diff application in Python using Google's Diff Match Patch APIs. I'm quite new to Python, so I want an example of how to use the Diff Match Patch API for semantically comparing two paragraphs of text. I'm not too sure of how to go about using the diff_match_patch.py file and what to import to from it. Help will be much appreciated! Additionally, I've tried using difflib, but I found it ineffective for comparing largely varied sentences. I'm using ubuntu 12.04 x64. 回答1