Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
justinfreeman (Agileware)
Core
Commits
8106195f
Commit
8106195f
authored
12 years ago
by
Tim Otten
Browse files
Options
Downloads
Plain Diff
Merge pull request #119 from totten/git-hooks-reponame
gitify - In hook stubs, set GIT_CANONICAL_REPO_NAME.
parents
4745d384
3e0f9f2e
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/gitify
+15
-12
15 additions, 12 deletions
bin/gitify
with
15 additions
and
12 deletions
bin/gitify
+
15
−
12
View file @
8106195f
...
...
@@ -33,16 +33,19 @@ function do_gitify() {
}
## add hook shims to a repo
## usage: do_hookify <repo-path> <relative-hook-path>
## usage: do_hookify
<canonical-repo-name>
<repo-path> <relative-hook-path>
function
do_hookify
()
{
TGT
=
"
$1
"
HOOK_DIR
=
"
$2
"
GIT_CANONICAL_REPO_NAME
=
"
$1
"
TGT
=
"
$2
"
HOOK_DIR
=
"
$3
"
if
[
-n
"
$CIVICRM_GIT_HOOKS
"
]
;
then
echo
"[[Install recommended hooks (
$TGT
)]]"
for
HOOK
in
commit-msg post-checkout post-merge pre-commit prepare-commit-msg post-commit pre-rebase post-rewrite
;
do
cat
<<
TMPL
> "
$TGT
/.git/hooks/
$HOOK
"
#!/bin/bash
if [ -f "
\$
GIT_DIR/
${
HOOK_DIR
}
/
${
HOOK
}
" ]; then
## Note: GIT_CANONICAL_REPO_NAME was not provided by early hook-stubs
export GIT_CANONICAL_REPO_NAME="
$GIT_CANONICAL_REPO_NAME
"
source "
\$
GIT_DIR/
${
HOOK_DIR
}
/
${
HOOK
}
"
fi
TMPL
...
...
@@ -140,33 +143,33 @@ fi
check_dep
do_gitify
"
${
GIT_BASE_URL
}
/civicrm-core.git"
"
$CIVICRM_ROOT
"
-b
"
${
CIVICRM_BRANCH
}
"
do_hookify
"
$CIVICRM_ROOT
"
"../tools/scripts/git"
do_hookify
civicrm-core
"
$CIVICRM_ROOT
"
"../tools/scripts/git"
do_gitify
"
${
GIT_BASE_URL
}
/civicrm-packages.git"
"
$CIVICRM_ROOT
/packages"
-b
"
${
CIVICRM_BRANCH
}
"
do_hookify
"
$CIVICRM_ROOT
/packages"
"../../tools/scripts/git"
do_hookify
civicrm-packages
"
$CIVICRM_ROOT
/packages"
"../../tools/scripts/git"
case
"
$CIVICRM_CMS
"
in
Drupal
)
do_gitify
"
${
GIT_BASE_URL
}
/civicrm-drupal.git"
"
$CIVICRM_ROOT
/drupal"
-b
"7.x-
${
CIVICRM_BRANCH
}
"
do_hookify
"
$CIVICRM_ROOT
/drupal"
"../../tools/scripts/git"
do_hookify
civicrm-drupal
"
$CIVICRM_ROOT
/drupal"
"../../tools/scripts/git"
;;
Drupal6
)
do_gitify
"
${
GIT_BASE_URL
}
/civicrm-drupal.git"
"
$CIVICRM_ROOT
/drupal"
-b
"6.x-
${
CIVICRM_BRANCH
}
"
do_hookify
"
$CIVICRM_ROOT
/drupal"
"../../tools/scripts/git"
do_hookify
civicrm-drupal
"
$CIVICRM_ROOT
/drupal"
"../../tools/scripts/git"
;;
Joomla
)
do_gitify
"
${
GIT_BASE_URL
}
/civicrm-joomla.git"
"
$CIVICRM_ROOT
/joomla"
-b
"
${
CIVICRM_BRANCH
}
"
do_hookify
"
$CIVICRM_ROOT
/joomla"
"../../tools/scripts/git"
do_hookify
civicrm-joomla
"
$CIVICRM_ROOT
/joomla"
"../../tools/scripts/git"
;;
WordPress
)
do_gitify
"
${
GIT_BASE_URL
}
/civicrm-wordpress.git"
"
$CIVICRM_ROOT
/WordPress"
-b
"
${
CIVICRM_BRANCH
}
"
do_hookify
"
$CIVICRM_ROOT
/WordPress"
"../../tools/scripts/git"
do_hookify
civicrm-wordpress
"
$CIVICRM_ROOT
/WordPress"
"../../tools/scripts/git"
;;
all
)
do_gitify
"
${
GIT_BASE_URL
}
/civicrm-drupal.git"
"
$CIVICRM_ROOT
/drupal"
-b
"7.x-
${
CIVICRM_BRANCH
}
"
do_hookify
"
$CIVICRM_ROOT
/drupal"
"../../tools/scripts/git"
do_hookify
civicrm-drupal
"
$CIVICRM_ROOT
/drupal"
"../../tools/scripts/git"
do_gitify
"
${
GIT_BASE_URL
}
/civicrm-joomla.git"
"
$CIVICRM_ROOT
/joomla"
-b
"
${
CIVICRM_BRANCH
}
"
do_hookify
"
$CIVICRM_ROOT
/joomla"
"../../tools/scripts/git"
do_hookify
civicrm-joomla
"
$CIVICRM_ROOT
/joomla"
"../../tools/scripts/git"
do_gitify
"
${
GIT_BASE_URL
}
/civicrm-wordpress.git"
"
$CIVICRM_ROOT
/WordPress"
-b
"
${
CIVICRM_BRANCH
}
"
do_hookify
"
$CIVICRM_ROOT
/WordPress"
"../../tools/scripts/git"
do_hookify
civicrm-wordpress
"
$CIVICRM_ROOT
/WordPress"
"../../tools/scripts/git"
;;
*
)
echo
"Unrecognized CMS:
$CIVICRM_CMS
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment