Home Download Buy Blog Forum Support

ST3: EasyDiff

ST3: EasyDiff

Postby facelessuser on Thu Oct 24, 2013 4:33 pm

Thought I would post this if anyone was interested. This is not on Package Control; I am only feeling out interest (if any). Though the core code is pretty stable, some of the new version control features can be considered beta.

There are a number of diff plugins available, so if there is no interest here, that is fine. I have been using the plugin for personal use for a while (though it is still evolving), and recently, after adding some new features, I thought I would offer it in its own repo to see if anyone other than myself would like to use this.

I have used a number of diff plugins (some very good), but all lacked what I wanted for the way I work...so, I wrote my own. This is not meant to allow merging, nor will it moving forward; just diffing. So let's get to the plugin:

EasyDiff is a plugin driven from the context menu (I found this more intuitive for the way I work). I wanted to quickly diff selections, multi-selection, clipboard comments, and files. Then overtime, I wanted to quickly diff files in my SVN repos and Git repos without having to go back to explorer or finder etc. I found the command palette too cumbersome, so I wanted to use the context menu. But when I selected something for the left side compare, I wanted to visually be able to see what was on the left side in case I got distracted and forgot. So EasyDiff solves this by creating a dynamic context menu in your user folder. When you pick a file for left side compare, the file name shows up in the context menu. Same with selections and clipboard.

Version control was a recent addition. I wanted to be able to see my current changes to be committed, or look at the diff of the last revision. And I wanted to be able to do this on the Git and SVN since I use them both. So EasyDiff has a wrapper around the git binary, and the svn binary (by default it assumes git and svn are in the PATH; you can point EasyDiff at the binary if you need to). I am sure someone will probably discover some small detail I have overlooked, but so far, they seem to work fine. If you don't use Git or SVN or either, you can selectively disable the menu items in the settings file. I will probably add Mercurial down the line; I just don't use it much.

Image

  • Allows comparing views, selections, multi-selections, and clipboard combinations.
  • Dynamic context menus for selecting left side and right side compare. Dynamic menus show what file is on left side.
  • Compares current working copy against last committed revision in git and svn (must configure binary paths)
  • Shows diff of last commit in git and svn
  • Shows diff of staged commits for git
  • View diffs in a view buffer or output panel
  • You can selectively disable version control menus if you don't want to see them.

repo: https://github.com/facelessuser/EasyDiff

Feel free to tell me you like it, hate it, won't use it, make suggestions, or simply let this thread sink to the bottom of the feed.
facelessuser
 
Posts: 1541
Joined: Tue Apr 05, 2011 7:38 pm

Re: ST3: EasyDiff

Postby facelessuser on Fri Oct 25, 2013 12:31 am

-Fixed an SVN issue
-Added Mercurial support
-Redesigned how all of the version control options are shown
-Can now hide version control menu entries or disable the commands completely via the settings file.

Image

That is it for now. This will probably be my last post in this thread unless there is some interest.
facelessuser
 
Posts: 1541
Joined: Tue Apr 05, 2011 7:38 pm

Re: ST3: EasyDiff

Postby bizoo on Fri Oct 25, 2013 7:53 am

Thanks for plugin, I like the use of context menu ala Beyond Compare.

My only issue is with Git. I have a rather large repository and when I right click on a view to open the context menu it takes seconds to be showed.

Didn't look at the code but I suppose there must be a is_enabled() on menu item that call GIT.
Maybe a setting to disable this code replaced by a status bar message when there's nothing to do could make the trick.
bizoo
 
Posts: 870
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Re: ST3: EasyDiff

Postby facelessuser on Fri Oct 25, 2013 2:32 pm

bizoo wrote:Thanks for plugin, I like the use of context menu ala Beyond Compare.

No problem. You hit the nail on the head; Beyond Compare was the inspiration. It made a big difference in usability for me.

bizoo wrote:My only issue is with Git. I have a rather large repository and when I right click on a view to open the context menu it takes seconds to be showed.
Specifically on large Git repos, or on all repos?

bizoo wrote:Didn't look at the code but I suppose there must be a is_enabled() on menu item that call GIT.
Maybe a setting to disable this code replaced by a status bar message when there's nothing to do could make the trick.

Yeah, is_enabled. I use to determine when to show "selection" and "view' options, but I also use to determine if the current view is versioned control under svn, git, or mercurial (if they are enabled). With git, I have to hunt around for the ".git" folder to feed the git command before I execute the version command...I wonder if that is what takes so long, or if the version check in general takes too long because of the big repo (even though I am only polling for the single file's status). Regardless, I can probably optionally skip the version check to speed things up.
facelessuser
 
