# Path: jirafs/utils.py
# def convert_to_boolean(string):
# def stash_local_changes(repo):
# def get_user_input(message, options=None, boolean=False, password=False):
# def run_command_method_with_kwargs(command, method=None, **kwargs):
# def get_installed_commands():
# def get_installed_plugins(subclass=Plugin):
# def get_config_path(filename):
# def get_config(additional_configs=None, include_global=True):
# def set_global_config_value(section, key, value):
# def get_default_jira_server(config=None):
# def get_jira(domain=None, config=None):
#     def get_section(config, domain):
# def get_git_version():
# def lazy_get_jira():
# def format_date(folder, date):
# def find_files_referenced_in_markup(markup: str) -> Dict[str, Tuple[str, int, int]]:
# def get_comment_author_display(comment: Comment) -> Optional[str]:
# 
# Path: jirafs/exceptions.py
# class GitCommandError(JirafsError):
#     def __init__(self, *args, **kwargs):
#         self._command = kwargs.pop("cmd", None)
#         self._returncode = kwargs.pop("returncode", None)
#         self._output = kwargs.pop("stdout", None)
# 
#         super(GitCommandError, self).__init__(*args, **kwargs)
# 
#     @property
#     def command(self):
#         return self._command
# 
#     @property
#     def returncode(self):
#         return self._returncode
# 
#     @property
#     def output(self):
#         return self._output


import json
import os
import shutil
import subprocess
from urllib import parse
from . import utils
from .exceptions import GitCommandError
    repo.run_git_command("commit", "-m", "Completing migration_0010", failure_ok=True)
    set_repo_version(repo, 10)


def migration_0011(repo, init=False, **kwargs):
    """Re-clone shadow copy so it does not reference an absolute path.

    .. note::

       The amount of stumbling I've engaged in in managing this shadow
       copy has been terribly embarassing.  Who knew it was so complicated.

       The TLDR is that you *cannot* use `shared` if you ever want the folder
       to be portable, since it'll write an absolute path to the repository
       in your `.jirafs/shadow/.git/objects/info/alternates` file.

    """
    if init:
        set_repo_version(repo, 11)
        return

    shutil.rmtree(repo.get_metadata_path("shadow"))
    os.mkdir(repo.get_metadata_path("shadow"))
    subprocess.check_call(
        ("git", "clone", "-q", "../git", "."),
        cwd=repo.get_metadata_path("shadow"),
        stdout=subprocess.PIPE,
    )
    try:
        repo.run_git_command("checkout", "-b", "jira", shadow=True)

# Path: jirafs/utils.py
# def convert_to_boolean(string):
# def stash_local_changes(repo):
# def get_user_input(message, options=None, boolean=False, password=False):
# def run_command_method_with_kwargs(command, method=None, **kwargs):
# def get_installed_commands():
# def get_installed_plugins(subclass=Plugin):
# def get_config_path(filename):
# def get_config(additional_configs=None, include_global=True):
# def set_global_config_value(section, key, value):
# def get_default_jira_server(config=None):
# def get_jira(domain=None, config=None):
#     def get_section(config, domain):
# def get_git_version():
# def lazy_get_jira():
# def format_date(folder, date):
# def find_files_referenced_in_markup(markup: str) -> Dict[str, Tuple[str, int, int]]:
# def get_comment_author_display(comment: Comment) -> Optional[str]:
# 
# Path: jirafs/exceptions.py
# class GitCommandError(JirafsError):
#     def __init__(self, *args, **kwargs):
#         self._command = kwargs.pop("cmd", None)
#         self._returncode = kwargs.pop("returncode", None)
#         self._output = kwargs.pop("stdout", None)
# 
#         super(GitCommandError, self).__init__(*args, **kwargs)
# 
#     @property
#     def command(self):
#         return self._command
# 
#     @property
#     def returncode(self):
#         return self._returncode
# 
#     @property
#     def output(self):
#         return self._output


# Path: jirafs/migrations.py
import json
import os
import shutil
import subprocess
from urllib import parse
from . import utils
from .exceptions import GitCommandError

    repo.run_git_command("commit", "-m", "Completing migration_0010", failure_ok=True)
    set_repo_version(repo, 10)


def migration_0011(repo, init=False, **kwargs):
    """Re-clone shadow copy so it does not reference an absolute path.

    .. note::

       The amount of stumbling I've engaged in in managing this shadow
       copy has been terribly embarassing.  Who knew it was so complicated.

       The TLDR is that you *cannot* use `shared` if you ever want the folder
       to be portable, since it'll write an absolute path to the repository
       in your `.jirafs/shadow/.git/objects/info/alternates` file.

    """
    if init:
        set_repo_version(repo, 11)
        return

    shutil.rmtree(repo.get_metadata_path("shadow"))
    os.mkdir(repo.get_metadata_path("shadow"))
    subprocess.check_call(
        ("git", "clone", "-q", "../git", "."),
        cwd=repo.get_metadata_path("shadow"),
        stdout=subprocess.PIPE,
    )
    try:
        repo.run_git_command("checkout", "-b", "jira", shadow=True)

    except GitCommandError: