threads / patch / 8858

patchfilter-branch: make output nicer

Subject: [PATCH] filter-branch: make output nicer

## tl;dr

3 messages between Jul 4, 2007 and Jul 4, 2007. Diffs are folded; open one to read it.

replies: 2people: 1as markdown or json

Johannes Schindelin· Jul 4, 2007, 12:45 UTC · lore

Instead of filling the screen with progress lines, use \r so that the progress can be seen, but warning messages are more visible.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 git-filter-branch.sh |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
 mode change 100644 => 100755 git-filter-branch.sh
Show changes to git-filter-branch.sh +3 −3
diff --git a/git-filter-branch.sh b/git-filter-branch.sh
old mode 100644
new mode 100755
index 22fb5bf..e320379
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -160,7 +160,7 @@ test $commits -eq 0 && die "Found nothing to rewrite"
 i=0
 while read commit parents; do
 	i=$(($i+1))
-	printf "$commit ($i/$commits) "
+	printf "\rRewrite $commit ($i/$commits)"
 
 	case "$filter_subdir" in
 	"")
@@ -203,8 +203,8 @@ while read commit parents; do
 
 	sed -e '1,/^$/d' <../commit | \
 		eval "$filter_msg" | \
-		sh -c "$filter_commit" "git commit-tree" $(git write-tree) $parentstr | \
-		tee ../map/$commit
+		(sh -c "$filter_commit" "git commit-tree" $(git write-tree)
+			$parentstr) 2> /dev/null > ../map/$commit
 done <../revs
 
 src_head=$(tail -n 1 ../revs | sed -e 's/ .*//')
-- 
1.5.3.rc0.2646.g88600-dirty
Johannes Schindelin· Jul 4, 2007, 12:50 UTC · re: Johannes Schindelin · lore

Instead of filling the screen with progress lines, use \r so that the progress can be seen, but warning messages are more visible.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
	Oops. Forgot the last output line.
 git-filter-branch.sh |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
 mode change 100644 => 100755 git-filter-branch.sh
Show changes to git-filter-branch.sh +4 −4
diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index 22fb5bf..c9a64b0
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -160,7 +160,7 @@ test $commits -eq 0 && die "Found nothing to rewrite"
 i=0
 while read commit parents; do
 	i=$(($i+1))
-	printf "$commit ($i/$commits) "
+	printf "\rRewrite $commit ($i/$commits)"
 
 	case "$filter_subdir" in
 	"")
@@ -203,8 +203,8 @@ while read commit parents; do
 
 	sed -e '1,/^$/d' <../commit | \
 		eval "$filter_msg" | \
-		sh -c "$filter_commit" "git commit-tree" $(git write-tree) $parentstr | \
-		tee ../map/$commit
+		(sh -c "$filter_commit" "git commit-tree" $(git write-tree)
+			$parentstr) 2> /dev/null > ../map/$commit
 done <../revs
 
 src_head=$(tail -n 1 ../revs | sed -e 's/ .*//')
@@ -256,6 +256,6 @@ fi
 
 cd ../..
 rm -rf "$tempdir"
-echo "Rewritten history saved to the $dstbranch branch"
+printf "\nRewritten history saved to the $dstbranch branch\n"
 
 exit $ret
-- 
1.5.3.rc0.2646.g88600-dirty
Johannes Schindelin· Jul 4, 2007, 13:25 UTC · re: Johannes Schindelin · lore

Re: [PATCH] filter-branch: make output nicer

Hi,
On Wed, 4 Jul 2007, Johannes Schindelin wrote:
> -		sh -c "$filter_commit" "git commit-tree" $(git write-tree) $parentstr | \
> -		tee ../map/$commit
> +		(sh -c "$filter_commit" "git commit-tree" $(git write-tree)
> +			$parentstr) 2> /dev/null > ../map/$commit
Aargh! I seem to be unable to get anything right today. This should be

+ sh -c "$filter_commit" "git commit-tree" $(git write-tree) \ + $parentstr > ../map/$commit

Ah well. I think I play a little more with it, and resubmit the patch. Please ignore.

Ciao, Dscho

← back to recent threads