diff

Git grep across all new and modified files (before commit)

给你一囗甜甜゛ 提交于 2019-12-11 14:18:02
问题 What command can I run in my Windows Git Bash that will show me the file names, line preview (context), and line numbers of all of the places there is "TODO" written in my code, limited to new files and modified files? Inadequate Approach 1 (from here) This is clunky and doesn't print line number: function __greptodo { QUERY="TODO" for FILE in `git diff --name-only`; do grep "$QUERY" $FILE 2>&1 >/dev/null if [ $? -eq 0 ]; then echo '———————————————' echo $FILE 'contains' $QUERY grep "$QUERY"

Determine list of non-OS packages installed on a RedHat Linux machine

十年热恋 提交于 2019-12-11 13:56:29
问题 I have been tasked with identifying new (non-operating system) software installed on several Red Hat Enterprise Linux (RHEL) machines. Can anyone suggest an efficient way to do this? The way I was doing it is manually comparing the list of installed software with the list on Red Hat's FTP site for the relevant operating system: ftp://ftp.redhat.com/pub/redhat/linux/enterprise/6Server/en/os/SRPMS/ The problems I am encountering with this method is it is tedious / timeconsuming, and just the

Metrics for Change Size when using diff tools

本秂侑毒 提交于 2019-12-11 11:51:31
问题 Does anybody know any diff tool which counts some metrics for "Change Size". I'm searching for a diff tool that uses the diff output and reports something like: The number of changed/added/removed attributes; The number of changed/added/removed operations; The nunmber of changed class' "extends/implements"; The nunmber of changed class' name/package ... It should be, of course, an AST diff tool. A simple text-based diff tool won't be able to do that. This report would be interesting to give

How do I compare the contents of all the files in a directory against another directory?

南笙酒味 提交于 2019-12-11 11:48:13
问题 I have a directory with a bunch of C files, .c and .h , and another very similar directory of files that a coworker has sent that have very minor differences, due to an update, and I'd like to see what those differences are. I could run a diff on every file manually, but as they're named the same is there anyway I could do it quicker and easily see which files are different and what makes them different? 回答1: diff command is able do it. Just try: diff directory1 directory2 回答2: You may find

Git: How to diff two commits and apply that diff to a third one

China☆狼群 提交于 2019-12-11 10:26:12
问题 I have two commits, B and C. C is fixed version of B but not a successor as B was amended. I want to apply this fix to another branch with last commit A. How can I do that, ideally without intermediate patch file? C | B |/ . . A <-- I want to apply diff from B to C here. |/ I thought it could be git cherry-pick --no-commit B C but no. 回答1: One approach would be to rebase onto B , then cherry-pick the resulting C′ (“C prime”) onto A . C′ has only the changes from C that aren't already in B .

How to visually consume/create .diff .patch files in OS X?

只愿长相守 提交于 2019-12-11 10:05:34
问题 Sorry, I'm just not finding anything that can do this! For example I get a big fat .diff of 30 files.. sure, I can use patch and apply that to my source baseline. But, I'd hope to be able to take that .diff and my source tree and interactively view those changes to review the diff and optionally merge in or ignore sections. 回答1: Check out opendiff which is part of Mac OS X Developer Tools (XCode). It won't work exactly how you want (directly on .diff files), but you can make a temp copy of

diff between tables

China☆狼群 提交于 2019-12-11 08:14:55
问题 I have two tables, with the same structure, for example: table "first' with columns 'a','b','c' and table 'second' with the same columns. How to find difference betweet those two tables? Of course, I can make some script on python, that will make set(a)-set(b), but I think there is some way to do it in mysql. UPD: Table 'first' a |b |c ====|====|==== a1 |b1 |c1 a2 |b2 |c2 a3 |b3 |c3 Table 'second' a |b |c ====|====|==== a2 |b2 |c2 a3 |b3 |c3 a4 |b4 |c4 the result I need is something like that

Looking for a JavaScript XML diff tool [closed]

时光总嘲笑我的痴心妄想 提交于 2019-12-11 07:57:45
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . The task I'm facing right now is the following: I have two XML files, which may slightly differ in structure and contents. Both XMLs are validated by the same XSD. I need to create another XML file that will be the base for an XSL transformation and will allow to provide both old and new values of elements in

Modifying a file in PhpStorm causes Git to consider a file as “Modified” even after undoing the changes

徘徊边缘 提交于 2019-12-11 07:26:07
问题 It seems when I modify a file in PhpStorm which is apart of a git project, it marks the file as modified even after all changes have been reverted (either Ctrl + Z or by manually undoing them). This seems to be specific to PhpStorm and occurs even if I have VCS disabled for the project in PhpStorm. It's apparent PhpStorm is doing something under the covers which is what I'm trying to figure out. I've checked the working tree against the index and outside of line endings, everything is exact

Is there a word document format that supports version diff comparisions?

╄→尐↘猪︶ㄣ 提交于 2019-12-11 06:58:28
问题 I know this question has probably been asked already but I would really like to know of a program that will show line by line the differences between to word documents. Thus I need a word document format that supports this (.doc, .docx and .ods obviously don't). Are HTML and XML the only formats that come close to supporting this feature or is there another format? 回答1: MS Word 2007 itself can compare docs for you! Check this link. Is this what you are looking for? 回答2: LaTeX, DocBook (which