File tree 10 files changed +24
-44
lines changed
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
12
12
SUBDIR=$( abspath " $dir " )
13
13
SUBDIR=$( echo $SUBDIR | sed s/$PROJ_RE //)
14
14
15
- repo=$( echo $( grep " url = " " $dir /.git/config" ) | \
15
+ repo=$( grep " url = " " $dir /.git/config" | \
16
16
sed ' s/.*url = //' | \
17
17
sed ' s/[email protected] :\([^\/]*\)\//git:\/\/github.com\/\1\//' )
18
18
Original file line number Diff line number Diff line change 3
3
# this script clones a repository, including all its remote branches
4
4
# Author: julianromera
5
5
6
- GIT=$( command -v git)
7
-
8
- if [ " $1 " = " " -o " $2 " = " " ]; then
6
+ if [[ -z " $1 " || -z " $2 " ]]; then
9
7
echo " use: $0 <git_repository_to_clone> <directory>"
10
8
exit 1
11
9
fi
12
10
13
- if [ " $GIT " = " " ]; then
14
- echo " No git command found. install it"
15
- fi
16
11
17
12
function clone {
18
13
19
- $GIT clone -q " $1 " " $2 "
20
- res=$?
21
-
14
+ git clone -q " $1 " " $2 "
22
15
cd " $2 "
23
16
24
- $GIT pull --all
17
+ git pull --all
25
18
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 " ;
28
21
done
29
22
}
30
23
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
set -e
3
3
4
- DIRS =" ."
4
+ dirs =" ."
5
5
if [[ " $1 " == --dir ]]; then
6
- shift 1
7
- DIRS=" $1 "
8
- shift 1
6
+ dirs=" $2 "
7
+ shift 2
9
8
fi
10
9
11
- exec find $DIRS \( -path ' */.git/config' -o \
10
+ exec find $dirs \( -path ' */.git/config' -o \
12
11
-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 | \
6
6
grep blob | \
7
7
sort -n -k 3 | \
8
8
tail -n40 | \
9
- while read -r hash type size; do
9
+ while read -r hash _type size; do
10
10
echo -n " -e s/$hash /$size /p " ;
11
11
done) | \
12
12
sort -n -k1
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ fire() {
49
49
done
50
50
51
51
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 "
53
53
done
54
54
55
55
printf " \n\nLeave building!\n"
Original file line number Diff line number Diff line change 1
1
#! /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 1
1
#! /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 12
12
13
13
# written by Dieter Plaetinck
14
14
15
- list=" $@ "
15
+ list=" $* "
16
16
[ -z " $list " ] && list=$( git remote)
17
17
ret=0
18
18
19
19
if [ -z " $( git branch) " ]
20
20
then
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 ]
22
22
then
23
23
echo " WARN: This repo doesn't contain any branch, but contains a bunch of files!" >&2
24
24
ls -Alh " $( git root) "
39
39
echo " WARN: At least one branch, but no remotes found! The content here might be unique!" >&2
40
40
ret=1
41
41
else
42
- if [ -n " $@ " ]
42
+ if [ -n " $* " ]
43
43
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) "
46
46
else
47
47
echo " INFO: working with all remotes: $list "
48
48
fi
86
86
IFS=$IFS_BACKUP
87
87
88
88
# Check tags
89
- out=$( git push --tags -n $remote 2>&1 )
89
+ out=$( git push --tags -n " $remote " 2>&1 )
90
90
if [ " $out " != ' Everything up-to-date' ];
91
91
then
92
92
echo -e " WARN: Some tags are not in $remote !\n$out " >&2
93
93
ret=1
94
94
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"
96
96
fi
97
97
done
98
98
122
122
fi
123
123
124
124
# Check stash
125
- if [ $( git stash list | wc -l) -gt 0 ];
125
+ if [ " $( git stash list | wc -l) " -gt 0 ];
126
126
then
127
127
echo " WARN: Dirty stash:" >&2
128
128
GIT_PAGER= git stash list >&2
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
3
if [[ $# -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"
5
5
exit 1
6
6
fi
7
7
You can’t perform that action at this time.
0 commit comments