Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sdc
GRIS Gregor Infrared Spectrograph
grisred
Commits
b41d158a
Commit
b41d158a
authored
Mar 14, 2022
by
Carl Schaffer
Browse files
Merge branch 'improve-get-git' into 'master'
improving get_git_revision preformance See merge request
!15
parents
6b4163e9
15eedf4e
Pipeline
#3658
passed with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
grisred/get_git_revision.pro
View file @
b41d158a
function
get_git_revision
;
get
path
to
this
file
source_path
=
file_dirname
(
file_search
(
strsplit
(!
path
,
':'
,
/
extract
),
'get_git_revision.pro'
))
;
get
path
to
this
file
,
iterate
through
all
folders
on
path
,
;
skip
working
directory
as
it
could
be
very
large
foreach
folder
,
strsplit
(!
path
,
':'
,
/
extract
)
do
begin
if
folder
eq
'.'
then
continue
cnt
=
0
paths
=
file_search
(
folder
,
'get_git_revision.pro'
,
count
=
cnt
,
/
fully_qualify_path
)
if
(
cnt
gt
0
)
then
begin
source_path
=
FILE_DIRNAME
(
paths
)
break
endif
endforeach
spawn
,
'cd '
+
source_path
+
$
' ; ./git-create-revisioninfo-hook.sh'
,
gitinfo
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment