Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
aa577df0
Commit
aa577df0
authored
10 years ago
by
Erik Johnston
Browse files
Options
Downloads
Patches
Plain Diff
When computing git version run git commands in same dir as source files
parent
d122e215
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/app/homeserver.py
+5
-0
5 additions, 0 deletions
synapse/app/homeserver.py
with
5 additions
and
0 deletions
synapse/app/homeserver.py
+
5
−
0
View file @
aa577df0
...
...
@@ -211,10 +211,12 @@ class SynapseHomeServer(HomeServer):
def
get_version_string
():
null
=
open
(
os
.
devnull
,
'
w
'
)
cwd
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
try
:
git_branch
=
subprocess
.
check_output
(
[
'
git
'
,
'
rev-parse
'
,
'
--abbrev-ref
'
,
'
HEAD
'
],
stderr
=
null
,
cwd
=
cwd
,
).
strip
()
git_branch
=
"
b=
"
+
git_branch
except
subprocess
.
CalledProcessError
:
...
...
@@ -224,6 +226,7 @@ def get_version_string():
git_tag
=
subprocess
.
check_output
(
[
'
git
'
,
'
describe
'
,
'
--exact-match
'
],
stderr
=
null
,
cwd
=
cwd
,
).
strip
()
git_tag
=
"
t=
"
+
git_tag
except
subprocess
.
CalledProcessError
:
...
...
@@ -233,6 +236,7 @@ def get_version_string():
git_commit
=
subprocess
.
check_output
(
[
'
git
'
,
'
rev-parse
'
,
'
--short
'
,
'
HEAD
'
],
stderr
=
null
,
cwd
=
cwd
,
).
strip
()
except
subprocess
.
CalledProcessError
:
git_commit
=
""
...
...
@@ -242,6 +246,7 @@ def get_version_string():
is_dirty
=
subprocess
.
check_output
(
[
'
git
'
,
'
describe
'
,
'
--dirty=
'
+
dirty_string
],
stderr
=
null
,
cwd
=
cwd
,
).
strip
().
endswith
(
dirty_string
)
git_dirty
=
"
dirty
"
if
is_dirty
else
""
...
...
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