tip improvements
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/ |
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -1,4 +1,3 @@ #!/bin/bash -git tag | grep ^tip-history - +git tag -l tip-history*
Signature · 1 line
1.6.5.2
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
@@ -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
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
@@ -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
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
@@ -1,6 +1,6 @@ #!/bin/bash -. ~/bin/tip/tip-lib +. $(dirname "$0")/tip-lib check_master
.tip/bin/tip-check-topic-version +1 -1
@@ -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
@@ -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
@@ -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
@@ -1,4 +1,4 @@ -. ~/bin/tip/tip-lib +. $(dirname "$0")/tip-lib usage () {
.tip/bin/tip-wget +1 -1
@@ -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
@@ -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
@@ -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
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
@@ -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
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
@@ -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
@@ -1,3 +1,4 @@ +#! /bin/sh git log --pretty=format:"%h: %s" $@
.tip/bin/tip-automerge-all +1 -0
@@ -1,3 +1,4 @@ +#! /bin/sh [ "$#" = "0" ] && { echo "available auto-branches:"
.tip/bin/tip-bin-tools-sync +1 -0
@@ -1,3 +1,4 @@ +#! /bin/sh git checkout tip || { echo error1; exit -1; } git fetch origin
.tip/bin/tip-check-files-x86 +1 -0
@@ -1,3 +1,4 @@ +#! /bin/sh F=$(echo $* | cut -d' ' -f3-) #F=$*
.tip/bin/tip-check-topic +1 -1
@@ -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
@@ -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
@@ -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
@@ -1,3 +1,4 @@ +#! /bin/sh [ $# != 1 ] && { echo "usage: tip-cherry-pick <sha1>"; exit -1; }
.tip/bin/tip-create-fixes-for-linus +1 -0
@@ -1,3 +1,4 @@ +#! /bin/sh . $(dirname "$0")/tip-lib
.tip/bin/tip-destroy-curr +1 -0
@@ -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
@@ -1,3 +1,4 @@ +#! /bin/sh git show origin/master:$1 > .tmp diff -up $1 .tmp | less
.tip/bin/tip-dump-all +1 -0
@@ -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
@@ -1,3 +1,4 @@ +#! /bin/sh echo "checking branches ..."
.tip/bin/tip-list-all +1 -0
@@ -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
@@ -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
@@ -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
@@ -1,3 +1,5 @@ +#! /bin/sh + . $(dirname "$0")/tip-lib usage ()
.tip/bin/tip-mergetool +1 -0
@@ -1,3 +1,4 @@ +#! /bin/sh [ "$#" = 0 ] && { # NR=`git ls-files -u | wc -l`
.tip/bin/tip-mergetool-reverse +1 -0
@@ -1,3 +1,4 @@ +#! /bin/sh [ "$#" = 0 ] && { # NR=`git ls-files -u | wc -l`
.tip/bin/tip-pending-curr +1 -0
@@ -1,3 +1,4 @@ +#! /bin/sh git log-line linus.. $@
.tip/bin/tip-pull-request +1 -1
@@ -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
@@ -1,3 +1,4 @@ +#! /bin/sh git checkout . || { echo error; exit -1; }
.tip/bin/tip-remove-commit-from-series +1 -0
@@ -1,3 +1,4 @@ +#! /bin/sh [ "$#" = "0" ] && { echo "usage: tip-remove-commit-from-series <sha1>"; exit -1; }
.tip/bin/tip-rerere-erase +1 -0
@@ -1,3 +1,4 @@ +#! /bin/sh usage() { echo 'usage: tip-rerere-erase <pathspec>'
.tip/bin/tip-rerere-find +1 -0
@@ -1,3 +1,4 @@ +#! /bin/sh usage() { echo 'usage: tip-rerere-find <pathspec>'
.tip/bin/tip-shortlog +1 -0
@@ -1,3 +1,4 @@ +#! /bin/sh git shortlog linus..$@ --no-merges
.tip/bin/tip-show +1 -0
@@ -1,3 +1,4 @@ +#! /bin/sh . $(dirname "$0")/tip-lib
.tip/bin/tip-tools-sync +1 -0
@@ -1,3 +1,4 @@ +#! /bin/sh git checkout tip || { echo error1; exit -1; } git fetch origin
.tip/bin/tip-urgent +1 -0
@@ -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
@@ -1,3 +1,4 @@ +#! /bin/sh echo
.tip/bin/todo-apply +2 -0
@@ -1,3 +1,5 @@ +#! /bin/sh + todo-duplicates || exit -1 tip-quilt-apply-edit
.tip/bin/todo-apply-all +2 -0
@@ -1,3 +1,5 @@ +#! /bin/sh + todo-duplicates || exit -1 tip-quilt-apply-edit --all
.tip/bin/todo-duplicates +1 -0
@@ -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
@@ -1,3 +1,4 @@ +#! /bin/sh [ -s ~/mail/todo ] || { echo 'no ~/mail/todo mbox'; exit -1; }
.tip/bin/todo-merge-all +2 -0
@@ -1,3 +1,5 @@ +#! /bin/sh + . $(dirname "$0")/tip-lib echo -n "merging the following updated branches: "
Signature · 1 line
1.6.5.2