Skip to content

Commit

Permalink
Merge python 3 branch into master
Browse files Browse the repository at this point in the history
  • Loading branch information
kemayo committed Jan 8, 2016
2 parents 2fe2c6b + 8dd236a commit 83a8275
Show file tree
Hide file tree
Showing 24 changed files with 805 additions and 378 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*.pyc
*.tmLanguage.cache
*.tmPreferences.cache
.DS_Store
package-metadata.json
89 changes: 55 additions & 34 deletions Default.sublime-commands
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,29 @@
"caption": "Git: Blame",
"command": "git_blame"
}
,{
"caption": "Git: Document Selection",
"command": "git_document"
}
,{
"caption": "Git: New Tag",
"command": "git_new_tag"
}
,{
"caption": "Git: Delete Tag",
"command": "git_delete_tag"
}
,{
"caption": "Git: Show Tags",
"command": "git_show_tags"
}
,{
"caption": "Git: Push Tags",
"command": "git_push_tags"
"command": "git_raw", "args": { "command": "git push --tags", "may_change_files": false }
}
,{
"caption": "Git: Checkout Tag",
"command": "git_checkout_tag"
}
,{
"caption": "Git: Log Current File",
Expand All @@ -39,20 +51,35 @@
"command": "git_diff"
}
,{
"caption": "Git: Diff All",
"caption": "Git: Diff All Files",
"command": "git_diff_all"
}
,{
"caption": "Git: Diff Staged",
"caption": "Git: Diff Staged Files",
"command": "git_diff_commit"
}
,{
"caption": "Git: Diff Current File (Ignore Whitespace)",
"command": "git_diff",
"args": { "ignore_whitespace": true }
}
,{
"caption": "Git: Diff All Files (Ignore Whitespace)",
"command": "git_diff_all",
"args": { "ignore_whitespace": true }
}
,{
"caption": "Git: Diff Staged Files (Ignore Whitespace)",
"command": "git_diff_commit",
"args": { "ignore_whitespace": true }
}
,{
"caption": "Git: Diff Tool Current File",
"command": "git_diff_tool"
"command": "git_raw", "args": { "command": "git difftool", "append_current_file": true, "may_change_files": false }
}
,{
"caption": "Git: Diff Tool All",
"command": "git_diff_tool_all"
"command": "git_raw", "args": { "command": "git difftool", "may_change_files": false }
}
,{
"caption": "Git: Diff Tool Current File Staged",
Expand Down Expand Up @@ -104,11 +131,11 @@
}
,{
"caption": "Git: Stash Changes",
"command": "git_stash"
"command": "git_raw", "args": { "command": "git stash" }
}
,{
"caption": "Git: Stash Pop",
"command": "git_stash_pop"
"command": "git_raw", "args": { "command": "git stash pop" }
}
,{
"caption": "Git: Stash Apply",
Expand All @@ -122,25 +149,37 @@
"caption": "Git: Stash List",
"command": "git_stash_list"
}
,{
"caption": "Git: Stash List",
"command": "git_stash_list"
}
,{
"caption": "Git: Add Current File",
"command": "git_add"
"command": "git_raw", "args": { "command": "git add", "append_current_file": true }
}
,{
"caption": "Git: Add...",
"command": "git_add_choice"
}
,{
"caption": "Git: Add All",
"command": "git_raw", "args": { "command": "git add -A" }
}
,{
"caption": "Git: Checkout Current File",
"command": "git_checkout"
"command": "git_raw", "args": { "command": "git checkout", "append_current_file": true }
}
,{
"caption": "Git: Fetch",
"command": "git_fetch"
"command": "git_raw", "args": { "command": "git fetch", "may_change_files": false }
}
,{
"caption": "Git: Pull",
"command": "git_pull"
"command": "git_raw", "args": { "command": "git pull" }
}
,{
"caption": "Git: Pull Using Rebase",
"command": "git_raw", "args": { "command": "git pull --rebase" }
}
,{
"caption": "Git: Pull Using Rebase",
Expand All @@ -152,7 +191,7 @@
}
,{
"caption": "Git: Push",
"command": "git_push"
"command": "git_raw", "args": { "command": "git push", "may_change_files": false }
}
,{
"caption": "Git: Push Current Branch",
Expand Down Expand Up @@ -200,11 +239,11 @@
}
,{
"caption": "Git: Reset (unstage) Current File",
"command": "git_reset_head"
"command": "git_raw", "args": { "command": "git reset HEAD", "append_current_file": true, "show_in": "suppress" }
}
,{
"caption": "Git: Reset (unstage) All",
"command": "git_reset_head_all"
"command": "git_raw", "args": { "command": "git reset HEAD", "show_in": "suppress" }
}
,{
"caption": "Git: Reset (hard) HEAD",
Expand Down Expand Up @@ -239,25 +278,7 @@
"command": "git_commit_history"
}
,{
"caption": "Git: Open Config File",
"command": "git_open_config_file"
}
,{
"caption": "Git: Open Config Url",
"command": "git_open_config_url", "args": { "url_param": "remote.origin.url" }
}
,{
"caption": "Preferences: Git Settings – Default",
"command": "open_file", "args":
{
"file": "${packages}/Git/Git.sublime-settings"
}
}
,{
"caption": "Preferences: Git Settings – User",
"command": "open_file", "args":
{
"file": "${packages}/User/Git.sublime-settings"
}
"caption": "Git: Update Project Ignored Files",
"command": "git_update_ignore"
}
]
4 changes: 3 additions & 1 deletion Default.sublime-keymap
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
{"keys": ["enter"], "command": "git_goto_diff",
"context": [{"key": "selector", "operand": "markup.inserted.diff"}]},
{"keys": ["enter"], "command": "git_goto_diff",
"context": [{"key": "selector", "operand": "markup.deleted.diff"}]}
"context": [{"key": "selector", "operand": "markup.deleted.diff"}]},
{"keys": ["enter"], "command": "git_goto_commit",
"context": [{"key": "selector", "operand": "text.git-blame"}]}
]
3 changes: 0 additions & 3 deletions Git Commit Message.sublime-settings

