Skip to contentSkip to conversation

tip improvements

PATCH New Uwe Kleine-König 1 participant 10 messages Dec 3, 2009 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

Hello,

I once more started to look into your tip scripts to see if I can use them for my work, too.

While looking I optimized a few things I noticed. Most things are trivial and untested.

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |
#4 lore raw

PATCH 3/9 tipbin/git-log-line: add comment about alternative

In reply to Uwe Kleine-König
---
 .tip/bin/git-log-line |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
.tip/bin/git-log-line +2 -0
index d92fd63..d16e998 100755
@@ -1,4 +1,6 @@
 #! /bin/sh
+# the same can be accomplish by executing once:
+# 	$ git config --global alias.log-line 'log --pretty=format:"%h: %s"'
 
 git log --pretty=format:"%h: %s" $@
 
Signature · 1 line
1.6.5.2
#8 lore raw

PATCH 7/9 tip-rm-next-tags: use git-tag -l instead of git-tag | grep

In reply to Uwe Kleine-König
---
 .tip/bin/tip-rm-next-tags |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
.tip/bin/tip-rm-next-tags +1 -1
index c8a0cb2..85026ba 100755
@@ -1,3 +1,3 @@
 #!/bin/bash
 
-git tag -d $(git tag  | grep ^next-20)
+git tag -d $(git tag -l next-20*)
Signature · 1 line
1.6.5.2
#9 lore raw

PATCH 8/9 tip-diff-origin: use git-diff instead of a tempfile and plain diff

---
 .tip/bin/tip-diff-origin |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
.tip/bin/tip-diff-origin +1 -3
index 465bf33..0108cdc 100755
@@ -1,5 +1,3 @@
 #! /bin/sh
 
-git show origin/master:$1 > .tmp
-diff -up $1 .tmp | less
-
+git diff -R origin/master -- "$1"
Signature · 1 line
1.6.5.2
#10 lore raw

PATCH 9/9 tip-tags: use git-tag -l instead of git-tag | grep

---
 .tip/bin/tip-tags |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
.tip/bin/tip-tags +1 -2
index 4bbcac3..08d119f 100755
@@ -1,4 +1,3 @@
 #!/bin/bash
 
-git tag | grep ^tip-history
-
+git tag -l tip-history*
Signature · 1 line
1.6.5.2
#7 lore raw

PATCH 6/9 tip-lib: let git-show find the sha1 of the interesting files

In reply to Uwe Kleine-König
---
 .tip/bin/tip-lib |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
