File tree Expand file tree Collapse file tree 1 file changed +23
-4
lines changed Expand file tree Collapse file tree 1 file changed +23
-4
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- if [ ! $# == 1 ]; then
4
- echo " Usage: $0 author_name"
3
+ if [ ! $# == 2 ]; then
4
+ echo " Usage: $0 author_name output_root_directory "
5
5
exit 1
6
6
fi
7
7
8
8
author=$1
9
+ output=$2
9
10
end=" "
10
11
begin=" "
12
+ patchcount=1
13
+ rangecount=1
11
14
12
15
for O in $( git log --pretty=format:" %h" --author=" $author " ) ; do
13
16
if ! git log --pretty=format:" %h" --author=" $author " $O ^^..$O ^ --exit-code 1> /dev/null ; then
14
17
if [[ " $end " == " " ]]; then
15
18
end=$O
16
19
fi
17
20
begin=$O
21
+ (( rangecount++ ))
18
22
else
19
23
if [[ " $end " == " " ]]; then
20
- git format-patch $O ^..$O
24
+ tmp=$(( $patchcount - 1 ))
25
+ echo " Adding one patch to $tmp existing:"
26
+ git log $O ^..$O
27
+ echo " Please enter a subdirectory name for this patch:"
28
+ read subdir
29
+ mkdir -p $output /$subdir
30
+ git format-patch $O ^..$O -o$output /$subdir
31
+ (( patchcount++ ))
21
32
else
22
- git format-patch $begin ^^..$end
33
+ tmp=$(( $patchcount - 1 ))
34
+ echo " Adding $rangecount patches to $tmp existing."
35
+ git log $begin ^^..$end --oneline
36
+ echo " Please enter a subdirectory name for this patch:"
37
+ read subdir
38
+ mkdir -p $output /$subdir
39
+ git format-patch $begin ^^..$end -o$output /$subdir
23
40
end=" "
41
+ patchcount=$(( $patchcount + $rangecount ))
42
+ rangecount=1
24
43
fi
25
44
fi
26
45
done
You can’t perform that action at this time.
0 commit comments