-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsend-patchset.sh
More file actions
executable file
·37 lines (33 loc) · 1.06 KB
/
Copy pathsend-patchset.sh
File metadata and controls
executable file
·37 lines (33 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
clear
FILE="$1" #staging driver location eg: /driver/staging/dgnc
N="$2" #number of commits in the set
VERSION="$3"
TO="$(perl scripts/get_maintainer.pl --separator , --nokeywords --nogit --nogit-fallback --norolestats -f $FILE)"
ADD=", Jonathan Corbet <corbet@lwn.net>, Greg KH <gregkh@linuxfoundation.org>"
CC="Julia Lawall <julia.lawall@lip6.fr>, linux-doc@vger.kernel.org," #hard-code cc list for now
#CC=""
#CC="aishpant@gmail.com"
echo "To: $TO$ADD"
echo "CC: $CC"
LAST_COMMIT="$(git log -$N --format="%h" | sed -n 1p)"
FIRST_COMMIT="$(git log -$N --format="%h" | sed -n $N\p)"
COMMIT_RANGE="$FIRST_COMMIT^..$LAST_COMMIT"
echo "Revisions: $COMMIT_RANGE"
if [ -z "$VERSION" ]
then
SUBJECT="PATCH"
else
SUBJECT="PATCH v$VERSION"
fi
if [ "$N" = '1' ]
then
DRAFTS="$(git format-patch -o /tmp/ HEAD^ --subject-prefix="$SUBJECT" --cc="$CC" --to="$TO$ADD")"
else
DRAFTS="$(git format-patch -o /tmp/ -n --subject-prefix="$SUBJECT" --cover-letter --thread=shallow --cc="$CC" --to="$TO$ADD" $COMMIT_RANGE)"
fi
for DRAFT in $DRAFTS
do
echo $DRAFT
mutt -H $DRAFT
done