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

ux: clone: make <DIRECTORY> optional #683

Closed
Dentrax opened this issue Jan 3, 2023 · 2 comments
Closed

ux: clone: make <DIRECTORY> optional #683

Dentrax opened this issue Jan 3, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@Dentrax
Copy link

Dentrax commented Jan 3, 2023

Summary 💡

clone command requires <DIRECTORY> argument, which I think it should be optional instead: [<DIRECTORY>]:

git way:

git clone [OPTIONS] <repository> [<directory>]

gix way:

gix clone [OPTIONS] <REMOTE> <DIRECTORY>

Motivation 🔦

git by default uses the project name when creating folders. Whereas gix, we have to pass manually, which makes the UX a bit slower. (since we have to copy-paste the repository name)

The following command should just work:

$ gix clone git@github.com:Byron/gitoxide.git
error: The following required arguments were not provided:
    <DIRECTORY>

We can easily get the <DIRECTORY> from the repository name, which is gitoxide in this case.

@Dentrax Dentrax added the enhancement New feature or request label Jan 3, 2023
Byron added a commit that referenced this issue Jan 3, 2023
…tion directory. (#683)

Note that the implementation doesn't take into account potential redirects and renames
as it's implemented only with the first URL it sees (not the redirected ones).
@Byron
Copy link
Member

Byron commented Jan 3, 2023

Thanks for bringing it up. As gix is a development tool best ux isn't one of its goals - that is only true for ein which is incumbent at best.

That said, as it's easy enough to implement this well enough, I have implemented it now. Please note that git applies more logic than is currently implemented so the results may differ in some less common cases. Also, I fixed a bug that would make it possible to deadlock clones with ssh urls, thus you might want to build a fresh gix from main.

@Byron Byron closed this as completed Jan 3, 2023
@Dentrax
Copy link
Author

Dentrax commented Jan 3, 2023

Wow, thanks for such prompt action!

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

Successfully merging a pull request may close this issue.

2 participants