summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6f4f84f)
raw | patch | inline | side by side (parent: 6f4f84f)
author | Jesse Greenwald <jesse.greenwald@gmail.com> | |
Wed, 10 Nov 2010 04:18:36 +0000 (22:18 -0600) | ||
committer | Avery Pennarun <apenwarr@gmail.com> | |
Wed, 10 Nov 2010 05:20:48 +0000 (21:20 -0800) |
With debug messages enabled, "incorrect order" will be output whenever a
commit is processed before its parents have been processed. This can be
determined by checking to see if a parent isn't mapped to a new commit, but
it has been processed.
commit is processed before its parents have been processed. This can be
determined by checking to see if a parent isn't mapped to a new commit, but
it has been processed.
git-subtree.sh | patch | blob | history |
diff --git a/git-subtree.sh b/git-subtree.sh
index 390c0fc57499bb434eee4ac747119fb01f8d9d30..cf50de150cf4796eea87bfb6341bb3ddc1372535 100755 (executable)
--- a/git-subtree.sh
+++ b/git-subtree.sh
cachedir="$GIT_DIR/subtree-cache/$$"
rm -rf "$cachedir" || die "Can't delete old cachedir: $cachedir"
mkdir -p "$cachedir" || die "Can't create new cachedir: $cachedir"
+ mkdir -p "$cachedir/notree" || die "Can't create new cachedir: $cachedir/notree"
debug "Using cachedir: $cachedir" >&2
}
done
}
+cache_miss()
+{
+ for oldrev in $*; do
+ if [ ! -r "$cachedir/$oldrev" ]; then
+ echo $oldrev
+ fi
+ done
+}
+
+check_parents()
+{
+ missed=$(cache_miss $*)
+ for miss in $missed; do
+ if [ ! -r "$cachedir/notree/$miss" ]; then
+ debug " incorrect order: $miss"
+ fi
+ done
+}
+
+set_notree()
+{
+ echo "1" > "$cachedir/notree/$1"
+}
+
cache_set()
{
oldrev="$1"
tree=$(subtree_for_commit $rev "$dir")
debug " tree is: $tree"
+
+ check_parents $parents
# ugly. is there no better way to tell if this is a subtree
# vs. a mainline commit? Does it matter?
if [ -z $tree ]; then
+ set_notree $rev
if [ -n "$newparents" ]; then
cache_set $rev $rev
fi