Sublime Forum

ST3: GitSavvy, Git integration w per-line/hunk staging

#1

Hey all,

I’m new here but thought I’d let you know I released GitSavvy for ST3. It features all the basic git tasks that you use regularly, inline diff viewing with ability to stage individual lines and hunks (inspired by SourceTree), and a status dashboard. I have a number of other features in the pipeline, but got it to the point of a v1.0 release.

github.com/divmain/GitSavvy

Let me know if you have any ideas or feedback.

Dale

0 Likes

#2

Looks like a very nice and feature rich plugin.

I wonder why git_path is hardcoded to C:/Program Files/… on Windows by default. To work efficiently with git, it really has to be in the PATH and I guess installer does it automatically. There shouldn’t be any need to hardcode the path if it’s in the PATH. I had to set it to empty path for plugin to work.

Rebase view should support dropping commits.
Also maybe some smart handling for fixup!/squash! commits. Similar to what git rebase --interactive --autosquash does. Maybe just a shortcut to trigger this command.
Also, I’m not sure how it’s decided which base is chosen for the rebase dashboard, but maybe using git merge-base HEAD origin/master would give better results. I saw some irellevant base being selected for the branch I’ve tried it on. It included a lot of commit from master which I really wasn’t interested in.

Blame view could support showing full commits and moving to parent commit from the one under the cursor.

0 Likes

#3

Hey rchl, thanks for the feedback! Your note about git_path on Windows is a good one. I don’t dev on it regularly, and the per-platform Git paths were a recent addition. The default is now to search the path, and can of course be customized as desired. Also, really good call on dropping commits in the rebase dashboard. For some reason, that hadn’t even crossed my mind. I’ve added an issue for that.

Choosing the base for the dashboard is a tricky thing. It actually does use git merge-base HEAD master to determine the default base commit. That can also be modified on a per-project basis. One thing I’d like to do is to check for a tracking branch, and potentially use that as the default if found (probably toggleable). That would help users conform to the advice of “only rebase if you haven’t pushed yet”. There are a handful of optimizations that could also happen in the rebase dashboard that I simply haven’t gotten to, largely because what’s there is good enough, and nobody has been pestering me :smile:

There are some plans for the blame view, including the ability to walk back in time with a file, which sound similar to what you’re asking for. It is possible, however, to display the full commit by pressing SUPER-Enter on a Mac or CTRL-Entry on Windows/Linux while cursor is over a particular hunk.

Thanks again! If you have any additional thoughts, would be glad if you had a moment to open an issue. I’ve tried to be prompt in responding, even if the feature takes awhile to land.

0 Likes

#4

Since this post is old, I’ll also add that there’s been a lot of functionality added since the initial release. Of note:

  • git: rebase dashboard (including an undo feature!)
  • git: tags dashboard
  • git: branch dashboard
  • undo for the inline diff (un)staging views
  • fuzzy string search of git log
  • changelog generation
  • git flow support
  • lots of UX improvements
  • more GitHub integration, including referencing issues, easily adding remotes for forks of the repo you’re working on, etc.
  • plus lots of other enhancements and fixes!

If you run into trouble, there’s usually someone around to help in the Gitter channel:
gitter.im/divmain/GitSavvy

And we’re actively taking feature requests - so if there’s something you’d really like to see, please open an issue!

0 Likes

#5

I had to disable this plugin because on Mac it locks the git repository which blocks me from using git from the command line anymore.
I haven’t investigated how it triggers, but seems to happen pretty consistently after using Sublime for a while (if I ever used any GitSavvy function in the same session, it probably was ‘blame’).

0 Likes