Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OHR Support
Manage
Activity
Members
Labels
Plan
Issues
97
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
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
Projects
OHR Support
Commits
611889f3
Commit
611889f3
authored
13 years ago
by
Holger Just
Browse files
Options
Downloads
Patches
Plain Diff
[#748] Use SCM commands to detect the revision
parent
b2998c39
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/chili_project/version.rb
+8
-1
8 additions, 1 deletion
lib/chili_project/version.rb
lib/redmine/scm/adapters/git_adapter.rb
+2
-2
2 additions, 2 deletions
lib/redmine/scm/adapters/git_adapter.rb
with
10 additions
and
3 deletions
lib/chili_project/version.rb
+
8
−
1
View file @
611889f3
...
...
@@ -38,7 +38,14 @@ module ChiliProject
end
def
self
.
revision
`git --git-dir="
#{
Rails
.
root
.
join
(
'.git'
)
}
" rev-parse --short=9 HEAD`
.
chomp
if
File
.
directory?
Rails
.
root
.
join
(
'.git'
)
@revision
||=
begin
git
=
Redmine
::
Scm
::
Adapters
::
GitAdapter
git_dir
=
Rails
.
root
.
join
(
'.git'
)
if
File
.
directory?
git_dir
git
.
send
(
:shellout
,
"
#{
git
.
sq_bin
}
--git-dir='
#{
git_dir
}
' rev-parse --short=9 HEAD"
)
{
|
io
|
io
.
read
}.
to_s
.
chomp
end
end
end
REVISION
=
self
.
revision
...
...
This diff is collapsed.
Click to expand it.
lib/redmine/scm/adapters/git_adapter.rb
+
2
−
2
View file @
611889f3
...
...
@@ -19,10 +19,10 @@ module Redmine
module
Adapters
class
GitAdapter
<
AbstractAdapter
SCM_GIT_REPORT_LAST_COMMIT
=
true
SCM_GIT_REPORT_LAST_COMMIT
=
true
unless
defined?
(
SCM_GIT_REPORT_LAST_COMMIT
)
# Git executable name
GIT_BIN
=
Redmine
::
Configuration
[
'scm_git_command'
]
||
"git"
GIT_BIN
=
Redmine
::
Configuration
[
'scm_git_command'
]
||
"git"
unless
defined?
(
GIT_BIN
)
# raised if scm command exited with error, e.g. unknown revision.
class
ScmCommandAborted
<
CommandFailed
;
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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