-
Notifications
You must be signed in to change notification settings - Fork 724
Clone whole collection into "tfs-collection" when no name is specified #1202
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
Conversation
Thanks! 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, everything looks great. Just a couple of comments/questions/suggestions. But the PR is solid. Thanks for addressing this issue within git-tfs.
doc/release-notes/NEXT.md
Outdated
@@ -0,0 +1 @@ | |||
* When cloning a whole tfs repository (``$/``) without specifying a local repository name, infer the name from the host part of the server url (#1202) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should use the TFS terminology here. I believe the correct terminology is "TFS Project Collection":
- When cloning a whole TFS Project Collection (
$\
) without specifying a local repository name,...
src/GitTfs/Commands/Clone.cs
Outdated
return Run(tfsUrl, tfsRepositoryPath, Path.GetFileName(tfsRepositoryPath)); | ||
string gitRepositoryPath; | ||
if (tfsRepositoryPath == GitTfsConstants.TfsRoot) | ||
gitRepositoryPath = new Uri(tfsUrl).Host; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a question: Is the TFS host server name the best value to use? At my organization, the url looks like:
http://our-tfs-server.our-domain.com:8080/tfs/COLLECTIONNAME/PROJECTNAME
So, with this url, $/
refers to the "root directory" of the TFS Project Collection (i.e. COLLECTIONNAME
). So, should we instead have gitRepositoryPath
be the COLLECTIONNAME
instead? There could be a situation where an organization hosts more than one TFS Project Collection on a single TFS host.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know. Maybe it should error out and prompt the user to specify a name? I think I may prefer that to guessing a name from any part of the url.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we use a generic http://hostname:8080/tfs/visualstudio
, so maybe HOSTNAME_COLLECTIONNAME?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the user doesn't like the name, they can always rename it afterwards anyway, or just specify the name directly during the clone.
My original issue was that it errored out with "path not valid".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know what to do here...
If we prefer to get the folder name from the user, the simpler is to throw an error asking him to provide it ( which it could already do).
If you want to continue by getting the folder name from one way or another, contrary to what I first said, I'm not for getting it from the url. And this for the reason (that I just think about) the extracted name won't be short and we increase the a lot the risk to hit the 260 charcaters limit of windows path. So, if we choose this behavior finally, I prefer what you did first and clone in "repo".
And the user could rename the folder after.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pmiossec I don't disagree with anything you said. I think that's totally reasonable. However, it should be documented in the "man page" for this command that that's the behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@0x53A Don't forget to updatenext.md
again with whatever behavior we decide to go with. 😊
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about using tfs-collection
? This isn't too long, and a bit more specific than repo
.
@0x53A Seems good. Leave a comment when you think it's ready to merge... |
Ready from my side |
Ok. Thanks |
Fixes #1201