.tip/bin/tip-lib +1 -2
index 1311d63..5078cee 100644
@@ -67,7 +67,6 @@ get_linux_next_branches() {
 get_auto_merged_topics() {
     for B in $@
     do
-	local TB=`git ls-tree tip -- .tip/auto-branches/$B | sed -e "s/.*blob //" -e "s/\ *.tip.*//"`
-	git show $TB | sed -e "s/#.*//" -e "/^ *$/d"
+	git show tip:.tip/auto-branches/$B | sed -e "s/#.*//" -e "/^ *$/d"
     done
 }
Signature · 1 line
1.6.5.2
#6 lore raw

PATCH 5/9 tip-lib: optimize get_auto_branches ...

In reply to Uwe Kleine-König

... and use it in get_all_auto_branches instead of coding it again

---
 .tip/bin/tip-lib |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
.tip/bin/tip-lib +2 -4
index 805c8e2..1311d63 100644
@@ -8,8 +8,7 @@ get_current_branch() {
 }
 
 get_auto_branches() {
-
-    git ls-tree  tip -- .tip/auto-branches/ | sed "s@.*tip/auto-branches/@@"
+    git ls-tree --name-only --full-name tip:.tip/auto-branches/
 }
 
 get_auto_branches_no_latest() {
@@ -19,8 +18,7 @@ get_auto_branches_no_latest() {
 
 get_all_auto_branches() {
 
-    AB=`git ls-tree  tip -- .tip/auto-branches/ | sed "s@.*tip/auto-branches/@@"`
-    for B in $AB
+    for B in $(get_auto_branches)
     do
 	echo $B
 	echo $B"-base"
Signature · 1 line
1.6.5.2
#2 lore raw

PATCH 1/9 tipbin/*: source tip-lib from $(dirname "$0") instead of ~/bin/tip/

In reply to Uwe Kleine-König
---
 .tip/bin/tip-backup              |    2 +-
 .tip/bin/tip-check-topic-version |    2 +-
 .tip/bin/tip-compare-remote      |    2 +-
 .tip/bin/tip-curr                |    2 +-
 .tip/bin/tip-ls-topics           |    2 +-
 .tip/bin/tip-wget                |    2 +-
 .tip/bin/tip-wget-series         |    2 +-
 .tip/bin/todo-merge-all          |    2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)
.tip/bin/tip-backup +1 -1
index 682d68d..b75022c 100755
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-. ~/bin/tip/tip-lib
+. $(dirname "$0")/tip-lib
 
 check_master
 
.tip/bin/tip-check-topic-version +1 -1
index 4dd216f..d841aad 100755
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-. ~/bin/tip/tip-lib
+. $(dirname "$0")/tip-lib
 
 BRANCH=$(get_current_branch)
 
.tip/bin/tip-compare-remote +1 -1
index 5aff1aa..b4ea246 100755
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-. ~/bin/tip/tip-lib
+. $(dirname "$0")/tip-lib
 
 HEADS=$(git ls-remote -h origin | sed 's/\t/:/')
 
.tip/bin/tip-curr +1 -1
index fa93e90..61cc3f6 100755
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-. ~/bin/tip/tip-lib
+. $(dirname "$0")/tip-lib
 
 echo "tip/"$(get_current_branch)" "$(git log -1 --pretty=format:"%h: %s")
 
.tip/bin/tip-ls-topics +1 -1
index c10b3a1..4bfa94a 100755
@@ -1,4 +1,4 @@
-. ~/bin/tip/tip-lib
+. $(dirname "$0")/tip-lib
 
 usage ()
 {
.tip/bin/tip-wget +1 -1
index 4741c74..b3bffd4 100755
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-#. ~/bin/tip/tip-lib
+#. $(dirname "$0")/tip-lib
 
 if [ $# != "1" ]; then
   echo 'usage: tip-wget <uri>'
.tip/bin/tip-wget-series +1 -1
index 56605c2..51104b1 100755
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-. ~/bin/tip/tip-lib
+. $(dirname "$0")/tip-lib
 
 if [ $# != "1" ]; then
   echo 'usage: tip-wget-series <uri>'
.tip/bin/todo-merge-all +1 -1
index 860c03f..b14322c 100755
@@ -1,4 +1,4 @@
-. ~/bin/tip/tip-lib
+. $(dirname "$0")/tip-lib
 
 echo -n "merging the following updated branches: "
 
Signature · 1 line
1.6.5.2
#5 lore raw

PATCH 4/9 tip-urgent-count: get rid of an unneeded subshell

In reply to Uwe Kleine-König
---
 .tip/bin/tip-urgent-count |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
.tip/bin/tip-urgent-count +1 -1
index 7252187..fd46933 100755
@@ -11,7 +11,7 @@ for N in $URGENT; do
 done
 
 echo "-------------------------"
-printf "%20s: %3d\n" "TOTAL" $(git log --pretty=oneline --no-merges $(echo $URGENT | sed 's/^/linus../g') | wc -l)
+printf "%20s: %3d\n" "TOTAL" $(git log --pretty=oneline --no-merges $URGENT ^linus | wc -l)
 
 echo
 
Signature · 1 line
1.6.5.2
#3 lore raw

PATCH 2/9 tipbin/*: add shebang lines

In reply to Uwe Kleine-König
---
 .tip/bin/__tip-pull-request            |    2 +-
 .tip/bin/git-log-line                  |    1 +
 .tip/bin/tip-automerge-all             |    1 +
 .tip/bin/tip-bin-tools-sync            |    1 +
 .tip/bin/tip-check-files-x86           |    1 +
 .tip/bin/tip-check-topic               |    2 +-
 .tip/bin/tip-check-topics-x86          |    1 +
 .tip/bin/tip-checkout                  |    1 +
 .tip/bin/tip-cherry-pick               |    1 +
 .tip/bin/tip-create-fixes-for-linus    |    1 +
 .tip/bin/tip-destroy-curr              |    1 +
 .tip/bin/tip-diff-origin               |    1 +
 .tip/bin/tip-dump-all                  |    1 +
 .tip/bin/tip-import-from-quilt         |    1 +
 .tip/bin/tip-list-all                  |    1 +
 .tip/bin/tip-log                       |    1 +
 .tip/bin/tip-log-histogram             |    1 +
 .tip/bin/tip-ls-topics                 |    2 ++
 .tip/bin/tip-mergetool                 |    1 +
 .tip/bin/tip-mergetool-reverse         |    1 +
 .tip/bin/tip-pending-curr              |    1 +
 .tip/bin/tip-pull-request              |    2 +-
 .tip/bin/tip-quilt-apply-edit          |    1 +
 .tip/bin/tip-remove-commit-from-series |    1 +
 .tip/bin/tip-rerere-erase              |    1 +
 .tip/bin/tip-rerere-find               |    1 +
 .tip/bin/tip-shortlog                  |    1 +
 .tip/bin/tip-show                      |    1 +
 .tip/bin/tip-tools-sync                |    1 +
 .tip/bin/tip-urgent                    |    1 +
 .tip/bin/tip-urgent-count              |    1 +
 .tip/bin/todo-apply                    |    2 ++
 .tip/bin/todo-apply-all                |    2 ++
 .tip/bin/todo-duplicates               |    1 +
 .tip/bin/todo-get                      |    1 +
 .tip/bin/todo-merge-all                |    2 ++
 36 files changed, 40 insertions(+), 3 deletions(-)
.tip/bin/__tip-pull-request +1 -1
index d86b97d..cd57055 100755
@@ -1,4 +1,4 @@
-
+#! /bin/sh
 
 if [ $# != "2" ]; then
         echo 'usage: __tip-pull-request <head-branch> <base-branch>'
.tip/bin/git-log-line +1 -0
index e52acad..d92fd63 100755
@@ -1,3 +1,4 @@
+#! /bin/sh
 
 git log --pretty=format:"%h: %s" $@
 
.tip/bin/tip-automerge-all +1 -0
index b723c0b..2ca3077 100755
@@ -1,3 +1,4 @@
+#! /bin/sh
 
 [ "$#" = "0" ] && {
   echo "available auto-branches:"
.tip/bin/tip-bin-tools-sync +1 -0
index 91c7674..fbb5dab 100755
@@ -1,3 +1,4 @@
+#! /bin/sh
 
 git checkout tip || { echo error1; exit -1; }
 git fetch origin
.tip/bin/tip-check-files-x86 +1 -0
index fd98339..3b7ae89 100755
@@ -1,3 +1,4 @@
+#! /bin/sh
 
 F=$(echo $* | cut -d' ' -f3-)
 #F=$*
.tip/bin/tip-check-topic +1 -1
index 293492a..81e3ef6 100755
@@ -1,4 +1,4 @@
-
+#! /bin/sh
 
 if [ $# -gt "2" ]; then
         echo 'usage: tip-check-topic <topic-refspec> [<base-refspec>]'
.tip/bin/tip-check-topics-x86 +1 -0
index d3018ac..327781a 100755
@@ -1,3 +1,4 @@
+#! /bin/sh
 
 for M in $(for N in $(git log linus..x86/core | grep 'Merge branch' | grep -v linus); do echo $N; done | grep \'x86/ | cut -d\' -f2 | tac); do tip-check-topic $M; done
 
.tip/bin/tip-checkout +1 -0
index 31880af..a138bb9 100755
@@ -1,3 +1,4 @@
+#! /bin/sh
 
 quilt top 2>/dev/null && { echo "quilt patches still applied!"; exit -1; }
 
.tip/bin/tip-cherry-pick +1 -0
index 37a9abe..58fde29 100755
@@ -1,3 +1,4 @@
+#! /bin/sh
 
 [ $# != 1 ] && { echo "usage: tip-cherry-pick <sha1>"; exit -1; }
 
.tip/bin/tip-create-fixes-for-linus +1 -0
index fecc84f..123b8fa 100755
@@ -1,3 +1,4 @@
+#! /bin/sh
 
 . $(dirname "$0")/tip-lib
 
.tip/bin/tip-destroy-curr +1 -0
index 5dc287c..c60e1f2 100755
@@ -1,3 +1,4 @@
+#! /bin/sh
 
 git branch | grep '^*' | grep -q '^* master$' ||
                             { echo "not on master branch!"; exit -1; }
.tip/bin/tip-diff-origin +1 -0
index 1e2690f..465bf33 100755
@@ -1,3 +1,4 @@
+#! /bin/sh
 
 git show origin/master:$1 > .tmp
 diff -up $1 .tmp | less
.tip/bin/tip-dump-all +1 -0
index 10cf328..80c95a8 100755
@@ -1,3 +1,4 @@
+#! /bin/sh
 
 for N in $(git branch | grep -vE ' master$| base$|for-linus' | cut -c3-); do
 
.tip/bin/tip-import-from-quilt +1 -0
index 7e11243..f965877 100755
@@ -1,3 +1,4 @@
+#! /bin/sh
 
 echo "checking branches ..."
 
.tip/bin/tip-list-all +1 -0
index e3520df..9998d2d 100755
@@ -1,3 +1,4 @@
+#! /bin/sh
 
 for N in `git branch -a | grep /devel`; do
   M=$(echo $N | sed 's/\/devel//g')
.tip/bin/tip-log +1 -0
index 0ecd7f7..6a6936b 100755
@@ -1,3 +1,4 @@
+#! /bin/sh
 
 for N in $(git branch | grep -vE ' master$| base$|for-linus|auto|linux-next|tmp' | cut -c3-); do
 
.tip/bin/tip-log-histogram +1 -0
index b001b49..0c4191d 100755
@@ -1,3 +1,4 @@
+#! /bin/sh
 
 echo core/softlockup-for-linus cpus4096-for-linus stackprotector-for-linus safe-poison-pointers-for-linus sched/for-linus > .2
 
.tip/bin/tip-ls-topics +2 -0
index 4bfa94a..1f044e3 100755
@@ -1,3 +1,5 @@
+#! /bin/sh
+
 . $(dirname "$0")/tip-lib
 
 usage ()
.tip/bin/tip-mergetool +1 -0
index 1fd7a7f..abc0548 100755
@@ -1,3 +1,4 @@
+#! /bin/sh
 
 [ "$#" = 0 ] && {
 #  NR=`git ls-files -u | wc -l`
.tip/bin/tip-mergetool-reverse +1 -0
index 4f3ddf8..faa3013 100755
@@ -1,3 +1,4 @@
+#! /bin/sh
 
 [ "$#" = 0 ] && {
 #  NR=`git ls-files -u | wc -l`
.tip/bin/tip-pending-curr +1 -0
index f8aa4d9..28cc0cf 100755
@@ -1,3 +1,4 @@
+#! /bin/sh
 
 git log-line linus.. $@
 
.tip/bin/tip-pull-request +1 -1
index 42a7711..047a42c 100755
@@ -1,4 +1,4 @@
-
+#! /bin/sh
 
 if [ $# -gt "1" ]; then
         echo 'usage: tip-pull-request <head-branch>'
.tip/bin/tip-quilt-apply-edit +1 -0
index e2f4a5e..44f7f80 100755
@@ -1,3 +1,4 @@
+#! /bin/sh
 
 git checkout . || { echo error; exit -1; }
 
.tip/bin/tip-remove-commit-from-series +1 -0
index 4652e29..6da6955 100755
@@ -1,3 +1,4 @@
+#! /bin/sh
 
 [ "$#" = "0" ] &&
      { echo "usage: tip-remove-commit-from-series <sha1>"; exit -1; }
.tip/bin/tip-rerere-erase +1 -0
index 2459f0b..8618cd7 100755
@@ -1,3 +1,4 @@
+#! /bin/sh
 
 usage() {
   echo 'usage: tip-rerere-erase <pathspec>'
.tip/bin/tip-rerere-find +1 -0
index 5f58e78..67de13d 100755
@@ -1,3 +1,4 @@
+#! /bin/sh
 
 usage() {
   echo 'usage: tip-rerere-find <pathspec>'
.tip/bin/tip-shortlog +1 -0
index 3057a47..acf66c9 100755
@@ -1,3 +1,4 @@
+#! /bin/sh
 
 git shortlog linus..$@ --no-merges
 
.tip/bin/tip-show +1 -0
index 84fe9ea..62c8fb2 100755
@@ -1,3 +1,4 @@
+#! /bin/sh
 
 . $(dirname "$0")/tip-lib
 
.tip/bin/tip-tools-sync +1 -0
index b2dab10..66a8ab8 100755
@@ -1,3 +1,4 @@
+#! /bin/sh
 
 git checkout tip || { echo error1; exit -1; }
 git fetch origin
.tip/bin/tip-urgent +1 -0
index 1f4265f..f26d377 100755
@@ -1,3 +1,4 @@
+#! /bin/sh
 
 git shortlog --no-merges \
  $(tip-topic-branches | grep urgent | grep -v undo | \
.tip/bin/tip-urgent-count +1 -0
index 58043ba..7252187 100755
@@ -1,3 +1,4 @@
+#! /bin/sh
 
 echo
 
.tip/bin/todo-apply +2 -0
index 88e5b48..06e82a5 100755
@@ -1,3 +1,5 @@
+#! /bin/sh
+
 todo-duplicates || exit -1
 
 tip-quilt-apply-edit
.tip/bin/todo-apply-all +2 -0
index 2be513f..5ddb4b3 100755
@@ -1,3 +1,5 @@
+#! /bin/sh
+
 todo-duplicates || exit -1
 
 tip-quilt-apply-edit --all
.tip/bin/todo-duplicates +1 -0
index 581b852..f5b2885 100755
@@ -1,3 +1,4 @@
+#! /bin/sh
 
 DUP=$( { quilt unapplied; quilt applied 2>/dev/null; } | sort | uniq -c | grep -v "^      1 " )
 
.tip/bin/todo-get +1 -0
index 3fe863b..31b0c16 100755
@@ -1,3 +1,4 @@
+#! /bin/sh
 
 [ -s ~/mail/todo ] || { echo 'no ~/mail/todo mbox'; exit -1; }
 
.tip/bin/todo-merge-all +2 -0
index b14322c..a364778 100755
@@ -1,3 +1,5 @@
+#! /bin/sh
+
 . $(dirname "$0")/tip-lib
 
 echo -n "merging the following updated branches: "
Signature · 1 line
1.6.5.2