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.
Related
What I need
a fast/performant way to open any file under a large (git) repo (~9.8k files).
Context
I have tried various solutions, like Textmate.el and find-file-in-repository. I found these solutions via previous SO questions like this and this and through the LocateFilesAnywhere EmacsWiki.
While both solutions work wonderfully for small-to-mdeium repos, in this case they are practically unusable. When I start typing a filename, there's a delay of several seconds before I see any result. And changing any part of the search is very laggy too.
I think the main problem is that on typing any character, emacs/find-file-in-repository starts a shell command (git ls-files...). I really only need to do that when I have stopped typing.
Questions
is there a better library out there for this use-case?
if not, how can I introduce a delay into the command when I'm typing? i.e. while I'm in find-file-in-repository, I want the find-command to be invoked only when I stop typing (let's say a gap of 300ms).
Summary
After I received the three answers I tried them out (also answering my own question as none of the above solutions worked for me). I finally settled for helm-ls-git. Here's a comparison from my point-of-view:
Projectile
took around 30 minutes to index the repo. Since projectile is not aware of .gitignore, the actual number of files is more like 52k.
can be customized but something that just works (i.e. understands git) is preferable
may need to invalidate cache re-index time to time. That would be costly and frequent since new files are added everyday to the repo.
helm-cmd-t
looked good from the description and the source.
hard to install since it's not published in melpa/marmalade etc. More details in this issue I opened up.
GNU Global
Didn't try as it's likely to have the same problems as Projectile (git-unaware, needs it's own "index" that may need to be maintained time to time)
event-jr's answer however opened up some more options: I was unaware of helm till now. Looking at melpa for helm related plugins I found the following:
helm-git
This looked really promising
Was easy to install with package.el since it's in melpa
I also use and love magit - so this looked a good fit.
However, it kept failing with a magit-git-dir: symbol is void kind of error. Did not dive in too much but looks like it needs to be updated. Opened up an issue
helm-ls-git
As the readme says, this is magit independent.
Has been working wonderfully so far. Easy to install (melpa) and is fast.
I use GNU global for this. I have around 20K files in my project. You can run
M-x gtags-find-file and type first few characters. TAB will complete and show all the matching. You can type any characters which is part of the file name and press enter. Will show all the files that contains these characters.
I tried to use projectile for this. But it was way too slow for the 'project indexing'. It didn't complete the indexing even after 1.5 hours and I have to kill it!. Not sure some thing is wrong here. GNU global is much faster and finishes the entire tag creation within 15 min.
You can check out Projectile. It was basically created to provide something similar to C-p, but has a lot of extra project level features as well. First time project indexing will be fairly slow on such a big project, but afterwards Projectile will cache the project files (both on memory and on the hard drive) and subsequent projectile invocations should be nearly instantaneous.
Projectile also has a Helm plugin to display project files and buffers with Helm.
I use helm-cmd-t happily. It will cache the file list in memory. The cache controls are flexible enough for my needs.
I just answered your question about new repo address here:
https://stackoverflow.com/a/8025310/903943
It's https://github.com/lewang/helm-cmd-t
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)
My team just finished a huge project. We're going to present it to class in a week, and want to add some interesting stats.
Is there any way to find out how many times we've compiled the code over the last X days?
Thanks
Not that I'm aware of but if you go into Project>Properties>Refactoring History you can see a detail of all the refactoring you've done. That may make for some interesting stats.
I'm not aware of such functionality but you can install a metrics plugin such as this for other code metrics. Eclipse auto-compiles code so I'm not sure how useful such as statistic is.
I don't know of any way to get the number of times you compiled. But if you want some similar (and hopefully useful) statistics, go to .metadata\.plugins\org.eclipse.core.resources.history. You will see the change history there. Each time you make a change, Eclipse keeps track of the change by creating a file here. Sort the files by date, and you can easily get some statistics to display for your presentation.
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/
I'm looking for a diff/compare tool that shows differing lines from two text files, and gives me a space to comment on those files. Ideally this application would have three panes, pane one would be file A, pane two would file B and pane three would be a comment I can enter to on why the files are different.
We're going to be using this diff tool to compare test and production environments. Sometimes it'll be justifiable that the two files are different but we need to have a space to explain why. I'd rather not write those comments in the files themselves.
I've used TortosieMerge, WinDiff and Beyond Compare. I like beyond compare the most because it lets me see the whole file, just the differing lines or the differing lines in context.
Tools that sit inside Visual Studio or eclipse are fine too.
It sounds to me like you might want to use a code review tool for this (even if you're not really performing code reviews). They record diffs in a database and allow comments on those diffs.
A couple free ones are:
CodeStriker - I've used this and it works pretty well, but required more tweaking and mucking around in Perl that I'd have liked (that was a while ago, though)
Review Board - never used this, but it sure looks nice. I'm trying to get it installed at my current place of work.
I would like to suggest a high-efficiency software CodeGen to you. It's not only include TextCompare tools, but another Codec/Database tools is supported as well.
For more detail, please kindly access the Github repository.
https://github.com/work7z/CodeGen