+#!/bin/bash
+
+usage_brief()
+{
+ echo "Usage: nogit <command>"
+ echo ""
+ echo "Available commands are:"
+ echo ""
+ echo " nogit clone"
+ echo " nogit sync"
+ echo ""
+ echo "See 'nogit help' for more details"
+}
+
+usage()
+{
+ echo "Usage: nogit <command>"
+ echo ""
+ echo "Possible commands are described below:"
+ echo ""
+ echo "nogit clone <command>"
+ 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