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

Creto #42

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Creto #42

wants to merge 5 commits into from

Conversation

JonETMeans
Copy link
Contributor

Here's what I've got now. Type "git-creto" to get a new branch. It seems to me like the only way to make a command allowing the user to input the name would be to somehow make part of the file name act as a variable.

@jgonggrijp
Copy link
Member

Ah, I see your problem. Creating a new subcommand for git isn't that easy, you still have to write an actual program. And since an actual program can accept command line arguments you can also have it accept a name for the topic branch. Consider something along the following lines (example written in Python, but you can pick another language if you want):

import subprocess
import sys
subprocess.call(['git', 'checkout', 'master'])
subprocess.call(['git', 'puma'])
subprocess.call(['git', 'checkout', '-b', sys.argv[1]])

Of course this would need some sophistication to make it a neat program, but you probably get the idea.

As a side note, you have now demonstrated to yourself why you need to create a new branch before you start working on something new. This pull request can be granted only when your git-creto command is done and when your random-number command is done. Keeping them on separate branches (not one branching off the other but both branching directly from the integration branch) would have saved you that trouble. ;-)

Speaking of which, did you see my pull request on your repo? That should finish the random-number stuff, if you accept it.

@JonETMeans
Copy link
Contributor Author

I guess I just have to keep reminding myself that if I can imagine a thing, it's probably possible somehow. So many libraries....

Anyway, thanks for the help! I'll get right on figuring this out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants