File tree 5 files changed +75
-1
lines changed 5 files changed +75
-1
lines changed Original file line number Diff line number Diff line change @@ -6,5 +6,5 @@ license 'Apache 2.0'
6
6
summary ' module for installing git'
7
7
description ' module for installing git'
8
8
project_page ' https://github.com/puppetlabs/puppetlabs-git/'
9
-
9
+ dependency ' puppetlabs/vcsrepo '
10
10
Original file line number Diff line number Diff line change
1
+ #! bash
2
+ #
3
+ # bash completion support for Git subtree.
4
+ #
5
+ # To use this routine:
6
+ #
7
+ # 1) Make sure you have installed and configured the core Git completion script, which is required to make this script work;
8
+ # 2) Copy this file to somewhere (e.g. ~/.git-subtree-completion.sh);
9
+ # 3) Added the following line to your .bashrc:
10
+ # source ~/.git-subtree-completion.sh
11
+ #
12
+
13
+ _git_subtree ()
14
+ {
15
+ local cur=" ${COMP_WORDS[COMP_CWORD]} "
16
+
17
+ if [ $COMP_CWORD -eq 2 ]; then
18
+ __gitcomp " add merge pull push split"
19
+ return
20
+ elif [ $COMP_CWORD -eq 3 ]; then
21
+ __gitcomp " --prefix="
22
+ return
23
+ fi
24
+ __gitcomp " $( __git_remotes) "
25
+ }
Original file line number Diff line number Diff line change
1
+ # git_exec_path.rb
2
+ Facter . add ( 'git_exec_path' ) do
3
+ setcode 'git --exec-path 2>/dev/null'
4
+ end
Original file line number Diff line number Diff line change
1
+ # git_version
2
+ Facter . add ( 'git_version' ) do
3
+ setcode 'git --version 2>/dev/null'
4
+ end
Original file line number Diff line number Diff line change
1
+ # == Class: git::subtree
2
+ #
3
+ # Installs and configure git-subtree
4
+ #
5
+ class git::subtree {
6
+
7
+ Package[' git' ] -> Class[' git::subtree' ]
8
+
9
+ if (versioncmp(' 1.7.0' , $::git_version ) >= 0) {
10
+ fail ' git-subtree requires git 1.7 or later!'
11
+ }
12
+
13
+ if (versioncmp(' 1.7.11' , $::git_version ) >= 0) {
14
+ $source_dir = ' /usr/src/git-subtree'
15
+ vcsrepo { $source_dir:
16
+ ensure => present ,
17
+ source => ' http://github.com/apenwarr/git-subtree.git' ,
18
+ provider => ' git' ,
19
+ revision => ' 2793ee6ba' ,
20
+ }
21
+ } else {
22
+ $source_dir = ' /usr/share/doc/git-core/contrib/subtree'
23
+ }
24
+
25
+ exec { "/usr/bin/make prefix=/usr libexecdir=${::git_exec_path}" :
26
+ creates => " ${source_dir} /git-subtree" ,
27
+ cwd => $source_dir ,
28
+ }
29
+ ->
30
+ exec { "/usr/bin/make prefix=/usr libexecdir=${::git_exec_path} install" :
31
+ creates => " ${::git_exec_path} /git-subtree" ,
32
+ cwd => $source_dir ,
33
+ }
34
+
35
+ file { '/etc/bash_completion.d/git-subtree' :
36
+ ensure => file ,
37
+ source => ' puppet:///modules/git/subtree/bash_completion.sh' ,
38
+ mode => ' 0644' ,
39
+ }
40
+
41
+ }
You can’t perform that action at this time.
0 commit comments