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

When there is no slash in the argument, complement URL as $USER/repo #81

Merged
merged 1 commit into from Aug 18, 2017

Conversation

Projects
None yet
3 participants
@b4b4r07
Copy link
Contributor

commented Jan 25, 2017

FEATURE REQUEST:

When the URL is most omitted, I want ghq(1) to regard it as $USER instead of repo

Now, completion as my-repo/my-repo

$ ghq get my-repo
     clone https://github.com/my-repo/my-repo -> /Users/b4b4r07/src/github.com/my-repo/my-repo
       git clone https://github.com/my-repo/my-repo /Users/b4b4r07/src/github.com/my-repo/my-repo
Cloning into '/Users/b4b4r07/src/github.com/my-repo/my-repo'...
remote: Repository not found.
fatal: repository 'https://github.com/my-repo/my-repo/' not found
     error /usr/local/bin/git: exit status 128

After merging this patch,

$ ./ghq get my-repo
     clone https://github.com/b4b4r07/my-repo -> /Users/b4b4r07/src/github.com/b4b4r07/my-repo
       git clone https://github.com/b4b4r07/my-repo /Users/b4b4r07/src/github.com/b4b4r07/my-repo
Cloning into '/Users/b4b4r07/src/github.com/b4b4r07/my-repo'...
remote: Counting objects: 3, done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 3
Unpacking objects: 100% (3/3), done.

As a use case, it would be nice to be regarded as $USER! What do you think?

@syohex

This comment has been minimized.

Copy link
Contributor

commented Jan 25, 2017

On Windows, user name environment variable is USERNAME, not USER.

@b4b4r07

This comment has been minimized.

Copy link
Contributor Author

commented Jan 25, 2017

Oh my bad, thanks. Ill fix that

@syohex

This comment has been minimized.

Copy link
Contributor

commented Jan 26, 2017

I suppose it is better to add ghq.user(or ghq.github.user) git config variable other than USER and USERNAME environment variables too. Because username does not necessarily correspond to github account. For example, PC supplied by company.

@b4b4r07

This comment has been minimized.

Copy link
Contributor Author

commented Aug 9, 2017

@ALL ping

@motemen

This comment has been minimized.

Copy link
Owner

commented Aug 15, 2017

Thank you, I like this change.

Maybe looking for GITHUB_USER environment variable before falling back to USER would be nice, which is explicity named.

@b4b4r07 b4b4r07 force-pushed the b4b4r07:comp-user branch from 4348047 to 60025f3 Aug 17, 2017

@b4b4r07

This comment has been minimized.

Copy link
Contributor Author

commented Aug 17, 2017

@motemen Thanks you for the suggestion, modified and squashed. Please review this change.

@motemen

This comment has been minimized.

Copy link
Owner

commented Aug 18, 2017

LGTM, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.