From 154e5546100e7141ce23903082528d7dab3d9c33 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Sat, 4 Jul 2020 22:09:21 -0700 Subject: [PATCH] Add a nogit command-line utility This captures the structure of the two basic commands: nogit clone nogit sync Along with "nogit help" for help on the above. There's no implementation for either command yet. Just the documentation so far. --- nogit | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100755 nogit diff --git a/nogit b/nogit new file mode 100755 index 0000000..c71b7ab --- /dev/null +++ b/nogit @@ -0,0 +1,89 @@ +#!/bin/bash + +usage_brief() +{ + echo "Usage: nogit " + echo "" + echo "Available commands are:" + echo "" + echo " nogit clone" + echo " nogit sync" + echo "" + echo "See 'nogit help' for more details" +} + +usage() +{ + echo "Usage: nogit " + echo "" + echo "Possible commands are described below:" + echo "" + echo "nogit clone " + echo "" + echo " Clone a nogit repository into the current directory." + echo " This differs from 'git clone' in that it will not create" + echo " a new top-level directory but will instead clone the" + echo " resulting files into the current directory (which may" + echo " already be a local git repository). The object store for" + echo " this newly-cloned repository will be a directory named" + echo " .nogit rather than .git." + echo "" + echo " The repository to be cloned should be a nogit repository" + echo " in the sense that its files are intended to be managed" + echo " according to nogit semantics. But other than that, the" + echo " repository to be cloned is an actual git repository." + echo "" + echo "nogit sync" + echo "" + echo " Synchronize local and remote changes" + echo "" + echo " For all files managed by a previously-cloned nogit repository" + echo " this command will:" + echo "" + echo " * Commit local changes (auto-generated commit message)" + echo "" + echo " * Pull down any new commits from the remote" + echo "" + echo " * Auto-merge local and remote (keeping both sides and" + echo " with an auto-generated commit message)" + echo "" + echo " * Push out any new commits generated locally" +} + +nogit_clone() +{ + echo "Internal error: 'nogit clone' not yet implemented" +} + +nogit_sync() +{ + echo "Internal error: 'nogit sync' not yet implemented" +} + +if [ $# -lt 1 ]; then + echo "Error: missing command name." >&2 + echo "" + usage_brief >&2 + exit 1 +fi + +cmd="$1" + +case "$cmd" in + clone) + nogit_clone + ;; + sync) + nogit_sync + ;; + help) + usage + exit 0 + ;; + *) + echo "Error: Unknown command: $cmd" >&2 + echo "" + usage_brief >&2 + exit 1 + ;; +esac -- 2.43.0