# Path: gg/utils.py
# def error_out(msg, raise_abort=True):
#     click.echo(click.style(msg, fg="red"))
#     if raise_abort:
#         raise click.Abort
# 
# def info_out(msg):
#     click.echo(msg)
# 
# def success_out(msg):
#     click.echo(click.style(msg, fg="green"))
# 
# Path: gg/state.py
# def read(configfile):
#     with open(configfile, "r") as f:
#         return json.load(f)
# 
# def load_config(configfile, key):
#     # like read() but returning specifically the state for the current repo
#     key = f"{get_repo_name()}:_config:{key}"
#     return read(configfile)[key]
# 
# Path: gg/main.py
# DEFAULT_CONFIGFILE = os.path.expanduser("~/.gg.json")
# class Config:
#     def __init__(self):
# def cli(config, configfile, verbose):


import git
import click
from gg.utils import error_out, info_out, success_out
from gg.state import read, load_config
from gg.main import cli, pass_config
    except KeyError:
        push_to_origin = False

        try:
            repo.remotes[state["FORK_NAME"]]
        except IndexError:
            error_out("There is no remote called '{}'".format(state["FORK_NAME"]))

    origin_name = state.get("ORIGIN_NAME", "origin")
    destination = repo.remotes[origin_name if push_to_origin else state["FORK_NAME"]]
    if force:
        (pushed,) = destination.push(force=True)
        info_out(pushed.summary)
    else:
        (pushed,) = destination.push()
        # print("PUSHED...")
    # for enum_name in [
    #     "DELETED",
    #     "ERROR",
    #     "FAST_FORWARD",
    #     "NEW_HEAD",
    #     "NEW_TAG",
    #     "NO_MATCH",
    #     "REMOTE_FAILURE",
    # ]:
    #     print(
    #         f"{enum_name}?:", pushed.flags & getattr(git.remote.PushInfo, enum_name)
    #     )

    if pushed.flags & git.remote.PushInfo.FORCED_UPDATE:

# Path: gg/utils.py
# def error_out(msg, raise_abort=True):
#     click.echo(click.style(msg, fg="red"))
#     if raise_abort:
#         raise click.Abort
# 
# def info_out(msg):
#     click.echo(msg)
# 
# def success_out(msg):
#     click.echo(click.style(msg, fg="green"))
# 
# Path: gg/state.py
# def read(configfile):
#     with open(configfile, "r") as f:
#         return json.load(f)
# 
# def load_config(configfile, key):
#     # like read() but returning specifically the state for the current repo
#     key = f"{get_repo_name()}:_config:{key}"
#     return read(configfile)[key]
# 
# Path: gg/main.py
# DEFAULT_CONFIGFILE = os.path.expanduser("~/.gg.json")
# class Config:
#     def __init__(self):
# def cli(config, configfile, verbose):


# Path: gg/builtins/push/gg_push.py
import git
import click
from gg.utils import error_out, info_out, success_out
from gg.state import read, load_config
from gg.main import cli, pass_config

    except KeyError:
        push_to_origin = False

        try:
            repo.remotes[state["FORK_NAME"]]
        except IndexError:
            error_out("There is no remote called '{}'".format(state["FORK_NAME"]))

    origin_name = state.get("ORIGIN_NAME", "origin")
    destination = repo.remotes[origin_name if push_to_origin else state["FORK_NAME"]]
    if force:
        (pushed,) = destination.push(force=True)
        info_out(pushed.summary)
    else:
        (pushed,) = destination.push()
        # print("PUSHED...")
    # for enum_name in [
    #     "DELETED",
    #     "ERROR",
    #     "FAST_FORWARD",
    #     "NEW_HEAD",
    #     "NEW_TAG",
    #     "NO_MATCH",
    #     "REMOTE_FAILURE",
    # ]:
    #     print(
    #         f"{enum_name}?:", pushed.flags & getattr(git.remote.PushInfo, enum_name)
    #     )

    if pushed.flags & git.remote.PushInfo.FORCED_UPDATE:

        success_out(f"Successfully force pushed to {destination}")