diff

How to make git diff ignore comments

拥有回忆 提交于 2019-11-28 19:20:01
I am trying to produce a list of the files that were changed in a specific commit. The problem is, that every file has the version number in a comment at the top of the file - and since this commit introduces a new version, that means that every file has changed . I don't care about the changed comments, so I would like to have git diff ignore all lines that match ^\s*\*.*$ , as these are all comments (part of /* */). I cannot find any way to tell git diff to ignore specific lines. I have already tried setting a textconv attribute to cause git to pass the files to sed before diffing them, so

Pandas - Number of Months Between Two Dates

夙愿已清 提交于 2019-11-28 18:21:17
I think this should be simple but what I've seen are techniques that involve iterating over a dataframe date fields to determine the diff between two dates. And I'm having trouble with it. I'm familiar with MSSQL DATEDIFF so I thought Pandas datetime would have something similar. I perhaps it does but I'm missing it. Is there a Pandonic way of determing the number of months as an integer between two dates (datetime) without the need to iterate? Keeping in mind that there potentially are millions of rows so performance is a consideration. The dates are datetime objects and the result would like

git - diff of current changes before committing

拟墨画扇 提交于 2019-11-28 18:07:00
问题 I have changed several files in a git repository, but have not committed them yet. I can get a list of the changes by just invoking git status . But how do I get a listing of the lines or the content that I have changed, in addition to the filenames? I initially thought about using git diff, but it seems to be useful only for comparing already commited changes. Usually I just do meld . , but on this case I'm connected to an external server via ssh. 回答1: git diff by default shows difference

Java MongoDB Object Versioning

允我心安 提交于 2019-11-28 18:01:16
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 with a timestamp, but I would like to improve this to save storage space. Therefore, I think I need to

How do you make git diff use gitx --diff on OS X

落花浮王杯 提交于 2019-11-28 17:55:30
问题 Gitx has a great diff viewer, how do I make git automatically pipe git diff whatever into gitx? I've tried to set git config diff.external to a shell script that looks like this: git diff "$2" "$5" | gitx However, that only opens all the individual files up into multiple gitx windows, and it really messes up the files names (changes them all to tmp files with crazy names). Does anyone have a better solution? 回答1: like sigjuice is saying up there. Only that noobs (like i am now) need to know

Show number of changed lines per author in git

非 Y 不嫁゛ 提交于 2019-11-28 17:30:34
i want to see the number of removed/added line, grouped by author for a given branch in git history. there is git shortlog -s which shows me the number of commits per author. is there anything similar to get an overall diffstat? It's an old post but if someone is still looking for it: install git extras brew install git-extras then git summary --line https://github.com/tj/git-extras VonC Since the SO question "How to count total lines changed by a specific author in a Git repository?" is not completely satisfactory, commandlinefu has alternatives (albeit not per branch): git ls-files | while

Is there any graphical Binary Diff tool for Mac OS X?

左心房为你撑大大i 提交于 2019-11-28 17:21:06
问题 Are there any Binary Diff tools for Mac OS X with a GUI? There are a gazillion text-based diff tools, but I need to compare two binary files. Essentially two Hex Editors with Dec/Hex View next to each other (the binary files are a custom file format, so not images or anything that has a more specialized diff tool) 回答1: there is Ellié Computing Merge (http://www.elliecomputing.com) (NB: I work for ECMerge). it can compare arbitrarily large files with usual Hex+ASCII views and side by side

How to diff ansible vault changes?

不想你离开。 提交于 2019-11-28 17:16:01
I'd like to see the actual git commit changes in the ansible vault file. Is there an easy way how to achieve this? You can do this very neatly, so that the normal git tools like git log and git diff can see inside the vaulted files, using a custom git diff driver and .gitattributes . Make sure that your vault password is in .vault_password and that that file is not committed - you should also add it to .gitignore . Add a .gitattributes file that matches any files in your repository that are encrypted with ansible-vault and give them the attribute diff=ansible-vault . For example, I have: env

(Vim)diff two subroutines in same file

孤街浪徒 提交于 2019-11-28 17:12:20
Is it possible to diff or even vimdiff two almost similar subroutines which occur in the same file? If so, how? I can think of copying the two subroutines in two separate files and then diff them, but is there a way to do it within the original file? Thanks! You cannot do this within the original file, but you can do this without using separate files, only separate buffers. This should work if you copied one subroutine in register a (for example, with "ay typed in visual mode) and other subroutine in register b : enew | call setline(1, split(@a, "\n")) | diffthis | vnew | call setline(1, split

Comparing two XML files & generating a third with XMLDiff in C#

感情迁移 提交于 2019-11-28 17:09:41
问题 I am trying to write a simple algorithm to read two XML files with the exact same nodes and structure but not necessarily the same data inside the child nodes and not the same order. How could I create a simple implementation for creating a third, temporary XML being the differential between the two first ones, using Microsoft's XML Diff .DLL ? XML Diff on MSDN: XML Diff and Patch Tool XML Diff and Patch GUI Tool sample XML code of the two different XML files to compare: <?xml version="1.0"