Skip to content

Conversation

0x53A
Copy link
Contributor

@0x53A 0x53A commented Jun 7, 2018

Fixes #1201

@pmiossec
Copy link
Member

pmiossec commented Jun 7, 2018

Thanks! 👍

Copy link
Contributor

@fourpastmidnight fourpastmidnight left a 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.

@@ -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)
Copy link
Contributor

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,...

return Run(tfsUrl, tfsRepositoryPath, Path.GetFileName(tfsRepositoryPath));
string gitRepositoryPath;
if (tfsRepositoryPath == GitTfsConstants.TfsRoot)
gitRepositoryPath = new Uri(tfsUrl).Host;
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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?

Copy link
Contributor Author

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".

Copy link
Member

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.

Copy link
Contributor

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.

Copy link
Contributor

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. 😊

Copy link
Contributor Author

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 0x53A changed the title Infer repo name from server url Clone whole collection into "tfs-collection" when no name is specified Jun 12, 2018
@pmiossec
Copy link
Member

@0x53A Seems good. Leave a comment when you think it's ready to merge...

@0x53A
Copy link
Contributor Author

0x53A commented Jun 12, 2018

Ready from my side

@pmiossec pmiossec merged commit 57a37c2 into git-tfs:master Jun 12, 2018
@pmiossec
Copy link
Member

Ok. Thanks

@0x53A 0x53A deleted the patch-1 branch June 12, 2018 11:50
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.

3 participants