git-subtree.txt: add another example.
[gitweb.git] / git-subtree.sh
index 0a5cafa77f1acb5e0cd507864a615a065b77f0d6..11cda9ea82b39c8e0a89bea3d5b6d25664743617 100755 (executable)
@@ -166,9 +166,9 @@ rev_is_descendant_of_branch()
        newrev="$1"
        branch="$2"
        branch_hash=$(git rev-parse $branch)
-       match=$(git rev-list $newrev | grep $branch_hash)
+       match=$(git rev-list -1 $branch_hash ^$newrev)
 
-       if [ -n "$match" ]; then
+       if [ -z "$match" ]; then
                return 0
        else
                return 1
@@ -317,7 +317,7 @@ rejoin_msg()
                commit_message="Split '$dir/' into commit '$latest_new'"
        fi
        cat <<-EOF
-               $message
+               $commit_message
                
                git-subtree-dir: $dir
                git-subtree-mainline: $latest_old
@@ -520,8 +520,7 @@ cmd_split()
        eval "$grl" |
        while read rev parents; do
                revcount=$(($revcount + 1))
-               say -n "$revcount/$revmax ($createcount)
-"
+               say -n "$revcount/$revmax ($createcount)\r"
                debug "Processing commit: $rev"
                exists=$(cache_get $rev)
                if [ -n "$exists" ]; then