Graphical diff for darcs - diff

I don't feel very comfortable seeing the darcs changes in plain text format, so I've been looking for a tool to display a nice side-by-side comparison of the changes.
For the whatsnew I can just use meld, but when I need see the changes already recorded it does not work as easily. I've read that diffuse allows to compare different revisions, but I cannot get it to work.
I've tried
diffuse -r HEAD^1 -r HEAD^2 myfile.py
but it fails (I think that revision naming is specific to git), so does somebody know how to see the latest changes in darcs?
Suggestions for other tool that does the work (and does not require to set up a web server preferably) are welcome.

in fact you should write something like:
darcs diff --diff-command="diffuse %1 %2" myfile.txt
It works with ECMerge (the tool I work on), it should work seamlessly with diffuse. Darcs will call diffuse with temporary files as necessary (to compare the files from the repository). By the way, ECMerge can dig in Darcs configurations with its browser UI.
EDITED:
to diff tags or patches in the repository, use --from-tag= or --from-patch= and --to-tag= or --to-patch= notation. You should be able to do what you want, however note that from-patch means "from before patch" and --to-patch means "up to after patch". it was not really obvious for me...
(to know the last of changes use darcs changes)

I do not know how to integrate with darcs, but KDiff3 is a wonderful graphical diff/merge application available both for linux, macos and windows.

Related

How to merge files(differentiate) in visual studio code

