File tree Expand file tree Collapse file tree 10 files changed +24
-44
lines changed Expand file tree Collapse file tree 10 files changed +24
-44
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ for dir in "$@"; do
1212 SUBDIR=$( abspath " $dir " )
1313 SUBDIR=$( echo $SUBDIR | sed s/$PROJ_RE //)
1414
15- repo=$( echo $( grep " url = " " $dir /.git/config" ) | \
15+ repo=$( grep " url = " " $dir /.git/config" | \
1616 sed ' s/.*url = //' | \
1717 sed ' s/git@github.com:\([^\/]*\)\//git:\/\/github.com\/\1\//' )
1818
Original file line number Diff line number Diff line change 33# this script clones a repository, including all its remote branches
44# Author: julianromera
55
6- GIT=$( command -v git)
7-
8- if [ " $1 " = " " -o " $2 " = " " ]; then
6+ if [[ -z " $1 " || -z " $2 " ]]; then
97 echo " use: $0 <git_repository_to_clone> <directory>"
108 exit 1
119fi
1210
13- if [ " $GIT " = " " ]; then
14- echo " No git command found. install it"
15- fi
1611
1712function clone {
1813
19- $GIT clone -q " $1 " " $2 "
20- res=$?
21-
14+ git clone -q " $1 " " $2 "
2215 cd " $2 "
2316
24- $GIT pull --all
17+ git pull --all
2518
26- for remote in $( $GIT branch -r | grep -v \> ) ; do
27- $GIT branch --track " ${remote# origin/ } " " $remote " ;
19+ for remote in $( git branch -r | grep -v \> ) ; do
20+ git branch --track " ${remote# origin/ } " " $remote " ;
2821 done
2922}
3023
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22set -e
33
4- DIRS =" ."
4+ dirs =" ."
55if [[ " $1 " == --dir ]]; then
6- shift 1
7- DIRS=" $1 "
8- shift 1
6+ dirs=" $2 "
7+ shift 2
98fi
109
11- exec find $DIRS \( -path ' */.git/config' -o \
10+ exec find $dirs \( -path ' */.git/config' -o \
1211 -regex ' .*/.git/.*/config' \) -type f -print0 \
13- | parallel -0 --bar -j0 --delay 1 -k " git --git-dir={//} $@ "
12+ | parallel -0 --bar -j0 --delay 1 -k " git --git-dir={//} $* "
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ git rev-list --all --objects | \
66 grep blob | \
77 sort -n -k 3 | \
88 tail -n40 | \
9- while read -r hash type size; do
9+ while read -r hash _type size; do
1010 echo -n " -e s/$hash /$size /p " ;
1111 done) | \
1212 sort -n -k1
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ fire() {
4949 done
5050
5151 for sha in $( git rev-list -g stash) ; do
52- git push origin " $sha " :refs/heads/" $( current_branch $initial_branch ) " -stash-" $sha "
52+ git push origin " $sha " :refs/heads/" $( current_branch " $initial_branch " ) " -stash-" $sha "
5353 done
5454
5555 printf " \n\nLeave building!\n"
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
2- git subtree pull --prefix $1 ext/$( basename $1 ) master --squash
2+ git subtree pull --prefix " $1 " " ext/$( basename " $1 " ) " master --squash
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
2- git subtree push --prefix $1 fork/$( basename $1 ) master
2+ git subtree push --prefix " $1 " " fork/$( basename " $1 " ) " master
Original file line number Diff line number Diff line change 1212
1313# written by Dieter Plaetinck
1414
15- list=" $@ "
15+ list=" $* "
1616[ -z " $list " ] && list=$( git remote)
1717ret=0
1818
1919if [ -z " $( git branch) " ]
2020then
21- if [ $( cd " $( git root) " && ls -Al | egrep -v " ^(.git|total)" | wc -l) -gt 0 ]
21+ if [ " $( cd " $( git root) " && ls -Al | grep -Ev " ^(.git|total)" | wc -l) " -gt 0 ]
2222 then
2323 echo " WARN: This repo doesn't contain any branch, but contains a bunch of files!" >&2
2424 ls -Alh " $( git root) "
3939 echo " WARN: At least one branch, but no remotes found! The content here might be unique!" >&2
4040 ret=1
4141else
42- if [ -n " $@ " ]
42+ if [ -n " $* " ]
4343 then
44- echo " INFO: working with remote(s): $@ "
45- echo " INFO: fyi, all remotes: " $( git remote)
44+ echo " INFO: working with remote(s): $* "
45+ echo " INFO: fyi, all remotes: $( git remote) "
4646 else
4747 echo " INFO: working with all remotes: $list "
4848 fi
8686 IFS=$IFS_BACKUP
8787
8888 # Check tags
89- out=$( git push --tags -n $remote 2>&1 )
89+ out=$( git push --tags -n " $remote " 2>&1 )
9090 if [ " $out " != ' Everything up-to-date' ];
9191 then
9292 echo -e " WARN: Some tags are not in $remote !\n$out " >&2
9393 ret=1
9494 else
95- echo " INFO: All tags (" $( git tag) " ) exist at $remote as well"
95+ echo " INFO: All tags ($( git tag) ) exist at $remote as well"
9696 fi
9797done
9898
122122fi
123123
124124# Check stash
125- if [ $( git stash list | wc -l) -gt 0 ];
125+ if [ " $( git stash list | wc -l) " -gt 0 ];
126126then
127127 echo " WARN: Dirty stash:" >&2
128128 GIT_PAGER= git stash list >&2
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
33if [[ $# -gt 2 ]] ; then
4- >&2 echo " Usage: $0 [fullname] [weekstart-weekend]\nExample : $0 \" John Doe\" MON-FRI"
4+ >&2 printf ' %s\n%s ' " Usage: $0 [fullname] [weekstart-weekend]" " Example : $0 \" John Doe\" MON-FRI"
55 exit 1
66fi
77
You can’t perform that action at this time.
0 commit comments