Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
criu
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhul
criu
Commits
9330ce17
Commit
9330ce17
authored
Jan 15, 2012
by
Cyrill Gorcunov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tools/commit-bot.sh
Signed-off-by:
Cyrill Gorcunov
<
gorcunov@openvz.org
>
parent
6babc5c1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
commit-bot.sh
tools/commit-bot.sh
+29
-0
No files found.
tools/commit-bot.sh
0 → 100755
View file @
9330ce17
#!/bin/sh
remote
=
"git://github.com/cyrillos/crtools.git"
id
=
$1
if
[
-z
"
$id
"
]
;
then
id
=
`
exec
git reflog
-n1
|
cut
-f1
-d
' '
`
branch
=
`
exec
git branch |
grep
'*'
|
cut
-f2
-d
' '
`
commitmsg
=
`
exec
git log
$branch
-p
--stat
-n1
$id
`
subject
=
`
exec
git log
$branch
--stat
-n1
$id
|
sed
-e
'5! D'
|
sed
-e
's/^\s*//g'
`
author
=
`
exec
git log
$branch
--stat
-n1
$id
|
grep
"Author"
|
sed
-e
's/Author\: //g'
`
else
branch
=
`
exec
git branch |
grep
'*'
|
cut
-f2
-d
' '
`
commitmsg
=
`
exec
git log
-p
--stat
-n1
$id
`
subject
=
`
exec
git log
--stat
-n1
$id
|
sed
-e
'5! D'
|
sed
-e
's/^\s*//g'
`
author
=
`
exec
git log
--stat
-n1
$id
|
grep
"Author"
|
sed
-e
's/Author\: //g'
`
fi
echo
"From: Cyrill Gorcunov <gorcunov@openvz.org>"
>
/tmp/crtools.bot
echo
"To:
$author
"
>>
/tmp/crtools.bot
echo
"Cc: xemul@parallels.com,avagin@openvz.org,gorcunov@openvz.org"
>>
/tmp/crtools.bot
echo
"Subject: [crtools-bot]
$subject
"
>>
/tmp/crtools.bot
echo
""
>>
/tmp/crtools.bot
echo
"The commit is pushed to
\"
$branch
\"
and will appear on
$remote
"
>>
/tmp/crtools.bot
echo
"------>"
>>
/tmp/crtools.bot
echo
"
$commitmsg
"
>>
/tmp/crtools.bot
exec cat
/tmp/crtools.bot | /usr/sbin/sendmail
-t
"
$author
"
#cat /tmp/crtools.bot
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment