Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

correct `--nofetch` option #551

Merged
merged 1 commit into from

2 participants

Philippe Miossec Matt Burke
Philippe Miossec
Collaborator

according to doc, error messages and old init-branch command...

Philippe Miossec pmiossec referenced this pull request
Closed

New release? #451

Matt Burke
Owner

I prefer --no-fetch over --nofetch. Can we fix the docs instead?

Philippe Miossec
Collaborator

I prefer --no-fetch over --nofetch. Can we fix the docs instead?

In not just a problem of docs. --nofetch was the name of the option until I made a typo and in one command, that was named --no-fetch.

So, there is one or more places where we should fix the name of the option depending what we choose. There is just more places if we choose --no-fetch but we can choose what we want...

Matt Burke spraints referenced this pull request
Closed

v0.20.0 #559

12 of 12 tasks complete
Philippe Miossec
Collaborator

same PR with choosing --no-fetch option instead...

Matt Burke
Owner

I didn't realize it was in so many places. If you git tfs whatever --nofetch does git-tfs tell you that --nofetch isn't recognized, or does it go ahead and do the fetch anyway?

Philippe Miossec
Collaborator

It was introduced in the init-branch command and reported in the branch command (losing the '-' in the process :( ) when the command was created to deprecate init-branch. That's used only here.

I don't think it's a big problem to change the name of the option. The option was asked by @davidalpert but I'm not sure there is someone using it (even perhaps him!).

And git-tfs don't permit to use an option that do not exists and display the help of the command in this case (and do nothing). So, not a big deal. We could rename and choose the one we want...

Matt Burke
Owner

:metal:

Matt Burke spraints merged commit 8d0711e into from
Philippe Miossec pmiossec deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 7, 2014
  1. Philippe Miossec
This page is out of date. Refresh to see the latest.
2  GitTfs/Commands/Branch.cs
View
@@ -54,7 +54,7 @@ public OptionSet OptionSet
{ "init", "Initialize an existing TFS branch", v => ShouldInitBranch = (v != null) },
{ "ignore-regex=", "A regex of files to ignore", v => IgnoreRegex = v },
{ "except-regex=", "A regex of exceptions to ignore-regex", v => ExceptRegex = v},
- { "no-fetch", "Don't fetch changeset for inited branch(es)", v => NoFetch = (v != null) },
+ { "no-fetch", "Don't fetch changeset for newly initialized branch(es)", v => NoFetch = (v != null) },
{ "b|tfs-parent-branch=", "TFS Parent branch of the TFS branch to clone (TFS 2008 only! And required!!) ex: $/Repository/ProjectParentBranch", v => ParentBranch = v },
{ "u|username=", "TFS username", v => TfsUsername = v },
{ "p|password=", "TFS password", v => TfsPassword = v },
6 GitTfs/Commands/InitBranch.cs
View
@@ -57,7 +57,7 @@ public OptionSet OptionSet
{ "p|password=", "TFS password", v => TfsPassword = v },
{ "ignore-regex=", "A regex of files to ignore", v => IgnoreRegex = v },
{ "except-regex=", "A regex of exceptions to ignore-regex", v => ExceptRegex = v},
- { "nofetch", "Create the new TFS remote but don't fetch any changesets", v => NoFetch = (v != null) }
+ { "no-fetch", "Create the new TFS remote but don't fetch any changesets", v => NoFetch = (v != null) }
};
}
}
@@ -108,7 +108,7 @@ public int Run(string tfsBranchPath, string gitBranchNameExpected)
if (!NoFetch)
FetchRemote(tfsRemote, false, !DontCreateGitBranch);
else
- Trace.WriteLine("Not fetching changesets, --nofetch option specified");
+ Trace.WriteLine("Not fetching changesets, --no-fetch option specified");
return GitTfsExitCodes.OK;
}
@@ -127,7 +127,7 @@ public int Run()
_stdout.WriteLine("WARNING: This command is obsolete and will be removed in the next version. Use 'branch --init' instead!");
if (CloneAllBranches && NoFetch)
- throw new GitTfsException("error: --nofetch cannot be used with --all");
+ throw new GitTfsException("error: --no-fetch cannot be used with --all");
if (!CloneAllBranches)
{
2  GitTfsTest/Commands/InitBranchTest.cs
View
@@ -360,7 +360,7 @@ public void ShouldFailInitAllBranchesBecauseNoFetchWasSpecified()
mocks.ClassUnderTest.NoFetch = true;
var ex = Assert.Throws(typeof(GitTfsException), () => mocks.ClassUnderTest.Run());
- Assert.Equal("error: --nofetch cannot be used with --all", ex.Message);
+ Assert.Equal("error: --no-fetch cannot be used with --all", ex.Message);
}
[Fact]
4 doc/commands/branch.md
View
@@ -43,7 +43,7 @@ The `branch` command permit to manage TFS branches. With this command, you can d
--init Initialize an existing TFS branch
--ignore-regex=VALUE a regex of files to ignore
--except-regex=VALUE a regex of exceptions to ignore-regex
- --nofetch Don't fetch changeset for inited branch(es)
+ --no-fetch Don't fetch changeset for inited branch(es)
-b, --tfs-parent-branch=VALUE
TFS Parent branch of the TFS branch to clone
(TFS 2008 only! And required!!) ex:
@@ -130,7 +130,7 @@ You could use the parameter `--except-regex`, to add an exception to the paramet
### Init a branch without fetching changesets
-You could use the parameter `--nofetch`, to init the branch by creating its remote but without fetching the changesets of the branch.
+You could use the parameter `--no-fetch`, to init the branch by creating its remote but without fetching the changesets of the branch.
### Authentication
Something went wrong with that request. Please try again.