Home Download Buy Blog Forum Support

SideBarGit

SideBarGit

Postby tito on Sun Oct 16, 2011 8:05 pm

Hi there,

I ported my JavaScript extension Komodin for Sublime Text as I want to learn Pyton. I wrote Komodin to learn Git.

I tested it only on WindowsXP, I think should work on Linux on same way
Let me know if you found some problem or if you want to add some command.

I know there is already some efforts into proving Git support, I don't want to disturb there, this provides to many commands and is just a textual port.
There is nice presentations of data from the Git plugin that can be used by this plugin, I'll look there later.

Regards,

Image

Description
------------------

Provides Git commands on Side Bar of Files and Folders for Sublime Text 2. For sublime text see: http://www.sublimetext.com/

It should work with files names and messages in any language.

This plugin is a port of the "Komodin" extension for komodo edit. See: https://github.com/titoBouzout/komodo-komodin-git


Usage
------------------

* Right click on "multiple/single" "files/folders" of the "tree" sidebar to apply commands on selected files which maybe are from different repositories.

* To apply commands to focused document use the buffer context menu.

Provides the following commands
------------------
Add & Commit
o git add -- "/selected/paths/files/or/and/folders"
o git commit -m "promptMessage" -- "/selected/paths/files/or/and/folders"
Add & Commit & Push
o git add -- "/selected/paths/files/or/and/folders"
o git commit -m "promptMessage" -- "/selected/paths/files/or/and/folders"
o git push

Commit
o git commit -m "promptMessage" -- "/selected/paths/files/or/and/folders"
Commit Undo
o git reset --soft HEAD~1

Commit Amend
o git commit --amend -C HEAD -- "/selected/paths/files/or/and/folders"
Commit All
o git commit -a -m "promptMessage"

Status
o git status --untracked-files=all -- "/selected/paths/files/or/and/folders"

Diff

all changes since the last commit
o git diff git diff HEAD -- "/selected/paths/files/or/and/folders"
changes that have not been staged
o git diff git diff -- "/selected/paths/files/or/and/folders"
changes that are staged but not committed
o git diff git diff --staged -- "/selected/paths/files/or/and/folders"
between the index and last commit
o git diff git diff --cached -- "/selected/paths/files/or/and/folders"
between remote and last local commit (origin/master..)
o git diff git diff origin/master.. -- "/selected/paths/files/or/and/folders"
between last local commit and remote (..origin/master)
o git diff git diff ..origin/master -- "/selected/paths/files/or/and/folders"
between the two latest tags
o git diff "previousTag".."lastTag" -- "/selected/paths/files/or/and/folders"

Log stat last 30
o git log -n 30 --stat --graph -- "/selected/paths/files/or/and/folders"

Log stat full
o git log --stat --graph -- "/selected/paths/files/or/and/folders"
Log extended last 30
o git log -n 30 -p -- "/selected/paths/files/or/and/folders"
Log extended full
o git log -p -- "/selected/paths/files/or/and/folders"
Log since last tag
o git log "lastTag"... --stat --graph -- "/selected/paths/files/or/and/folders"
Log since last push
o git log origin/master... --stat --graph -- "/selected/paths/files/or/and/folders"
Log between the two latest tags
o git log "prevToLastTag".."lastTag" --stat --graph -- "/selected/paths/files/or/and/folders"

Blame
o git blame -- "/selected/paths/files/NOT/folders"

Auto-Tag
o git tag "YYMMDD.Version"

Tag Add
o git tag "promptMessage"
Tag Remove
o git tag -d "promptMessage"
Tag List
o git tag -l

Revert Discard changes to tracked
o git checkout HEAD -- "/selected/paths/files/or/and/folders"

Revert Discard changes to tracked, clean untracked
o git checkout HEAD -- "/selected/paths/files/or/and/folders"
o git clean -f -d -- "/selected/paths/files/or/and/folders"
Revert Discard changes to tracked, clean untracked, unstage
o git checkout HEAD -- "/selected/paths/files/or/and/folders"
o git clean -f -d -- "/selected/paths/files/or/and/folders"
o git reset HEAD -- "/selected/paths/files/or/and/folders"
Revert Discard changes to tracked, unstage, clean untracked
o git checkout HEAD -- "/selected/paths/files/or/and/folders"
o git reset HEAD -- "/selected/paths/files/or/and/folders"
o git clean -f -d -- "/selected/paths/files/or/and/folders"
Revert Unstage
o git reset HEAD -- "/selected/paths/files/or/and/folders"

Checkout to
o git checkout promptMessage -- "/selected/paths/files/or/and/folders"
Checkout repo to
o cd repoPath
o git checkout promptMessage

Push
o git push

Push, Push Tags
o git push && git push --tags
Push Tags
o git push --tags
Push with options…
o promptMessage

Pull
o git pull
Pull with options…
o promptMessage

Fetch
o git fetch
Fetch with options…
o promptMessage

Remote add
o git remote add promptMessage
Configure default remote
o git config branch.promptBranch.remote promptRemoteName

Clone
o git clone promptMessage
Init
o git init

Add
o git add -- "/selected/paths/files/or/and/folders"
Remove
o git rm -r -f -- "/selected/paths/files/or/and/folders"
Remove Keep Local
o git rm -r --cached -- "/selected/paths/files/or/and/folders"

