summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 34a82bd)
raw | patch | inline | side by side (parent: 34a82bd)
author | Avery Pennarun <apenwarr@gmail.com> | |
Sun, 26 Apr 2009 22:06:08 +0000 (18:06 -0400) | ||
committer | Avery Pennarun <apenwarr@gmail.com> | |
Sun, 26 Apr 2009 22:06:08 +0000 (18:06 -0400) |
Instead of debug messages, we print a progress counter to stderr.
git-subtree.sh | patch | blob | history |
diff --git a/git-subtree.sh b/git-subtree.sh
index e2e47f82ac9c86035d9ed9ab84a24e8bc7c7626e..39c377c173ac3e74006a2cfa2095f3692b557c9a 100755 (executable)
--- a/git-subtree.sh
+++ b/git-subtree.sh
--
h,help show the help
q quiet
+d show debug messages
prefix= the name of the subdir to split out
options for 'split'
annotate= add a prefix to commit message of new commits
require_work_tree
quiet=
+debug=
command=
onto=
rejoin=
annotate=
debug()
+{
+ if [ -n "$debug" ]; then
+ echo "$@" >&2
+ fi
+}
+
+say()
{
if [ -z "$quiet" ]; then
echo "$@" >&2
shift
case "$opt" in
-q) quiet=1 ;;
+ -d) debug=1 ;;
--annotate) annotate="$1"; shift ;;
--no-annotate) annotate= ;;
--prefix) prefix="$1"; shift ;;
# We can't restrict rev-list to only $dir here, because some of our
# parents have the $dir contents the root, and those won't match.
# (and rev-list --follow doesn't seem to solve this)
- git rev-list --reverse --parents $revs $unrevs |
+ grl='git rev-list --reverse --parents $revs $unrevs'
+ revmax=$(eval "$grl" | wc -l)
+ revcount=0
+ createcount=0
+ eval "$grl" |
while read rev parents; do
- debug
+ revcount=$(($revcount + 1))
+ say -n "$revcount/$revmax ($createcount)\r"
debug "Processing commit: $rev"
exists=$(cache_get $rev)
if [ -n "$exists" ]; then
debug " prior: $exists"
continue
fi
+ createcount=$(($createcount + 1))
debug " parents: $parents"
newparents=$(cache_get $parents)
debug " newparents: $newparents"