Skip to content

Commit dc7578c

Browse files
author
Marcus Sorensen
committed
Summary: Make prepare-commit-msg hook more compatible with operating systems
Detail: Was using sed -i, which breaks on Mac Signed-off-by: Marcus Sorensen <[email protected]> 1360170672 -0700
1 parent b28f3ad commit dc7578c

1 file changed

Lines changed: 10 additions & 12 deletions

File tree

tools/git/prepare-commit-msg

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,18 @@
5454

5555
run_generic_commit () {
5656
local file=$1
57+
SOB=$(git var GIT_AUTHOR_IDENT)
5758
cat <<EOF > $file
5859
################################# 80 chars #####################################
60+
Summary:
61+
Detail:
62+
63+
BUG-ID:
64+
Bugfix-for:
65+
Reviewed-by:
66+
Reported-by:
67+
Signed-off-by: ${SOB}
68+
################################# 80 chars #####################################
5969
# The following is an example of how to fill out the above form. Please limit
6070
# your formatting to 80 cols.
6171
#
@@ -71,18 +81,6 @@ cat <<EOF > $file
7181
#
7282
$ORIGINAL
7383
EOF
74-
75-
SOB=$(git var GIT_AUTHOR_IDENT)
76-
77-
sed -i "1s/^/################################# 80 chars #####################################\n\
78-
Summary: \n\n\
79-
Detail: \n\n\
80-
BUG-ID: \n\
81-
Bugfix-for: \n\
82-
Reviewed-by: \n\
83-
Reported-by: \n\
84-
Signed-off-by: ${SOB}\n\n/" $file
85-
8684
}
8785

8886
case "$2,$3" in

0 commit comments

Comments
 (0)