Open Git Ignore
Add to Git Ignore

Git GUI
Gitk
Liberal Git Command


Installation
------------------

* Install this repository via "Package Control" http://wbond.net/sublime_packages/package_control

Todo
------------------

* Tag commands not yet ported

Source-code
------------------

https://github.com/SublimeText/SideBarGit

Forum Thread
------------------

viewtopic.php?f=&t=XXXXXX

Contribute
------------------

[Consider make a contribution](https://www.paypal.com/cgi-bin/webscr?c ... aNonHosted )
Last edited by tito on Sun Oct 23, 2011 11:39 pm, edited 1 time in total.
Give APIs, let the community build the rest!
https://github.com/titoBouzout
tito
 
Posts: 854
Joined: Thu Sep 29, 2011 2:27 pm
Location: Montevideo, Uruguay

Re: SideBarGit

Postby willi297 on Wed Oct 19, 2011 1:27 pm

This is an awesome plugin Tito! Though, I really need to play with it to confirm that it works well, but I really like the side-bar integration and hope to use it as an example. I help admin the SublimeText org, and would like to see if I can push this to create a standard-ish framework for SCM integration. Thanks for the contribution!
Greg Williams
Atomic Embedded, USA
http://atomicembedded.com
willi297
 
Posts: 121
Joined: Wed Nov 18, 2009 8:29 pm
Location: Grand Rapids, MI, USA

Re: SideBarGit

Postby tito on Thu Oct 20, 2011 8:40 am

You welcome, this plugin uses the classes SideBarSelection, and SideBarItem originally created for "SideBar Enhancements" plugin.

SideBarSelection takes a list of paths as arguments at let you know some "properties" of that paths ( hasDirectories, hasFiles, hasOnlyDirectories, hasFilesWithExtension, etc )
SideBarItem is for manage a path ( directory or file ) in many ways (get path with file system encoding, copy, rename, move, delete, get mime, content, etc )
SideBarGit class has method getSelectedRepos ( which should be moved to class SideBarSelection at some point) that given a list of paths it returns the paths of the git repos found on that list.

I'm all in to use it as a framework to do anything related to files or directories "in the right way", btw, still under testing and probably needs little tweaks. It would be nice if we can add these classes (SideBarSelection and SideBarItem ) to the "Default" package.

_

About creating standard-ish framework for SCM integration is hard, because different SCMs provide different options and features..

Regards
Give APIs, let the community build the rest!
https://github.com/titoBouzout
tito
 
Posts: 854
Joined: Thu Sep 29, 2011 2:27 pm
Location: Montevideo, Uruguay

Re: SideBarGit

Postby jbrooksuk on Thu Oct 20, 2011 11:26 am

Under OSX, some things work, some things don't.

I've added /usr/local/git/bin to my $PATH, yet the command Add & Commit & Push gives me the error:
Code: Select all
Git: No such file or directory
Possible error:
git push not found on $PATH

Working manually through the command line works fine.
jbrooksuk
 
Posts: 765
Joined: Sun Apr 11, 2010 10:37 am
Location: England

Re: SideBarGit

Postby tito on Thu Oct 20, 2011 12:43 pm

Thanks for reporting.

After upgrading to latest version, can you tell if some command is not working?
Give APIs, let the community build the rest!
https://github.com/titoBouzout
tito
 
Posts: 854
Joined: Thu Sep 29, 2011 2:27 pm
Location: Montevideo, Uruguay

Re: SideBarGit

Postby jbrooksuk on Thu Oct 20, 2011 3:58 pm

Works!

Just need new/delete branches etc.
jbrooksuk
 
Posts: 765
Joined: Sun Apr 11, 2010 10:37 am
Location: England

Re: SideBarGit

Postby tito on Fri Oct 21, 2011 5:14 pm

Small update:
  • If a command sends output to a tab ( example a diff ), hitting F5 on that tab: will execute the command again and refresh the tab with the new contents ( example the new computed diff )
Give APIs, let the community build the rest!
https://github.com/titoBouzout
tito
 
Posts: 854
Joined: Thu Sep 29, 2011 2:27 pm
Location: Montevideo, Uruguay

Re: SideBarGit

Postby Jay Levitt on Sun Oct 23, 2011 12:43 am

Nice!

Are sidebar icons on the roadmap, or do those require core ST changes?
Jay Levitt
 
Posts: 52
Joined: Sun Sep 25, 2011 6:22 pm

Re: SideBarGit

Postby tito on Sun Oct 23, 2011 11:38 pm

Probably these require core ST changes
Give APIs, let the community build the rest!
https://github.com/titoBouzout
tito
 
Posts: 854
Joined: Thu Sep 29, 2011 2:27 pm
Location: Montevideo, Uruguay

Re: SideBarGit

Postby jbrooksuk on Mon Oct 24, 2011 7:53 am

Blamed lines can use markers.

Or differences can use region markers?
jbrooksuk
 
Posts: 765
Joined: Sun Apr 11, 2010 10:37 am
Location: England

Next

Return to Plugin Announcements

Who is online

Users browsing this forum: No registered users and 5 guests