# Path: gg/main.py
# DEFAULT_CONFIGFILE = os.path.expanduser("~/.gg.json")
# class Config:
#     def __init__(self):
# def cli(config, configfile, verbose):
# 
# 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"))
# 
# def warning_out(msg):
#     click.echo(click.style(msg, fg="yellow"))


import datetime
import click
import git
from gg.main import cli, pass_config
from gg.utils import error_out, info_out, success_out, warning_out
    return [x.split()[-1] for x in output.splitlines() if x.strip()]


def print_list(heads, merged_names, cutoff=10):
    def wrap(head):
        commit = head.commit
        return {
            "head": head,
            "info": {"date": commit.committed_datetime, "message": commit.message},
        }

    def format_age(dt):
        # This `dt` is timezone aware. So cheat, so we don't need to figure out
        # our timezone is.
        delta = datetime.datetime.utcnow().timestamp() - dt.timestamp()
        return str(datetime.timedelta(seconds=delta))

    def format_msg(message):
        message = message.strip().replace("\n", "\\n")
        if len(message) > 80:
            return message[:76] + "…"
        return message

    wrapped = sorted(
        [wrap(head) for head in heads],
        key=lambda x: x["info"].get("date"),
        reverse=True,
    )

    for each in wrapped[:cutoff]:

# Path: gg/main.py
# DEFAULT_CONFIGFILE = os.path.expanduser("~/.gg.json")
# class Config:
#     def __init__(self):
# def cli(config, configfile, verbose):
# 
# 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"))
# 
# def warning_out(msg):
#     click.echo(click.style(msg, fg="yellow"))


# Path: gg/builtins/branches/gg_branches.py
import datetime
import click
import git
from gg.main import cli, pass_config
from gg.utils import error_out, info_out, success_out, warning_out

    return [x.split()[-1] for x in output.splitlines() if x.strip()]


def print_list(heads, merged_names, cutoff=10):
    def wrap(head):
        commit = head.commit
        return {
            "head": head,
            "info": {"date": commit.committed_datetime, "message": commit.message},
        }

    def format_age(dt):
        # This `dt` is timezone aware. So cheat, so we don't need to figure out
        # our timezone is.
        delta = datetime.datetime.utcnow().timestamp() - dt.timestamp()
        return str(datetime.timedelta(seconds=delta))

    def format_msg(message):
        message = message.strip().replace("\n", "\\n")
        if len(message) > 80:
            return message[:76] + "…"
        return message

    wrapped = sorted(
        [wrap(head) for head in heads],
        key=lambda x: x["info"].get("date"),
        reverse=True,
    )

    for each in wrapped[:cutoff]:

        info_out("".center(80, "-"))