Posts: 1541
Joined: Tue Apr 05, 2011 7:38 pm

Re: ST3: EasyDiff

Postby facelessuser on Fri Oct 25, 2013 5:07 pm

@bizoo I added your request

    // Do not perform a version check on files
// when evaluating whether version control
// commands are enabled. May avoid slowing
// down context menu draw in large version
// controlled projects.
"skip_version_check_on_is_enabled": false,


This will avoid graying out version control items dynamically when showing the context menu, but hopefully speed up menu display. The commands, if run when the file is not versioned controled (vc) under the selected vc system, will display a message in the status bar. The only downside is that you won't be guided to the appropriate menu items, but I think a slow menu would be a greater inconvenience.
facelessuser
 
Posts: 1541
Joined: Tue Apr 05, 2011 7:38 pm

Re: ST3: EasyDiff

Postby facelessuser on Fri Oct 25, 2013 9:24 pm

I made a slight modification in the logic to "diff last revision" in git. It just wasn't working how I had intended. It was diffing the last commit for the repo. Now, it diffs the last revisions where the file in question was modified. This is now in line with how the other Version Control system's commands are implemented, and how i think most would expect it to work.
facelessuser
 
Posts: 1541
Joined: Tue Apr 05, 2011 7:38 pm

Re: ST3: EasyDiff

Postby bizoo on Mon Oct 28, 2013 8:24 am

facelessuser wrote:@bizoo I added your request

    // Do not perform a version check on files
// when evaluating whether version control
// commands are enabled. May avoid slowing
// down context menu draw in large version
// controlled projects.
"skip_version_check_on_is_enabled": false,


This will avoid graying out version control items dynamically when showing the context menu, but hopefully speed up menu display. The commands, if run when the file is not versioned controled (vc) under the selected vc system, will display a message in the status bar. The only downside is that you won't be guided to the appropriate menu items, but I think a slow menu would be a greater inconvenience.

Works great, thanks.

facelessuser wrote: bizoo wrote:My only issue is with Git. I have a rather large repository and when I right click on a view to open the context menu it takes seconds to be showed.

Specifically on large Git repos, or on all repos?

There's a very small delay (insignificant) for small repositories, but for a somewhat large repository (~60000 files) it takes 2-3 seconds.
startup, version: 3054 windows x64 channel: dev

facelessuser wrote:No problem. You hit the nail on the head; Beyond Compare was the inspiration. It made a big difference in usability for me.

Great, I was thinking about adding an external program for the diff (Beyond Compare actually). Sometimes viewing large diff in ST is not very useable.
I'll look at it when I've some times.
bizoo
 
Posts: 870
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Re: ST3: EasyDiff

Postby facelessuser on Mon Oct 28, 2013 3:19 pm

bizoo wrote:Great, I was thinking about adding an external program for the diff (Beyond Compare actually). Sometimes viewing large diff in ST is not very useable.
I'll look at it when I've some times.

Yeah, I have considered it too. I know roughly how I would do it all behind the scenes; I should be able to even incorporate the version control diffs as well. Just not sure how I would display it in the menus yet. If I you get to it before me that is cool too :).
facelessuser
 
Posts: 1541
Joined: Tue Apr 05, 2011 7:38 pm

Re: ST3: EasyDiff

Postby facelessuser on Tue Oct 29, 2013 12:00 am

@bizoo, I should have some external diffing for everything but version control late tonight. I worked out what I need to do over lunch today. I code it up and commit tonight. I will get version control up and running hopefully in the next number of days. You should be able to enable/disable external diffing or internal diffing options in the settings file.
facelessuser
 
Posts: 1541
Joined: Tue Apr 05, 2011 7:38 pm

Re: ST3: EasyDiff

Postby facelessuser on Tue Oct 29, 2013 6:53 am

External diff is in for left and right compare of views, selections, and clipboard. When I get time, I will get external support for version control in, but that might take me a couple of days.

Just set "show_external" to true in the settings file.
And give the absolute path to your compare tool in the "external_diff" setting.

If your compare tool uses arguments more complex than "compare_tool file1 file2", you make have to wrap the call in a batch file or shell script depending on your system. If it is really a problem, I can make the "external diff" setting more flexible, but for the most part, I hope this isn't a problem. On OSX, I had to wrap my call in a shell script for my diff tool, but Beyond Compare on windows just takes the files.

You can also turn off the internal sublime diff options via the "show_internal" option int he settings file if you decide you only want to use the external tool.
facelessuser
 
Posts: 1541
Joined: Tue Apr 05, 2011 7:38 pm

Next

Return to Plugin Announcements

Who is online

Users browsing this forum: Ivan171 and 8 guests