contrib/subtree: Teach add to store repository & branch in .gittrees

The repository and branch of a subtree added with the add command is
stored in the .gittrees file.

Signed-off-by: Paul Campbell <pcampbell@kemitix.net>
contrib/subtree: Teach push and pull to use .gittrees for defaults

Look in the config file .gittrees for a default repository and
refspec or commit when they are not provided on the command line.

Uses the .gittrees config file in a similar way to how git-submodule
uses the .gitmodules file.

Signed-off-by: Paul Campbell <pcampbell@kemitix.net>
contrib/subtree: Parameters repository/branch for push/pull are optional

Signed-off-by: Paul Campbell <pcampbell@kemitix.net>
contrib/subtree: Add command from-submodule

Converts a git-submodule into a git-subtree.

Signed-off-by: Paul Campbell <pcampbell@kemitix.net>

Conflicts:
	.gitignore
	contrib/subtree/git-subtree.sh
	test.sh
contrib/subtree: Add commands pull_all and push_all

For each subtree listed in .gittrees perform a push or a pull.

Signed-off-by: Paul Campbell <pcampbell@kemitix.net>

Conflicts:
	contrib/subtree/git-subtree.sh
contrib/subtree: Rename commands push_all/pull_all to push-all/pull-all

Changing underscores to dashes (push_all -> push-all)

Signed-off-by: Paul Campbell <pcampbell@kemitix.net>

Conflicts:
	.gitignore
	contrib/subtree/git-subtree.sh
contrib/subtree: Add command diff

Fetches the remote repo as a temporary git-remote then uses
git-diff-tree to do comparison before removing the temporary
git-remote.

Signed-off-by: Paul Campbell <pcampbell@kemitix.net>

Conflicts:
	git-subtree.sh
contrib/subtree: Add command list

Lists subtrees from the .gittrees file.

Signed-off-by: Paul Campbell <pcampbell@kemitix.net>

Conflicts:
	git-subtree.sh
contrib/subtree: Add command prune

Removes entries in .gittrees where the subtree files are
no longer present on disk.

Signed-off-by: Paul Campbell <pcampbell@kemitix.net>

Conflicts:
	git-subtree.sh
contrib/subtree: Add prune command to OPTS_SPEC

Signed-off-by: Paul Campbell <pcampbell@kemitix.net>

Conflicts:
	git-subtree.sh
contrib/subtree: Teach from-submodule to add new subtree to .gittrees

Signed-off-by: Paul Campbell <pcampbell@kemitix.net>

Conflicts:
	git-subtree.sh
contrib/subtree: Document pull-all and push-all

Signed-off-by: Paul Campbell <pcampbell@kemitix.net>
contrib/subtree: Document from-submodule and prune commands

Signed-off-by: Paul Campbell <pcampbell@kemitix.net>
contrib/subtree: Add missing commands to SYNOPSIS

Add pull-all, push-all, from-submodule, prune and diff commands
to SYNOPSIS.

Add alternate parameter option for add command.

Use long-form option for specifying prefix.

Signed-off-by: Paul Campbell <pcampbell@kemitix.net>

Conflicts:
	contrib/subtree/git-subtree.txt
contrib/subtree: Document list command

Signed-off-by: Paul Campbell <pcampbell@kemitix.net>

Conflicts:
	git-subtree.sh
contrib/subtree: Fix order of case switches so default case is last

Signed-off-by: Paul Campbell <pcampbell@kemitix.net>