From b8b0559c19eb97c45b644c732803225747903dc0 Mon Sep 17 00:00:00 2001
From: Tony Narlock <tony@git-pull.com>
Date: Sun, 5 Dec 2021 21:30:37 -0600
Subject: [PATCH 1/2] docs(readme): Note @shanahanjrs in our credits

For generously providing vcspull access to g on pypi.
---
 README.md | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/README.md b/README.md
index 27de241a..861ac081 100644
--- a/README.md
+++ b/README.md
@@ -119,6 +119,10 @@ $ vcspull "$HOME/code/*"
 
 <img src="https://raw.githubusercontent.com/vcs-python/vcspull/master/docs/_static/vcspull-demo.gif" class="align-center" style="width:45.0%" alt="image" />
 
+# Credits
+
+2021-12-05: Thanks to [John Shanahan](https://github.com/shanahanjrs) ([@_shanahanjrs](https://twitter.com/_shanahanjrs)) for giving vcspull use [g](https://pypi.org/project/g/)
+
 # Donations
 
 Your donations fund development of new features, testing and support.

From ceb3b1e1b9b64664273ac2b9ad6716770b6cddb0 Mon Sep 17 00:00:00 2001
From: Tony Narlock <tony@git-pull.com>
Date: Sun, 5 Dec 2021 22:04:20 -0600
Subject: [PATCH 2/2] pyproject: Add `g` script name

---
 g.py           | 23 +++++++++++++++++++++++
 pyproject.toml |  8 +++++---
 2 files changed, 28 insertions(+), 3 deletions(-)
 create mode 100755 g.py

diff --git a/g.py b/g.py
new file mode 100755
index 00000000..35cf196c
--- /dev/null
+++ b/g.py
@@ -0,0 +1,23 @@
+#!/usr/bin/env python
+
+import pathlib
+import subprocess
+import sys
+
+vcspath_registry = {".git": "git", ".svn": "svn", ".hg": "hg"}
+
+
+def find_repo_type(path):
+    for path in list(pathlib.Path(path).parents) + [pathlib.Path(path)]:
+        for p in path.iterdir():
+            if p.is_dir():
+                if p.name in vcspath_registry:
+                    return vcspath_registry[p.name]
+
+
+vcs_bin = find_repo_type(pathlib.Path.cwd())
+
+
+def run(cmd=vcs_bin, cmd_args=sys.argv[1:], *args, **kwargs):
+    proc = subprocess.Popen([cmd, *cmd_args])
+    proc.communicate()
diff --git a/pyproject.toml b/pyproject.toml
index 8e1694f8..d19af8d3 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -21,10 +21,11 @@ classifiers = [
   "Topic :: System :: Shells"
 ]
 packages = [
-    { include = "vcspull" }
+    { include = "vcspull" },
 ]
 include = [
-    { path = "tests", format = "sdist" }
+    { path = "tests", format = "sdist" },
+    { path = "g.py" }
 ]
 readme = 'README.md'
 keywords = ["vcspull", "git", "vcs", "json", "yaml"]
@@ -39,6 +40,7 @@ Changes = "https://github.com/vcs-python/vcspull/blob/master/CHANGES"
 
 [tool.poetry.scripts]
 vcspull = 'vcspull:cli.cli'
+g = 'g:run'
 
 [tool.poetry.dependencies]
 python = "^3.7"
@@ -82,5 +84,5 @@ format = ["black", "isort"]
 lint = ["flake8"]
 
 [build-system]
-requires = ["poetry_core>=1.0.0"]
+requires = ["poetry_core>=1.0.0", "setuptools>60"]
 build-backend = "poetry.core.masonry.api"