This file was deleted.

12 changes: 5 additions & 7 deletions Git.sublime-settings
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@
// use the panel for diff output, rather than a new scratch window (new tab)
,"diff_panel": false

// affects blame command when no selection is made
// true: blame whole file
// false: blame only current line
,"blame_whole_file": true

// If you'd rather have your status command open files instead of show you a
// diff, set this to true. You can still do `Git: Status` followed by
// 'Git: Diff Current File' to get a file diff
Expand All @@ -40,6 +35,9 @@
,"statusbar_status": true
,"statusbar_status_symbols" : {"modified": "≠", "added": "+", "deleted": "×", "untracked": "?", "conflicts": "‼", "renamed":"R", "copied":"C", "clean": "✓", "separator": " "}

// Use diff tool configured in Git config
,"diff_tool": false
// e.g. "Packages/Git/syntax/Git Commit Message.tmLanguage"
,"diff_syntax": "Packages/Diff/Diff.tmLanguage"

// Rulers for commit view
,"commit_rulers": [70]
}
19 changes: 11 additions & 8 deletions Main.sublime-menu
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@
,{ "caption": "Graph", "command": "git_graph" }
,{ "caption": "-" }
,{ "caption": "Diff", "command": "git_diff" }
,{ "caption": "DiffTool", "command": "git_diff_tool" }
,{ "caption": "Diff (no whitespace)", "command": "git_diff", "args": { "ignore_whitespace": true } }
,{ "caption": "DiffTool", "command": "git_raw", "args": { "command": "git difftool", "append_current_file": true, "may_change_files": false } }
,{ "caption": "-" }
,{ "caption": "Add", "command": "git_add" }
,{ "caption": "Add", "command": "git_raw", "args": { "command": "git add", "append_current_file": true } }
,{ "caption": "Add Selected Hunk", "command": "git_add_selected_hunk" }
,{ "caption": "-" }
,{ "caption": "Reset", "command": "git_reset_head" }
,{ "caption": "Checkout (Discard Changes)", "command": "git_checkout" }
,{ "caption": "Reset", "command": "git_raw", "args": { "command": "git reset HEAD", "append_current_file": true, "show_in": "suppress" } }
,{ "caption": "Checkout (Discard Changes)", "command": "git_raw", "args": { "command": "git checkout", "append_current_file": true } }
,{ "caption": "-" }
,{ "caption": "Quick Commit Current File", "command": "git_quick_commit" }
,{ "caption": "Commit Selected Hunk", "command": "git_commit_selected_hunk" }
Expand All @@ -39,13 +40,15 @@
,{ "caption": "Graph", "command": "git_graph_all" }
,{ "caption": "-" }
,{ "caption": "Diff", "command": "git_diff_all" }
,{ "caption": "Diff (no whitespace)", "command": "git_diff_all", "args": { "ignore_whitespace": true } }
,{ "caption": "Diff Staged", "command": "git_diff_commit" }
,{ "caption": "Diff Tool", "command": "git_diff_tool_all" }
,{ "caption": "Diff Staged (no whitespace)", "command": "git_diff_commit", "args": { "ignore_whitespace": true } }
,{ "caption": "Diff Tool", "command": "git_raw", "args": { "command": "git difftool", "may_change_files": false } }
,{ "caption": "Reset Hard", "command": "git_reset_hard_head" }
,{ "caption": "-" }
,{ "caption": "Add...", "command": "git_add_choice" }
,{ "caption": "-" }
,{ "caption": "Reset", "command": "git_reset_head_all" }
,{ "caption": "Reset", "command": "git_raw", "args": { "command": "git reset HEAD", "show_in": "suppress" } }
,{ "caption": "-" }
,{ "caption": "Commit", "command": "git_commit" }
,{ "caption": "Amend Last Commit", "command": "git_commit_amend" }
Expand All @@ -59,8 +62,8 @@
"caption": "Stash",
"children":
[
{ "caption": "Save", "command": "git_stash" }
,{ "caption": "Pop", "command": "git_stash_pop" }
{ "caption": "Save", "command": "git_raw", "args": { "command": "git stash", "may_change_files": true } }
,{ "caption": "Pop", "command": "git_raw", "args": { "command": "git stash pop", "may_change_files": true } }
,{ "caption": "Apply", "command": "git_stash_apply" }
,{ "caption": "Drop", "command": "git_stash_drop" }
,{ "caption": "List", "command": "git_stash_list" }
Expand Down
10 changes: 4 additions & 6 deletions README.markdown
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
# Sublime Text 2 plugin: git
# Sublime Text plugin: git

Git integration: it's pretty handy. Who knew, right?

![Git Commands accessible in Command Palette](https://github.com/kemayo/sublime-text-git/wiki/images/palette.png)

For more information about what's supported, and how to install this, [check the wiki](https://github.com/kemayo/sublime-text-2-git/wiki).
For more information about what's supported, and how to install this, [check the wiki](https://github.com/kemayo/sublime-text-git/wiki).

## Install

### Package Control

The easiest way to install this is with [Package Control](http://wbond.net/sublime\_packages/package\_control).

* If you just went and installed Package Control, you probably need to restart Sublime Text 2 before doing this next bit.
* If you just went and installed Package Control, you probably need to restart Sublime Text before doing this next bit.
* Bring up the Command Palette (Command+Shift+p on OS X, Control+Shift+p on Linux/Windows).
* Select "Package Control: Install Package" (it'll take a few seconds)
* Select Git when the list appears.
Expand All @@ -21,4 +19,4 @@ Package Control will automatically keep Git up to date with the latest version.

### The rest

If you don't want to use Package Control, [check the wiki](https://github.com/kemayo/sublime-text-2-git/wiki) for other installation methods on various platforms.
If you don't want to use Package Control, [check the wiki](https://github.com/kemayo/sublime-text-git/wiki) for other installation methods on various platforms.
35 changes: 35 additions & 0 deletions commands.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
from __future__ import absolute_import, unicode_literals, print_function, division

"""This module collates the Git commands from the submodule
...it's a python 2 / 3 compatibility workaround, mostly.
"""

try:
# Python 3
from .git.core import *

from .git.add import *
from .git.annotate import *
from .git.commit import *
from .git.diff import *
from .git.flow import *
from .git.history import *
from .git.repo import *
from .git.stash import *
from .git.status import *
from .git.statusbar import *
except (ImportError, ValueError):
# Python 2
from git.core import *

from git.add import *
from git.annotate import *
from git.commit import *
from git.diff import *
from git.flow import *
from git.history import *
from git.repo import *
from git.stash import *
from git.status import *
from git.statusbar import *
Loading

0 comments on commit 83a8275

Please sign in to comment.