Loading Documents/bin/git-manage +1 −6 Original line number Diff line number Diff line Loading @@ -9,7 +9,6 @@ import sys import github3.exceptions # pylint: disable=import-error import gitlab.exceptions # pylint: disable=import-error import passhole.passhole # pylint: disable=import-error import sh # pylint: disable=import-error sys.path.append(os.path.expanduser("~/Documents/bin")) Loading Loading @@ -218,11 +217,7 @@ def create_github_repo(args): rcfiles.git.git.clone(repo.ssh_url) print("Cloned repository.", file=sys.stderr) with sh.pushd(repo.name): rcfiles.git.git.commit( "--allow-empty", "--only", "--message", "Initial empty commit." ) rcfiles.git.git.push("origin") rcfiles.git.empty_commit(repo.name) print( "Committed an initial empty commit.", file=sys.stderr, Loading Documents/bin/rcfiles/git.py +9 −0 Original line number Diff line number Diff line Loading @@ -67,3 +67,12 @@ def author_email(): if "GIT_AUTHOR_EMAil" in os.environ: return os.environ["GIT_AUTHOR_EMAIL"].strip() return git.config("--get", "user.email").strip() def empty_commit(repo): """Commits an empty commit and pushes.""" with sh.pushd(repo): git.commit( "--allow-empty", "--only", "--message", "Initial empty commit." ) git.push() Loading
Documents/bin/git-manage +1 −6 Original line number Diff line number Diff line Loading @@ -9,7 +9,6 @@ import sys import github3.exceptions # pylint: disable=import-error import gitlab.exceptions # pylint: disable=import-error import passhole.passhole # pylint: disable=import-error import sh # pylint: disable=import-error sys.path.append(os.path.expanduser("~/Documents/bin")) Loading Loading @@ -218,11 +217,7 @@ def create_github_repo(args): rcfiles.git.git.clone(repo.ssh_url) print("Cloned repository.", file=sys.stderr) with sh.pushd(repo.name): rcfiles.git.git.commit( "--allow-empty", "--only", "--message", "Initial empty commit." ) rcfiles.git.git.push("origin") rcfiles.git.empty_commit(repo.name) print( "Committed an initial empty commit.", file=sys.stderr, Loading
Documents/bin/rcfiles/git.py +9 −0 Original line number Diff line number Diff line Loading @@ -67,3 +67,12 @@ def author_email(): if "GIT_AUTHOR_EMAil" in os.environ: return os.environ["GIT_AUTHOR_EMAIL"].strip() return git.config("--get", "user.email").strip() def empty_commit(repo): """Commits an empty commit and pushes.""" with sh.pushd(repo): git.commit( "--allow-empty", "--only", "--message", "Initial empty commit." ) git.push()