I am using Visual studio code for angular2 application. The requirement is to merge files, so, I want to differentiate changes in two files as it happens in Netbeans IDE. Is there, any extensions available to achieve the task in visual studio code.
For e.g - Merging Two files by differentiating changes like below:-
Please suggest some solution.
abc.component.ts (located in project1)
abc <-- text for understanding purpose
def
abc.component.ts ( located in project2)
abc
I want to differentiate two component files and push changes in another like it happens in Netbeans IDE? Is there, any solution available for Visual studio code?
First using vscode natively with the git toolset
(Make sure to look on the second title as it's a better native way!)
This way may be available on older version of vscode too! Still a good thing to know! (even we should always run on the latest version! And vscode is always keeping getting better and better).
A native powerful and cool way is to use the git toolset within vscode! It still not the most fluid way! But if you are in a setup where you don't have anything else or time or resources to use anything else! Also as a requirement you need to have a git repo initiated! Here we go:
First we will use the change and diffing capability of the git tool set. And the steps go as bellow:
Commit all the current changes
once done: copy past the other file to diff on the place of the current one. And save.
Cool now in the git pallet you can see the file in changes list! Click on it and the diffing editor will show!
Bingo this is it! You can compare and make direct changment! The diffing will keep happening in real time. Note the current state is in the right. And you make changement there.
Here an illustration of direct modification for instance the part in the left is missing from the current file
And here another illustration (current have in plus)
Well to sum up! Git tool and diffing in vscode is so powerful! And all that one need! The only problem is the extra step of committing and cleaning after if desired!
Here some tips! If you want to have the commit history cleaner! Or not have a merge separate! You can remove the last commits from history as much as you need: Without hard reset and commit again a cleaner one!
git reset --soft HEAD~1
You can check
How to cancel a local git commit
Otherwise it can be ok with atomic commit and merge mention!
Also if what you need is to be able to keep a lot from the current file! You can copy the current elsewhere! past the other file to compare! commit ! and then past again the old one! You'll have the old in the right and as current (Not as described on the above) In such a scenario this work well! (Hacky a bit but you may need it).
Native way (direct open of the compare editor)
(May require the newer version of vscode)
open a file that you gonna compare
open the command pallet
CTRL + SHIFT + P
type file: compare
You can see the different possible ways! For a file we can choose compare active file with.
Then you choose the file! The file need to be within the project directory.
And then you choose a file and the compare editor will open
The above was tested on my brother computer on a new vscode installation. I wasn't sure at first if it was part of the core! And i just confirmed that it is. That too remove the need to the method above involving git! And it's the best native way to go with.
Vscode extensions
Here two extensions i suggest the first:
https://marketplace.visualstudio.com/items?itemName=jinsihou.diff-tool
Easy and simple! It add two elements to the right click menu:
In current file right click -> Select as first file for diff, select one again to view the diff results
select to compare and compare with select no more simple then that !
Another extension to check:
https://marketplace.visualstudio.com/items?itemName=fabiospampinato.vscode-diff
I prefer the first! As this one compare a lot to the native way. And having the control in the contextual menu is just great.
Out of vscode! Using other tools
A quick google search and you'll find a lot of tools!
https://meldmerge.org/
meld merge is cross platform and open source and nice!
in linux and debian:
sudo apt install meld
Otherwise you can check the long list here:
https://www.jotform.com/blog/25-useful-document-and-file-comparison-tools/
https://stackify.com/code-merge-tools/
There is too winMerge to mention (an open source project for windows)
https://winmerge.org/

Split a file with conflict markers

I am looking for a tool that will split a file that has conflict markers into the two separate files. Is there anything out there that does this already?
xxdiff can do that:
xxdiff --unmerge myfile.txt
it also works if the conflict markers result from a 3-way diff
xxdiff --unmerge3 myfile.txt
The tool I work for (ECMerge) does that, primarily with the target of helping you to merge them visually of course. You could as well save the left/right/ancestor files with the built-in Javascript engine. ECMerge reads markers for most 'well-known' source code controls (CVS, git, mercurial, bazaar, SubVersion, Perforce, those compatible with the previously cited and of course its own markers!).
Winmerge does that, they call it "Resolve conflict files". It only works on Windows though.
As requested, my own solution to my question was to create the following Perl script.
http://github.com/quincy/Unmerge-Conflicts

Diff file viewer?

I'm looking for a tool that displays diff files (generated from mercurial, in my case) in some convinient manner. For example, the way bugzilla displays diff patches. Just to be clear, I'm not looking for something that compares/merges files, I already got the diff, just want a convinient way to inspect it.
I couldn't find anything that does that (diff syntax highlighters were the closest thing I got), anyone knows of anything?
Have you tried meld? (it works only in UNIX though..)
I would look into the following Atlassian product 'FishEye' http://www.atlassian.com/software/fisheye/
This allows you a lot of control over your version control system and code views/diffs/code reporting/visualisation etc.
I really like Beyond Compare and Araxis Merge (especially Araxis).
I had the same question -- basically a good syntax highlighter for diff output. I wanted something lightweight and free.
Now I'm using sdif and cdif together.
sdif does the syntax highlighting you want
cdif does word context diffs, so that on a modified line the words that have changed are highlighted differently
As #tomahawk suggested, if you point FishEye at your Hg repository you'll be able to diff between revision of a file, and view a changeset as a diff.
If you want to look at arbitrary patch files, you could buy Atlassian's Crucible, which allows you to create a code review by uploading a patch, which you can then view as a nice diff (and comment on collaboratively, but that is probably not of interest to you). A 5 user Crucible licence costs $10.
(Disclosure: I'm a Crucible developer at Atlassian)

Are there any apps that save backup versions of a file with one click (save, commit, etc) live while editing?

Just something that will save changes automatically, while i'm editing say in gedit, or notepad plus plus, or even windows text editor, etc.
I can't seem to find exactly what I'm looking for and svn, bzr, and Git are too complicated. One should be able to start a new project, start writing code, and that's it!
So... I'm going to create a whole new version control system that will be more amazing and simple than all the rest! Unless something already exists? Whether it be online, or a local install, whatevs.
EDIT: Ok, the above paragraph was a bit absurd now that I read it much later. I use Git now, and Git is awesome.
Many text editors will create a backup copy of the prior version when you do a save.
Of course, this is pitiful compared to an actual version control system. You should know that many VCS integrate with editors so commits are very simple quick commands.
The minor time it takes to create a repository is insignificant compared to the time it will save you during the project.
Frankly, this sounds like an argument from ignorance.
I found this nice little Gedit plugin: http://nerdblog.pl/2009/06/01/save-and-commit-to-git-plugin-for-gedit-2-26ave/

Eclipse diff for large file shows incorrect differences

I am not sure if anybody has experienced this.
I am working with a very large file having 7000 lines of code.
I made a lot of changes and when i compared the file with the repository version, it showed me incorrect differences.
I guess the diff algorithm buffers only limited number of lines ahead/behind for searching the current line, and on failing to find that, it simply shows diff with current line in new file.
One such snapshot > http://picasaweb.google.com/lh/photo/ENwZ4gqXxiCF3SWqVnVAqA?feat=directlink
If anybody knows any workaround, please let me know.
Thanks
Easy workaround - use another diff tool. I'm serious. I wouldn't waste time splitting up my files, or wondering how to get it to work with Eclipse's diff tool if there's some known issue with really big files.
I recommend Beyond Compare 3. I say this having used many different diff tools. It's not free, but it's worth it. In the rare chance that it gets confused, it allows you to with a couple of clicks realign any areas that it got confused on. I have used it with some pretty large files, and it rocks.
If you're concerned about Eclipse integration, there's even a plugin, BeyondCVS, that allows you to launch your Beyond Compare diffing from the Eclipse right click 'Compare' menus. Its name is kind of misleading though, as it doesn't appear to be related to CVS.
If you need something free, try one of these diff tools instead:
WinMerge
SourceGear DiffMerge
What version of eclipse are you using? And what edition? (Java? CDT? ...)
Depending on those data, it could make a difference, since files with several thousand lines are known to be a problem for the diff algorithm.
See this thread for illustration.
And do check, as mentioned in the same thread, your error log to check if any particular message could help you to pinpoint the cause of the failed diff.