hit-on
hit-on copied to clipboard
[RFC] Support workflow with forks
hit
is very convenient when working with repos you own. But sometimes I still need to work with forks. I wonder, whether it's possible to make hit
work with forks without sacrificing current UI.
My typical workflow with forks include:
- Fork repo on GitHub.
- Clone my fork (already can be achieved by
hit clone
command). - Do my work (all
hit
command work here) - Show all remotes (can be
hit remotes
command) - Add remote of the original repo (can be
hit add-remote <owner>/<repo>
) - Rebase on the branch from the remote repo (probably can patch
hit fresh
command so it understandshit fresh <remote>/<repo>
). - Push and open PR.
What do you think?
@chshersh It would be awesome to have this feature in hit
.
I have a question regarding how listing of issues would work in the presence of forks. Usually the upstream repository is where the issues are maintained, so hit issue
should be listing issues from the upstream repository, right?
@krisis We haven't designed this feature entirely yet. But I tend to agree that listing of all issues should be from the upstream repository by default. And since we're using github
library, we can get the information about whether the library is a fork or not:
- https://github.com/phadej/github/blob/1eb7257055b693d17b68e3f454c574accc618cb0/src/GitHub/Data/Repos.hs#L39
Note, that even if forked projects can have their own issues as well (like the following library):
- https://github.com/phadej/postgresql-simple
But I guess a more typical workflow with forked libraries is when you're not a maintainer, but rather a contributor. And you want to list all issues from the original repo, not from the fork.
@chshersh, I agree with the points you make above. I hadn't thought through the different combinations of forks vs owned repositories and maintainer vs contributor when I made the comment earlier.
This is how I imagine the workflow for a contributor working on forked project to be,
-
Fork your favorite project on github.com e.g,
kowainik/hit-on
tokrisis/hit-on
-
Clone the repo
hit clone hit-on
This should,
- Clone the repo from your fork (if available), else fail the command
- Set origin and upstream accordingly like e.g, upstream would be
kowainik/hit-on
and origin would bekrisis/hit-on
- List the issues (upstream) that you can pick and work on
hit issue
- If the contributor wishes to track personal development milestones using issues in their fork We could make it possible using a boolean flag like,
hit issue --local
Is this close to how you are thinking about this?