Hmm... can't actually filter rev-list on the subdir name.
authorAvery Pennarun <apenwarr@gmail.com>
Fri, 24 Apr 2009 21:42:33 +0000 (17:42 -0400)
committerAvery Pennarun <apenwarr@gmail.com>
Fri, 24 Apr 2009 21:42:33 +0000 (17:42 -0400)
Otherwise we can't keep track of parent relationships.  Argh.

This change makes it "work", but we get a bunch of empty commits.

git-subtree.sh

index 7e1707ae2afadacc6706731423ab28f06aa9f9d6..1e1237f52006db612a4e69d1565672456bc07854 100755 (executable)
@@ -173,28 +173,31 @@ cmd_split()
        cache_setup || exit $?
        
        if [ -n "$onto" ]; then
-               echo "Reading history for $onto..."
+               echo "Reading history for --onto=$onto..."
                git rev-list $onto |
                while read rev; do
                        # the 'onto' history is already just the subdir, so
                        # any parent we find there can be used verbatim
+                       debug "  cache: $rev"
                        cache_set $rev $rev
                done
        fi
        
        unrevs="$(find_existing_splits "$dir" "$revs")"
        
-       git rev-list --reverse --parents $revs $unrevs -- "$dir" |
+       debug "git rev-list --reverse $revs $unrevs"
+       git rev-list --reverse --parents $revs $unrevsx |
        while read rev parents; do
-               exists=$(cache_get $rev)
-               newparents=$(cache_get $parents)
                debug
-               debug "Processing commit: $rev / $newparents"
-               
+               debug "Processing commit: $rev"
+               exists=$(cache_get $rev)
                if [ -n "$exists" ]; then
                        debug "  prior: $exists"
                        continue
                fi
+               debug "  parents: $parents"
+               newparents=$(cache_get $parents)
+               debug "  newparents: $newparents"
                
                git ls-tree $rev -- "$dir" |
                while read mode type tree name; do