Skip to content
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

workon open issues #22

Closed
operte opened this issue Mar 10, 2021 · 3 comments
Closed

workon open issues #22

operte opened this issue Mar 10, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@operte
Copy link
Collaborator

operte commented Mar 10, 2021

We could make workon a bit more "universal".

For example, if I want to work on an issue that has already been created, right now the workflow is

doing create pr <issue id>
git checkout <branch name>

What about allowing doing workon <issue> to automatically detect if the <issue> is an existing <issue id> and, if so, to create a PR based on that and checkout that branch?

@operte operte added the enhancement New feature or request label Mar 10, 2021
@timvink
Copy link
Collaborator

timvink commented Mar 10, 2021

You can write your workflow shorter using the --checkout or -c flag:

doing create pr <issue id> --checkout

doing workon is actually calling doing create pr but with some different defaults, this would be the equivalent:

doing create pr 12345 --autocomplete --draft --reviewers "yourself" --delete-source-branch --checkout
# or shorter:
doing create pr 12345 -a  -d -r "yourself" -c --delete-source-branch

Even with the shortflag flags it quite verbose. If we allow for doing workon to have two types of input, that would allow:

doing workon "a new issue"
doing workon #12345

Still quite elegant, but not as 'pure' because you have to write logic to detect the type of input (string or issue id). An alternative would be another command, or documenting how write an alias to do this. Less elegant.

So, I'm in favor of making this change. Good suggestion!

@operte
Copy link
Collaborator Author

operte commented Mar 10, 2021

I didn't notice the --checkout flag for create pr, that's already quite handy to know :)

Even then, I think allowing the workon to accept more types of inputs makes using doing simpler. The user almost only has to memorize doing list, workon and, eventually, open :)

(like in the other issue, I think I won't have much time to pick this up in the next few weeks, so feel free to have fun with this :p)

@timvink
Copy link
Collaborator

timvink commented Mar 17, 2021

Thought about this more. doing workon has 3 options, one for issue type, one for issue parent, and one specifying the reviewers. If we allow for doing workon <issue id>, the first two options don't make sense. It also make doing workon a bit harder to document / explain.

That leaves the problem that doing create pr <issue id> -a -d -r "yourself" -c --delete-source-branch is too verbose. Setting up those defaults for those options (after we implement #29) is an option but also too involved. After we implement #27, we could create a new doing issue workon <issue id>. But having doing workon and doing issue workon is confusing.

The cleanest solution I can think of now, is change the defaults of doing create pr to match what doing workon is doing. If you don't want things like always creating a draft PR, always assigning yourself as reviewer to a PR, and setting autocomplete to true, you can change the defaults in the config.

timvink added a commit that referenced this issue Mar 24, 2021
Update defaults of doing create pr, closes #22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants