]> git.droids-corp.org - git-central.git/commitdiff
Make a create-stable-branch script. Easy.
authorStephen Haberman <stephen@exigencecorp.com>
Thu, 25 Sep 2008 05:57:48 +0000 (00:57 -0500)
committerStephen Haberman <stephen@exigencecorp.com>
Thu, 25 Sep 2008 05:57:48 +0000 (00:57 -0500)
Makes me wonder why all git repos don't just start with this empty directory
commit instead of the having people do the "you can't clone empty repositories
so make a dummy crap" dance.

Oh, well, I suppose it does encode my timestamp/user info/etc. Which probably
shouldn't be in every new repo git ever created. Okay, fair enough.

scripts/make-stable-branch [new file with mode: 0644]

diff --git a/scripts/make-stable-branch b/scripts/make-stable-branch
new file mode 100644 (file)
index 0000000..f5b4193
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# Make a root directory tree with no files in it
+config_tree_hash=$(git mktree <<FOO
+FOO)
+
+# Commit the root directory tree
+commit_hash=$(git commit-tree $config_tree_hash <<FOO
+Initial commit on stable branch.
+FOO)
+
+# Push the commit out to the gitconfig branch
+git update-ref refs/heads/stable "$commit_hash" 0000000000000000000000000000000000000000
+