[cig-commits] [commit] master: Make displayed repo URI configurable. (cf28933)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Wed Jun 4 12:49:53 PDT 2014
Repository : https://github.com/geodynamics/relax
On branch : master
Link : https://github.com/geodynamics/relax/compare/f824f9365a21ba8760de2e40f714706247f2a84e...5dc0660d5364cadb5bdb50a243c0bbbcfedad4e9
>---------------------------------------------------------------
commit cf289331ab85ef1f8b97495f6e5043878c8a7ea3
Author: Matthias Vallentin <vallentin at icir.org>
Date: Tue Apr 29 22:34:41 2014 -0700
Make displayed repo URI configurable.
>---------------------------------------------------------------
cf289331ab85ef1f8b97495f6e5043878c8a7ea3
config.yml.example | 2 ++
gitdub | 6 ++++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/config.yml.example b/config.yml.example
index b918369..045dabb 100644
--- a/config.yml.example
+++ b/config.yml.example
@@ -46,6 +46,8 @@ github:
- id: mavam/gitdub
to: [vallentin at icir.org]
subject: '[git/gitdub]'
+ # Optional customization of repository URI displayed in email body.
+ uri: ssh://git.gitdub.info/real-repo.git
# A wildcard entry that specifies settings for all repositories of a user or
# organization.
diff --git a/gitdub b/gitdub
index b872104..db81bbe 100755
--- a/gitdub
+++ b/gitdub
@@ -31,7 +31,8 @@ class GitNotifier
MAPPINGS = {
'from' => 'sender',
'to' => 'mailinglist',
- 'subject' => 'emailprefix'
+ 'subject' => 'emailprefix',
+ 'uri' => 'repouri'
}
public
@@ -88,7 +89,6 @@ class GitDub
url = push['repository']['url']
user = push['repository']['owner']['name']
repo = push['repository']['name']
- opts['repouri'] = url
opts['link'] = "#{url}/compare/#{push['before']}...#{push['after']}"
$logger.info("received push from #{user}/#{repo} for commits "\
"#{push['before'][0..5]}...#{push['after'][0..5]}")
@@ -112,6 +112,8 @@ class GitDub
end
end
+ opts = opts.merge({uri: entry['uri'] ? entry['uri'] : url})
+
state_file = File.join(dir, GitNotifier::STATE_FILE)
if @silent_init and not File.exists?(state_file)
$logger.info("configuring git-notifer for silent update")
More information about the CIG-COMMITS
mailing list