Open ZLLentz opened 4 years ago
Synchronizing is pretty simple but how do you fork from a script? The only answer I can think of is using Github's REST API. Is that what you're thinking?
Also where are these cool ZLLentz tools? I wanna see 👀
hub fork
/ gh fork
New, official cli tool: https://github.com/cli/cli
Old, still convenient tool: https://github.com/github/hub
Are we going to include one of those in the pcds-env then?
Sorry, I was going to copy in my little scripts here as a starting point but got distracted with the other questions in the presentation today. I'll do that now.
edit: snippits added to the issue text
gh
looks super interesting- I didn't even consider this might be a possibility
It's a big part of my normal workflow, along with being able to list/view PRs and issues. I've always installed it by way of brew
, but it apparently exists on conda-forge
.
If it might help the average PCDS user, perhaps it'd be worth including in our environment.
Can you give an example of when you would use the gh
command as part of your workflow? I see a lot of nice-looking pieces but nothing that screams "use me a lot"- what am I missing?
I think the functionality it offers could just be considered "niceties" for those that like the command-line. For the purposes of writing scripts that make changes on a lot of repos, they're indispensable - which admittedly is not our target audience here.
With hub
/gh
, I find clicking around GitHub's interface only truly necessary when I need to review a PR and add a bunch of comments.
Contributing to others' PRs:
$ gh pr list
$ gh pr checkout 123
$ git commit -a -m '...'
$ git push
Making a fork, and quickly opening a PR:
$ gh repo fork
# this is admittedly very command-line user focused:
$ gh pr create
Quickly handling remotes - not sure gh
does this, but hub
does and it's nice:
$ hub remote add pcdshub
$ hub remote -v
pcdshub git@github.com:pcdshub/currentreponame.git (fetch)
Quickly jumping to the repo webpage by way of gh repo view --web
or just viewing its README in color without the --web
.
Checking issue lists by way of gh issue list
and grepping through them, etc.
Expected Behavior
We should have helper scripts for the Github workflow:
Current Behavior
No such scripts currently exist
Possible Solution
Port over @ZLLentz's tools and clean them up
Context
In the engineering general, there is some consensus that maintaining a fork is a pain point.