# Path: gg/utils.py
# def get_repo_name():
#     repo = get_repo()
#     return os.path.basename(repo.working_dir)


import datetime
import json
from .utils import get_repo_name
    repo_name = get_repo_name()
    key = f"{repo_name}:{branch_name}"
    new = {key: extra}
    new[key].update(
        {"description": description, "date": datetime.datetime.now().isoformat()}
    )
    update(configfile, new)


def load(configfile, branch_name):
    # like read() but returning specifically the state for the current repo
    key = f"{get_repo_name()}:{branch_name}"
    return read(configfile)[key]


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]


def update(configfile, data):
    state = read(configfile)
    state.update(data)
    write(configfile, state)


def update_config(configfile, **kwargs):
    state = read(configfile)
    for key, value in kwargs.items():

# Path: gg/utils.py
# def get_repo_name():
#     repo = get_repo()
#     return os.path.basename(repo.working_dir)


# Path: gg/state.py
import datetime
import json
from .utils import get_repo_name

    repo_name = get_repo_name()
    key = f"{repo_name}:{branch_name}"
    new = {key: extra}
    new[key].update(
        {"description": description, "date": datetime.datetime.now().isoformat()}
    )
    update(configfile, new)


def load(configfile, branch_name):
    # like read() but returning specifically the state for the current repo
    key = f"{get_repo_name()}:{branch_name}"
    return read(configfile)[key]


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]


def update(configfile, data):
    state = read(configfile)
    state.update(data)
    write(configfile, state)


def update_config(configfile, **kwargs):
    state = read(configfile)
    for key, value in kwargs.items():

        state[f"{get_repo_name()}:_config:{key}"] = value