# Path: sgit/util.py
# def get_setting(key, default=None):
#     return get_settings().get(key, default)
# 
# 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 re
import logging
import webbrowser
import sublime
    from xml.etree import cElementTree as ET
    from xml.etree import ElementTree as ET
from sublime_plugin import WindowCommand
from .util import get_setting
from .cmd import GitCmd

        h1 = root.find(".//{http://www.w3.org/1999/xhtml}h1")
        p = root.find(".//{http://www.w3.org/1999/xhtml}p")

        if h1 is not None and p is not None:
            if h1.text and p.text:
                title = h1.text
                content = p.text

                if MANPAGE_RE.search(title):
                    # We are dealing with a manpage
                    title = MANPAGE_RE.sub('', title)
                    _, secondline = content.split('\n', 1)
                    text = secondline.strip().replace('\n', ' ')
                else:
                    text = content.replace('\n', ' ').strip()

        if len(text) > 100:
            text = text[:100]

        return [title, text]

    def format_plain(self, filename):
        basename = os.path.basename(filename)
        noext = basename[:-5]
        text = noext[4:] if noext.startswith('git-') else noext

        return text

    def get_doc_path(self):

# Path: sgit/util.py
# def get_setting(key, default=None):
#     return get_settings().get(key, default)
# 
# 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/help.py
import os
import re
import logging
import webbrowser
import sublime
    from xml.etree import cElementTree as ET
    from xml.etree import ElementTree as ET
from sublime_plugin import WindowCommand
from .util import get_setting
from .cmd import GitCmd


        h1 = root.find(".//{http://www.w3.org/1999/xhtml}h1")
        p = root.find(".//{http://www.w3.org/1999/xhtml}p")

        if h1 is not None and p is not None:
            if h1.text and p.text:
                title = h1.text
                content = p.text

                if MANPAGE_RE.search(title):
                    # We are dealing with a manpage
                    title = MANPAGE_RE.sub('', title)
                    _, secondline = content.split('\n', 1)
                    text = secondline.strip().replace('\n', ' ')
                else:
                    text = content.replace('\n', ' ').strip()

        if len(text) > 100:
            text = text[:100]

        return [title, text]

    def format_plain(self, filename):
        basename = os.path.basename(filename)
        noext = basename[:-5]
        text = noext[4:] if noext.startswith('git-') else noext

        return text

    def get_doc_path(self):

        git_html_path = get_setting('git_help_html_path', None)