Last active
July 3, 2021 13:46
-
-
Save ronen-fr/3ccbd47834a7faddb299ca04041873bc to your computer and use it in GitHub Desktop.
a tool to remind me what directory I am using for what branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sample output for the short version (cephs3.sh): | |
| -- -- tmp/rf_sc -- -- -- diverged -- wip-ronenf-scrub-sched [887-0 us:1721-0] | |
| 6a6b4501235 osd/scrub: extracting scrub scheduling code from OSD.cc | |
| -- -- scr6 -- -- -- -- diverged -- wip-ronenf-cscrub-be [1538-0 us:1531-0] | |
| 6624e06cd2e osd/scrub: extracting scrub scheduling code from OSD.cc | |
| 9-May 13:14 build Ninja: 3-May 17:54 build/build.ninja | |
| -- -- scr5 -- -- -- -- up-to-date -- wip-ronenf-fmt-scrub [148-0 us:148-0] | |
| 522a649f5e5 core: switch fmtlib submodule to use main repository and latest version | |
| 14-Jun 16:29 build Ninja: 14-Jun 16:28 build/build.ninja | |
| -- -- master -- - -- -- diverged -- wip-ronenf-scrub-blocked [0-0 us:0-0] | |
| 4c526aa5418 osd: send the "blocked scrub" message to the cluster log | |
| -- -- cln_may -- -- -- behind -- master {{xx-rt-xx}} | |
| f4eba942f76 Merge pull request #41848 from xxhdx1985126/wip-errorator-parallel_for_each | |
| ******* irregular origin *********** | |
| -- -- fix_4 -- -- -- -- up-to-date -- wip-ronenf-scrub-sched [241-0 us:241-0] | |
| ea908ff840c osd/scrub: simplifying the scrub scheduling code | |
| 13-Jun 12:05 build Ninja: 13-Jun 11:33 build/build.ninja | |
| -- -- s2 -- -- -- -- -- up-to-date -- wip-ronenf-scrub-be2 [574-0 us:574-0] | |
| daf3970aef8 fixes - temp | |
| 16-Jun 17:27 build Ninja: 16-Jun 15:13 build/build.ninja | |
| -- -- scrub1 -- - -- -- detached -- HEAD [503-0 us:382-0] | |
| 36274af6eb7 14.2.20 | |
| ___ | |
| The long version shows previous branches in each directory: | |
| (3.7.2021: this is an updated version. The output shown is from cephsz.sh. | |
| Main changes: code improvements; clearer output.) | |
| ___ | |
| -- -- tmp/rf_sc -- -- -- diverged -- wip-ronenf-scrub-sched [1361-0 us:2195-0] | |
| 182dbf28497 osd/scrub: extracting scrub scheduling code from OSD.cc | |
| 3-Jul 11:36 build Ninja: 3-Jul 11:36 build/build.ninja | |
| - 1e01ddb3 {5 hours ago} wip-ronenf-scrub-sched | |
| - 8ace4e65 {6 weeks ago} master | |
| - 5093c6f3 {6 weeks ago} wip-ronenf-crimscrub-1 | |
| - deae09bb {8 weeks ago} 36274af6eb7f2a5055f2d53ad448f2694e9046a0 | |
| - d5b5a7fb {9 weeks ago} wip-ronenf-scrub-sched-tests | |
| -- -- scr6 -- -- -- -- diverged -- wip-ronenf-cscrub-be [2012-0 us:2005-0] | |
| 6624e06cd2e osd/scrub: extracting scrub scheduling code from OSD.cc | |
| 9-May 13:14 build Ninja: 3-May 17:54 build/build.ninja | |
| - 6624e06c {9 weeks ago} wip-ronenf-scrub-sched | |
| - 6624e06c {9 weeks ago} master | |
| - d5b5a7fb {9 weeks ago} wip-ronenf-stat-updates | |
| - a762ee25 {10 weeks ago} wip-ronenf-scrub-sched-tests | |
| - 31908920 {3 months ago} wip-ronenf-cscrub-class | |
| -- -- scr5 -- -- -- -- diverged -- wip-ronenf-fmt-scrub [622-0 us:622-0] | |
| 2fbbe1d5096 core: switch fmtlib submodule to use main repository and latest version | |
| 27-Jun 17:11 build Ninja: 27-Jun 17:11 build/build.ninja | |
| - b01591b7 {3 weeks ago} master | |
| - fb7175c8 {3 weeks ago} wip-ronenf-scrub-sched | |
| - c88d015d {6 weeks ago} wip-ronenf-crimscrub-2 | |
| - 27cffcc7 {9 weeks ago} wip-ronenf-crimscrub-1 | |
| - edc8f68e {6 months ago} wip-ronenf-scrub-interval | |
| -- -- master -- - -- -- diverged -- wip-ronenf-scrub-blocked [474-0 us:474-0] | |
| 951890a7daf osd: send the "blocked scrub" message to the cluster log | |
| 23-Jun 18:33 build Ninja: 23-Jun 18:33 build/build.ninja | |
| - efc5ba14 {2 weeks ago} master | |
| - 54d02f09 {2 weeks ago} b784b24a894afd9f86d26bc4bc2b669aa62f96d0 | |
| - b784b24a {5 weeks ago} wip-ronenf-cscrub-class | |
| - 2a30142d {5 weeks ago} wip-ronenf-repair-stat | |
| - 5093c6f3 {9 weeks ago} wip-seastore-xattr | |
| -- -- cln_may -- -- -- behind -- master {{xx-rt-xx}} | |
| f4eba942f76 Merge pull request #41848 from xxhdx1985126/wip-errorator-parallel_for_each | |
| ******* irregular origin *********** | |
| - 477b705f {2 weeks ago} afb9061ab4117f798c858c741efa6390e48ccf10 | |
| - afb9061a {2 months ago} master | |
| - 41fb5ff0 {2 months ago} wip-omap-bench-test | |
| - c82876e2 {7 months ago} c7676b494ef25f1677f919cf91bd572a82bb2f36 | |
| - ede99b59 {7 months ago} bc224488aa6141c88e74c848623ae8f78bb5fbee | |
| -- -- fix_4 -- -- -- -- diverged -- wip-ronenf-scrub-sched [715-0 us:715-0] | |
| ea908ff840c osd/scrub: simplifying the scrub scheduling code | |
| 24-Jun 11:49 build Ninja: 13-Jun 11:33 build/build.ninja | |
| - afc9cfc1 {3 weeks ago} master | |
| - 58712403 {3 weeks ago} wip-ronenf-cscrub-class | |
| - d5b5a7fb {5 weeks ago} wip-ronenf-scrub-sched-tests | |
| - 5d10b699 {10 weeks ago} wip-ronenf-map-hash | |
| - 5d10b699 {3 months ago} wip-ronenf-extra-scrub-assert | |
| -- -- s2 -- -- -- -- -- up-to-date -- wip-ronenf-scrub-be2 [1048-0 us:179-0] | |
| daf3970aef8 fixes - temp | |
| 16-Jun 17:27 build Ninja: 16-Jun 15:13 build/build.ninja | |
| - 61121f71 {5 weeks ago} wip-ronenf-scrub-sched-v3 | |
| - 54d02f09 {5 weeks ago} master | |
| - 67a2a4e7 {5 weeks ago} d09c87bf84233656c1d3c4e0e7f4566de780c326 | |
| - 67a2a4e7 {9 weeks ago} wip-rf-walkthru-comments | |
| - 9873237a {9 weeks ago} scrub_1 | |
| -- -- scrub1 -- - -- -- diverged -- wip-ronenf-scrub-sched [184-0 us:184-0] | |
| 107d12f0614 osd/scrub: extracting scrub scheduling code from OSD.cc | |
| - ea908ff8 {6 days ago} master | |
| - da5d094f {6 days ago} wip-ronenf-scrubs-config | |
| - da5d094f {9 days ago} wip-ronenf-50346 | |
| - 58712403 {10 days ago} 36274af6eb7f2a5055f2d53ad448f2694e9046a0 | |
| - 9c1614cc {4 weeks ago} wip-ronenf-extra-scrubs | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # collect all relevant directories. Currently - by hand | |
| uptodate="xxxxxxx" | |
| function clear_dirname() | |
| { | |
| echo $1 | sed 's=/home/rfriedma/=-- -- =' | sed 's=src/= =' | sed 's=/ceph= -- -- -- =' | awk -e '{printf "%s",substr($0,1,18);}' | |
| } | |
| function short_st() | |
| { | |
| cst=`git status -uno --ignore-submodules=all` | |
| echo $cst | grep -q 'up to date' && uptodate="up-to-date" | |
| echo $cst | grep -q 'behind' && uptodate="behind " | |
| echo $cst | grep -q 'detached' && uptodate="detached " | |
| echo $cst | grep -q 'diverged' && uptodate="diverged " | |
| } | |
| function refs_diff() | |
| { | |
| if git ls-remote --get-url origin | grep -q ronen && git ls-remote --get-url upstream | grep -q ceph; then | |
| df_m_om=`git rev-list --count master..origin/master | sed 's/ //'` | |
| df_om_m=`git rev-list --count origin/master..master | sed 's/ //'` | |
| df_um_om=`git rev-list --count upstream/master..origin/master | sed 's/ //'` | |
| df_om_um=`git rev-list --count origin/master..upstream/master` | |
| echo -n "[$df_m_om-$df_om_m us:$df_um_om-$df_om_um] " | awk -e '{printf "%s",substr($0,1,30);}' | |
| else | |
| echo -n "{{xx-rt-xx}} " | awk -e '{printf "%s",substr($0,1,30);}' | |
| fi | |
| } | |
| function oneceph() | |
| { | |
| d=$1 | |
| echo | |
| #echo '---------------------' | |
| #echo $d | |
| #echo | |
| cd $d | |
| # make into optional: | |
| git fetch > /dev/null 2>&1 | |
| #git --no-pager log -1 --format="%h %s" | |
| comt=`git --no-pager log -1 --format="%h %s"` | |
| branch=`git rev-parse --abbrev-ref HEAD` | |
| dirt="$(clear_dirname $d)" | |
| short_st | |
| echo "$dirt -- -- $uptodate -- $branch $(refs_diff)" | |
| echo " $comt" | |
| # make sure we have a "normal" origin/upstream setting | |
| git ls-remote --get-url origin | grep -q ronen || echo " ******* irregular origin ***********" | |
| if [ -e build ]; then | |
| ls -ld build | awk '{ printf "\t%s-%s %s %s",$7,$6,$8,$9; }' | |
| fi | |
| if [ -e build/build.ninja ]; then | |
| ls -ld build/build.ninja | awk '{ print " Ninja: " $7 "-" $6 " " $8 " " $9 }' | |
| else | |
| echo | |
| fi | |
| echo | |
| git log --date=relative --pretty=oneline -g | grep 'moving from' | cut -n -b1-8,46- | cut -d\ -f1,2,3,7 | grep -v master | sed -e 's/^/ /;4q' | |
| } | |
| ac="$HOME/tmp/rf_sc/ceph " | |
| ac1=" scr6 scr5 master cln_may fix_4 s2 scrub1 " | |
| for u in $ac1; do | |
| ac="$ac $HOME/src/$u/ceph" | |
| done | |
| for d in $ac; do | |
| oneceph $d | |
| done | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # collect all relevant directories. Currently - by hand | |
| uptodate="xxxxxxx" | |
| function clear_dirname() | |
| { | |
| echo $1 | sed 's=/home/rfriedma/=-- -- =' | sed 's=src/= =' | sed 's=/ceph= -- -- -- =' | awk -e '{printf "%s",substr($0,1,18);}' | |
| } | |
| function short_st() | |
| { | |
| cst=`git status -uno --ignore-submodules=all` | |
| echo $cst | grep -q 'up to date' && uptodate="up-to-date" | |
| echo $cst | grep -q 'behind' && uptodate="behind " | |
| echo $cst | grep -q 'detached' && uptodate="detached " | |
| echo $cst | grep -q 'diverged' && uptodate="diverged " | |
| } | |
| function refs_diff() | |
| { | |
| if git ls-remote --get-url origin | grep -q ronen && git ls-remote --get-url upstream | grep -q ceph; then | |
| df_m_om=`git rev-list --count master..origin/master | sed 's/ //'` | |
| df_om_m=`git rev-list --count origin/master..master | sed 's/ //'` | |
| df_um_om=`git rev-list --count upstream/master..origin/master | sed 's/ //'` | |
| df_om_um=`git rev-list --count origin/master..upstream/master` | |
| echo -n "[$df_m_om-$df_om_m us:$df_um_om-$df_om_um] " | awk -e '{printf "%s",substr($0,1,30);}' | |
| else | |
| echo -n "{{xx-rt-xx}} " | awk -e '{printf "%s",substr($0,1,30);}' | |
| fi | |
| } | |
| function oneceph() | |
| { | |
| d=$1 | |
| echo | |
| cd $d | |
| # make into optional: | |
| git fetch > /dev/null 2>&1 | |
| comt=`git --no-pager log -1 --format="%h %s"` | |
| branch=`git rev-parse --abbrev-ref HEAD` | |
| dirt="$(clear_dirname $d)" | |
| short_st | |
| echo "$dirt -- -- $uptodate -- $branch $(refs_diff)" | |
| echo " $comt" | |
| # make sure we have a "normal" origin/upstream setting | |
| git ls-remote --get-url origin | grep -q ronen || echo " ******* irregular origin ***********" | |
| if [ -e build ]; then | |
| ls -ld build | awk '{ printf "\t%s-%s %s %s",$7,$6,$8,$9; }' | |
| fi | |
| if [ -e build/build.ninja ]; then | |
| ls -ld build/build.ninja | awk '{ print " Ninja: " $7 "-" $6 " " $8 " " $9 }' | |
| else | |
| echo | |
| fi | |
| } | |
| ac="$HOME/tmp/rf_sc/ceph " | |
| ac1=" scr6 scr5 master cln_may fix_4 s2 scrub1 " | |
| for u in $ac1; do | |
| ac="$ac $HOME/src/$u/ceph" | |
| done | |
| for d in $ac; do | |
| oneceph $d | |
| done | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # collect all relevant directories. Currently - by hand | |
| uptodate="xxxxxxx" | |
| function clear_dirname() | |
| { | |
| echo $1 | sed 's=/home/rfriedma/=-- -- =' | sed 's=src/= =' | sed 's=/ceph= -- -- -- =' | awk -e '{printf "%s",substr($0,1,18);}' | |
| } | |
| function short_st() | |
| { | |
| cst=`git status -uno --ignore-submodules=all` | |
| echo $cst | grep -q 'up to date' && uptodate="up-to-date" | |
| echo $cst | grep -q 'behind' && uptodate="behind " | |
| echo $cst | grep -q 'detached' && uptodate="detached " | |
| echo $cst | grep -q 'diverged' && uptodate="diverged " | |
| } | |
| function refs_diff() | |
| { | |
| if git ls-remote --get-url origin | grep -q ronen && git ls-remote --get-url upstream | grep -q ceph; then | |
| df_m_om=`git rev-list --count master..origin/master | sed 's/ //'` | |
| df_om_m=`git rev-list --count origin/master..master | sed 's/ //'` | |
| df_um_om=`git rev-list --count upstream/master..origin/master | sed 's/ //'` | |
| df_om_um=`git rev-list --count origin/master..upstream/master` | |
| echo -n "[$df_m_om-$df_om_m us:$df_um_om-$df_om_um] " | awk -e '{printf "%s",substr($0,1,30);}' | |
| else | |
| echo -n "{{xx-rt-xx}} " | awk -e '{printf "%s",substr($0,1,30);}' | |
| fi | |
| } | |
| function old_branches() | |
| { | |
| git log --date=relative --pretty=oneline -g | awk -f <(cat - <<'EOD' | |
| BEGIN { br_count = 0; } | |
| /moving from/ { | |
| #print $0 | |
| br=$8 | |
| if (seen[$8]) { | |
| next; | |
| } | |
| seen[$8] = $NF | |
| if (br_count>4) { | |
| exit 0; | |
| } | |
| br_count=br_count+1 | |
| date_from = substr($0,match($0,"{.*}"),RLENGTH); | |
| printf "-\t%8.8s %-15.15s %s\n",substr($1,1,8),date_from,$8; | |
| } | |
| EOD | |
| ) | |
| } | |
| function oneceph() | |
| { | |
| d=$1 | |
| echo | |
| #echo '---------------------' | |
| #echo $d | |
| #echo | |
| cd $d | |
| # make into optional: | |
| git fetch > /dev/null 2>&1 | |
| #git --no-pager log -1 --format="%h %s" | |
| comt=`git --no-pager log -1 --format="%h %s"` | |
| branch=`git rev-parse --abbrev-ref HEAD` | |
| dirt="$(clear_dirname $d)" | |
| short_st | |
| echo "$dirt -- -- $uptodate -- $branch $(refs_diff)" | |
| echo " $comt" | |
| # make sure we have a "normal" origin/upstream setting | |
| git ls-remote --get-url origin | grep -q ronen || echo " ******* irregular origin ***********" | |
| if [ -e build ]; then | |
| ls -ld build | awk '{ printf "\n\t%s-%s %s %s",$7,$6,$8,$9; }' | |
| if [ -e build/build.ninja ]; then | |
| ls -ld build/build.ninja | awk '{ print " Ninja: " $7 "-" $6 " " $8 " " $9 }' | |
| fi | |
| fi | |
| echo | |
| #git log --date=relative --pretty=oneline -g | grep 'moving from' | cut -n -b1-8,46- | cut -d\ -f1,2,3,7 | grep -v master | sed -e 's/^/ /;4q' | |
| old_branches | |
| } | |
| ac="$HOME/tmp/rf_sc/ceph " | |
| ac1=" scr6 scr5 master cln_may fix_4 s2 scrub1 " | |
| for u in $ac1; do | |
| ac="$ac $HOME/src/$u/ceph" | |
| done | |
| for d in $ac; do | |
| oneceph $d | |
| done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment