From 867299c3d947df5fc33c791f33ccb44c150ca70f Mon Sep 17 00:00:00 2001 From: Alexander Krasnukhin Date: Sat, 17 Nov 2012 01:41:59 +0100 Subject: [PATCH 1/3] Update bin/git-count Use git-rev-list and builtin --count option $ time git log --oneline | wc -l 30613 real 0m0.858s user 0m0.684s sys 0m0.239s $ time git rev-list --count HEAD 30613 real 0m0.416s user 0m0.396s sys 0m0.018s --- bin/git-count | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/git-count b/bin/git-count index 4ebd3d4..d77f51d 100755 --- a/bin/git-count +++ b/bin/git-count @@ -5,4 +5,4 @@ if test "$1" = "--all"; then echo fi -echo total `git log --oneline | wc -l` +echo total `git rev-list --count HEAD` From 2c346d256aa9804270a89c5aed0d4ba729537d1d Mon Sep 17 00:00:00 2001 From: Alexander Krasnukhin Date: Sat, 17 Nov 2012 13:17:19 +0100 Subject: [PATCH 2/3] Update bit/git-count Matching "):" in the end can match commit subjects by mistake i.e. if commit subject ends with "):" too (e.g. linux project has one such commit). To avoid this and any similar problems print summary only (-s). Restructure output to look exactly as it was before with awk. --- bin/git-count | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/git-count b/bin/git-count index d77f51d..a9bd148 100755 --- a/bin/git-count +++ b/bin/git-count @@ -1,7 +1,7 @@ #!/bin/sh if test "$1" = "--all"; then - git shortlog -n $@ | grep "):$" | sed 's|:||' + git shortlog -n -s $@ | awk '{print substr($0,index($0,$2)) " (" $1 ")"}' echo fi From 670f5317176241053c06f550de95f29a2ddfb788 Mon Sep 17 00:00:00 2001 From: Alexander Krasnukhin Date: Sun, 18 Nov 2012 03:36:20 +0100 Subject: [PATCH 3/3] Delete branch on origin even if it wasn't locally fetched yet. fix #144 --- bin/git-delete-branch | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/git-delete-branch b/bin/git-delete-branch index ec0070e..bde6fdc 100755 --- a/bin/git-delete-branch +++ b/bin/git-delete-branch @@ -3,4 +3,5 @@ branch=$1 test -z $branch && echo "branch required." 1>&2 && exit 1 git branch -D $branch -git branch -d -r origin/$branch && git push origin :$branch +git branch -d -r origin/$branch +git push origin :$branch