# Path: sgit/util.py
# def noop(*args, **kwargs):
#     pass
# 
# def abbreviate_dir(dirname):
#     user_dir = get_user_dir()
#     try:
#         if dirname.startswith(user_dir):
#             dirname = u'~%s' % dirname[len(user_dir):]
#     except:
#         pass
#     return dirname
# 
# Path: sgit/cmd.py
# class GitCmd(GitRepoHelper, Cmd):
#     executable = 'git'
#     bin = ['git']
#     opts = [
#         '--no-pager',
#         '-c', 'color.diff=false',
#         '-c', 'color.status=false',
#         '-c', 'color.branch=false',
#         '-c', 'status.displayCommentPrefix=true',
#         '-c', 'core.commentchar=#',
#     ]
# 
#     def git(self, cmd, *args, **kwargs):
#         return self.cmd(cmd, *args, **kwargs)
# 
#     def git_string(self, cmd, *args, **kwargs):
#         return self._string(cmd, *args, **kwargs)
# 
#     def git_lines(self, cmd, *args, **kwargs):
#         return self._lines(cmd, *args, **kwargs)
# 
#     def git_exit_code(self, cmd, *args, **kwargs):
#         return self._exit_code(cmd, *args, **kwargs)
# 
#     def git_async(self, cmd, *args, **kwargs):
#         return self.cmd_async(cmd, *args, **kwargs)


import os
import sublime
from sublime_plugin import WindowCommand
from .util import noop, abbreviate_dir
from .cmd import GitCmd
        this:

        * Find the currently active file.

          * Is it a git view? Use that repository.
          * Is any of the parents a git repository? Use that.

        * If that fails, find the currently active window.

          * Find a list of all possible directories:

            * The directories of any open folders.
            * The directories of any open files.

          * Generate a list of all of the parents of these directories.
          * Check to see if any of the directories or their parents are
            git repositories.

        * Select a repository:

          * If there is only one repository then use that.
          * If there are more than one repository, present a list to
            choose from.
    """

    def run(self):
        repos = list(self.git_repos_from_window(self.window))
        choices = []
        for repo in repos:
            basename = os.path.basename(repo)

# Path: sgit/util.py
# def noop(*args, **kwargs):
#     pass
# 
# def abbreviate_dir(dirname):
#     user_dir = get_user_dir()
#     try:
#         if dirname.startswith(user_dir):
#             dirname = u'~%s' % dirname[len(user_dir):]
#     except:
#         pass
#     return dirname
# 
# Path: sgit/cmd.py
# class GitCmd(GitRepoHelper, Cmd):
#     executable = 'git'
#     bin = ['git']
#     opts = [
#         '--no-pager',
#         '-c', 'color.diff=false',
#         '-c', 'color.status=false',
#         '-c', 'color.branch=false',
#         '-c', 'status.displayCommentPrefix=true',
#         '-c', 'core.commentchar=#',
#     ]
# 
#     def git(self, cmd, *args, **kwargs):
#         return self.cmd(cmd, *args, **kwargs)
# 
#     def git_string(self, cmd, *args, **kwargs):
#         return self._string(cmd, *args, **kwargs)
# 
#     def git_lines(self, cmd, *args, **kwargs):
#         return self._lines(cmd, *args, **kwargs)
# 
#     def git_exit_code(self, cmd, *args, **kwargs):
#         return self._exit_code(cmd, *args, **kwargs)
# 
#     def git_async(self, cmd, *args, **kwargs):
#         return self.cmd_async(cmd, *args, **kwargs)


# Path: sgit/repo.py
import os
import sublime
from sublime_plugin import WindowCommand
from .util import noop, abbreviate_dir
from .cmd import GitCmd

        this:

        * Find the currently active file.

          * Is it a git view? Use that repository.
          * Is any of the parents a git repository? Use that.

        * If that fails, find the currently active window.

          * Find a list of all possible directories:

            * The directories of any open folders.
            * The directories of any open files.

          * Generate a list of all of the parents of these directories.
          * Check to see if any of the directories or their parents are
            git repositories.

        * Select a repository:

          * If there is only one repository then use that.
          * If there are more than one repository, present a list to
            choose from.
    """

    def run(self):
        repos = list(self.git_repos_from_window(self.window))
        choices = []
        for repo in repos:
            basename = os.path.basename(repo)

            repo_dir = abbreviate_dir(repo)