Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tree_maker
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
ABP Computing
ABP Computing Sandbox
tree_maker
Commits
66eacad0
Commit
66eacad0
authored
3 years ago
by
Guido Sterbini
Browse files
Options
Downloads
Patches
Plain Diff
cosmetics
parent
acf369ca
No related branches found
Branches containing commit
No related tags found
2 merge requests
!2
Dev v0.0.1
,
!1
Dev v0.0.1
Pipeline
#2790032
passed
3 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tree_maker/repository.py
+9
-1
9 additions, 1 deletion
tree_maker/repository.py
with
9 additions
and
1 deletion
tree_maker/repository.py
+
9
−
1
View file @
66eacad0
'''
This package helps to create download a update a list of git repository.
'''
# conda env export -n base > environment.yml
# conda env create --prefix /home/HPC/sterbini/test1 -f environment.yml
# import git
...
...
@@ -10,12 +13,17 @@ from pathlib import Path
# https://stackoverflow.com/questions/14989858/
def
get_hash
(
repo
):
'''
Given the repository path it gives the hash of the present git version.
'''
#os.chdir(str(Path(repo).expanduser()))
return
subprocess
.
check_output
([
f
'
git
'
,
'
-C
'
,
f
'
{
str
(
Path
(
repo
).
expanduser
())
}
'
,
'
rev-parse
'
,
'
HEAD
'
])[
0
:
-
1
].
decode
(
"
utf-8
"
)
def
create_base
(
my_base
,
my_list
,
verbose
=
False
):
def
create_base
(
my_list
,
verbose
=
False
):
'''
Given a path a list of dictionary containint the *folder_name* and
the *repo* field (address of the repository) it *git clone* the
the repositories (or *git pull* if already cloned).
'''
for
ii
in
my_list
:
print
(
f
'
****
{
ii
[
"
repo
"
]
}
to
{
ii
[
"
folder_name
"
]
}
****
'
)
if
Path
(
ii
[
"
folder_name
"
]).
is_dir
():
...
...
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