diff

visually show diff output in a java program

£可爱£侵袭症+ 提交于 2019-12-07 15:33:02
问题 I am currently developing a java program where I need to show the difference between two text. Is there any library available for visually show the difference, that is the diff output in my java program or how can I do so. Any suggestion will be very helpful for me. 回答1: I would go for netbeans diff api. How to use the diff api in netbeans and, NetBeans Diff API From the later url: Although not a visual implementation, you also have a translation of gnu diff in java. 回答2: JMeld is a library

is there a simple way to know which files will be updated in the next 'git pull'?

杀马特。学长 韩版系。学妹 提交于 2019-12-07 15:18:37
问题 i would like to know which files would be updated (and hopefully the changes that would occur) if i'd do a 'git pull'... is git stash git fetch git diff origin/master git stash apply the answer ? 回答1: See here. To quote: you can do a 'git fetch origin', then a 'git log master..origin/master', and it'll tell you what changes will be merged if you do a 'git merge origin/master'. 回答2: Since git pull is git fetch plus git merge , do the fetch first, and then diff the remote branch against your

How to view Mercurial changeset changes using a GUI diff tool

不想你离开。 提交于 2019-12-07 13:49:21
问题 We use both Examdiff and Kdiff3 to view Mercurial changes. Just add this to .hgrc : [extdiff] cmd.kdiff3 = cmd.examdiff = C:\Program Files\ExamDiff Pro\ExamDiff.exe And then you can type hg examdiff or hg diff3 to see a complete diff of all your changes. What I would like is to do the same to see a "before and after" of files for a given changeset that was checked in by someone else. I know you can type hg log to see all changesets and then hg log -vprXX to see a text diff, but that's too

svn merge --dry-run Show svn diff

寵の児 提交于 2019-12-07 12:23:07
问题 I'm working with a codebase that has (historically) been merged by hand rather than via svn merge . I'm trying to change that by proving to everyone how useful merge is - but when I do a dry run, I get this: $ svn merge [[Repo URL]] . -c 21355,21358,21364,21370,21371,21373 --dry-run --- Merging r21355 into '.': U [[File 1]] --- Merging r21355 into '[[dir]]': U [[dir]]/[[File 2]] U [[dir]]/[[File 3]] --- Merging r21358 into '[[dir]]': U [[dir]]/[[File 4]] --- Merging r21364 into '[[dir]]': U [

Using a different application to colourize diff output in git

余生颓废 提交于 2019-12-07 11:38:51
问题 I want to use cdiff to colourize my diff output when using git. I could pass the output from git commands through cdiff, but I'd like to know if it's possible to not have to do this. Specifically, when I use git log -p , I want it to use cdiff to colourize the output, when I use git commit -p , I want it to use cdiff to colourize the output. I'd like to tell git to not do the colouring itself, and to instead use this extra programme. How do I do this? 回答1: From what I can see, git produces

Method name from line number

五迷三道 提交于 2019-12-07 10:46:45
问题 Given a line number of a particular class source code (Java/C#) - is there an easy way to get the name of the method it falls within? (If it falls within one) (Presumably using an Abstract Syntax Tree) (This would be useful in limiting the output of checkstyle to just the method touched). I'm assuming you'd have to use an Abstract Syntax Tree to do Line#->MethodName. 回答1: (Java-specific) If the class file was compiled with debug info then the line number table will contain a mapping of code<-

diff - find specific change between two values in hex dump

半腔热情 提交于 2019-12-07 10:28:33
问题 I am analyzing hex data from binary data dumps from a basic command-line program of mine. I'm basically dumping the exact contents of a struct (a large array of structs, actually) to a text file. I then create a second binary dump, and compare the two files in vim using xxd to create binary-to-text representations of the original data. Both files are the exact same size in bytes, and I'm trying to compare the two in a meaningful way. Even a small change in the data before I dump the file

Eclipse Abstract Syntax Tree Diff

萝らか妹 提交于 2019-12-07 10:23:31
问题 Given the following code in Eclipse: import org.eclipse.jdt.core.dom.AST; import org.eclipse.jdt.core.dom.ASTParser; import org.eclipse.jdt.core.dom.CompilationUnit; public class Question { public static void main(String[] args) { String source = "class Bob {}"; ASTParser parser = ASTParser.newParser(AST.JLS3); parser.setSource(source.toCharArray()); CompilationUnit result = (CompilationUnit) parser.createAST(null); String source2 = "class Bob {public void MyMethod(){}}"; ASTParser parser2 =

git merge using the vs2012 diff tool

旧巷老猫 提交于 2019-12-07 06:09:17
问题 Is it possible to use the diff tool in visual studio 2012 together with git? Using "devenv /diff fileA fileB" i can bring up a diff between two files, but how can i add a third (base file) as well, having 3 views side by side. Im currently using TortoiseGit and BeyondCompare. 回答1: Git can be configured to use any generic diff tool, not only the one it knows out of the box. To call a generic diff tool, set the diff.tool configuration variable to a custom diff tool alias, say "vs2012", by

Structural Diff of two java source files

£可爱£侵袭症+ 提交于 2019-12-07 05:06:31
问题 Is there any way to find Structural diff of two java source files? I want to find structural difference of two java files, but i don't know how to start it. Is there any library in java for this purpose? Update: Structural diff means like it does not care about white space or locations. It should compares source a syntactically. This helps us to trace actual changes, even if methods are moved to another location or appear in different order. i found a tool that is for C# and pascal but i need