-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bare repo script #146
Bare repo script #146
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have two concrete suggestions and some musing for future follow-ups
Ex. new_bare_repo rix new_device | ||
(Creates a new bare repo in /afs/slac.stanford.edu/g/cd/swe/git/repos/package/epics/ioc/rix/ named "new_device.git") | ||
|
||
You also might need to run kinit and aklog before hand! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of scope for this PR, I'm thinking we might want to add an engineering tools script that checks if kinit/aklog needs to be run (and optionally, runs it). This is doable using the output of the klist
command.
Would something like this have been useful when writing this script?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally, I am not even sure when to run kinit or not... It's usually something I only run when I get an error message with git that I can't explain otherwise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added an issue for this, I might get around to it at some point: #147
scripts/new_bare_repo
Outdated
git-bare-repo /afs/slac.stanford.edu/g/cd/swe/git/repos/package/epics/ioc/${HUTCH}/${REPO}.git | ||
git remote add origin /afs/slac.stanford.edu/g/cd/swe/git/repos/package/epics/ioc/${HUTCH}/${REPO}.git | ||
git push -u origin master |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of scope: a future version of this script could help set up a github repo instead of an afs repo.
At some ill-defined future point we were going to integrate code review into our IOC process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be good to leave this git push
step be manual, just in case the script does something you don't expect
… a git repo in the wrong place
scripts/new_bare_repo
Outdated
git-bare-repo /afs/slac.stanford.edu/g/cd/swe/git/repos/package/epics/ioc/${HUTCH}/${REPO}.git | ||
git remote add origin /afs/slac.stanford.edu/g/cd/swe/git/repos/package/epics/ioc/${HUTCH}/${REPO}.git | ||
git push -u origin master |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be good to leave this git push
step be manual, just in case the script does something you don't expect
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks good/clean/useful 👍
@klauer anything else to change here before merging? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 👍 Admittedly I haven't run it to try it out though!
Hope our comments were useful tips on writing a bit better bash scripts
There are a lot of IOCs that are not properly version controlled since we moved from svn to git. Often, I run into IOCs that do not have a hutch specific bare repo setup, so I made this script to help facilitate the process of creating that bare repo and the subsequent steps afterwards.
This script:
Motivation and Context
As mentioned above
How Has This Been Tested?
This has been tested once with the Smarpod IOC, which I had yet to create a hutch bare repo for. Worked perfectly.
Where Has This Been Documented?
Code includes simple explanations for how to use the script.
If this script is redundant, or could be useful in another script or repository, feel free to shoot this down.