diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dc719406..48ad076f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,4 +1,10 @@ -## Getting Involved +## Contributing [documentation](https://github.com/git-tfs/git-tfs/tree/master/doc) + +We'll try to review and merge documentation changes quickly. + +If you see something easy to change, you can probably even make the change in your browser! + +## Contributing code 0. In your git-tfs clone, run `git config core.autocrlf true` so that all the line endings are unix line endings when you commit. @@ -12,10 +18,10 @@ Here are some tips on creating a pull request: -1. Write awesome code. :sparkles: +1. Write that awesome code. :sparkles: 2. Make sure the existing unit tests don't break. We try to keep the unit tests -[easy to run](https://github.com/git-tfs/git-tfs/wiki/Running-the-Unit-Tests). +[easy to run](https://github.com/git-tfs/git-tfs/blob/master/doc/Running-the-Unit-Tests.md). 3. We like new unit tests. If you can unit test your code, do so. One of the pain points of the current git-tfs codebase is that parts of it are very difficult to unit test. @@ -24,3 +30,5 @@ that runs git-tfs with the VsFake driver, similar to how the clone tests are wri 4. If you modify code in any of the client adapters (GitTfs.Vs*), please try it out with as many versions of the TFS client libraries as you can. When you submit the pull request, include a note about which versions you have tried to compile with, and which ones you have tested with. + +5. Include [documentation](https://github.com/git-tfs/git-tfs/tree/master/doc) for externally-visible changes. diff --git a/GitTfs/Util/CommitSpecificCheckinOptionsFactory.cs b/GitTfs/Util/CommitSpecificCheckinOptionsFactory.cs index 6bf567b5..b308e728 100644 --- a/GitTfs/Util/CommitSpecificCheckinOptionsFactory.cs +++ b/GitTfs/Util/CommitSpecificCheckinOptionsFactory.cs @@ -14,7 +14,7 @@ namespace Sep.Git.Tfs.Util /// /// This class handles the pre-checkin commit message parsing that /// enables special git-tfs commands: - /// https://github.com/git-tfs/git-tfs/wiki/Special-actions-in-commit-messages + /// https://github.com/git-tfs/git-tfs/blob/master/doc/Special-actions-in-commit-messages.md /// public class CommitSpecificCheckinOptionsFactory { diff --git a/README.md b/README.md index be8ecacf..344545b0 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,10 @@ git-tfs is a two-way bridge between TFS and git, similar to git-svn. ## Usage -You will find there a very short help. For more help, please look at the [wiki](https://github.com/git-tfs/git-tfs/wiki) +`git tfs help` lists the available commands. +`git tfs help ` shows a summary of the usage of a given command. + +Further documentation is available in the [doc/](doc/README.md) directory. ### Cloning a repository @@ -67,9 +70,8 @@ You can also do `rake build:debug`. If you contribute patches, please set `core.autocrlf` to `true`. (`git config core.autocrlf true`) - -Contributions are always welcome. For more information about contributing, -please see [the wiki](http://github.com/git-tfs/git-tfs/wiki/Contributing). +Contributions are always welcome. There are some simple guidelines in +[CONTRIBUTING.md](CONTRIBUTING.md). ### Community diff --git a/doc/README.md b/doc/README.md new file mode 100644 index 00000000..3cc0c5b3 --- /dev/null +++ b/doc/README.md @@ -0,0 +1,108 @@ +[git-tfs](http://git-tfs.com/) is a two-way bridge between TFS and git, similar to git-svn. +It fetches TFS commits into a git repository, and lets you push your updates back to TFS. + +The most recent version is 0.17.1. +See the [change history](change-history.md) for details. + +If you're having problems, check out the [troubleshooting](TROUBLESHOOTING.md) page. +And read [how to report an issue](reporting-issues.md), before doing so ;) + +## Get git-tfs + +Either [download a binary](http://git-tfs.com/) ([old versions](https://github.com/git-tfs/git-tfs/downloads)), use [Chocolatey](http://chocolatey.org/packages/gittfs) or build from source: + + git clone git://github.com/git-tfs/git-tfs.git + cd git-tfs + msbuild GitTfs.sln + set PATH=%PATH%;%cd%\GitTfs\bin\Debug + +The last step adds git-tfs.exe to your path. If you download a package, you'll need to complete this step, too. + +## Use git-tfs + + # [optional] find a repository path to clone : + git tfs list-remote-branches http://tfs:8080/tfs/DefaultCollection + + # clone the whole repository (wait for a while...) : + git tfs clone http://tfs:8080/tfs/DefaultCollection $/some_project + + # or, if you're impatient (only last changeset) : + git tfs quick-clone http://tfs:8080/tfs/DefaultCollection $/some_project + + cd some_project + git log # shows your TFS history, unless you did quick-clone + tf history # error: no workspace ;) + + # [do work, do work, just using git], then... + # gets latest from TFS to the branch tfs/default : + git tfs fetch + + # commit on TFS : + git tfs rcheckin + + # or shelve your changes : + git tfs shelve MY_AWESOME_CHANGES + + +git-tfs is designed to work outside of any existing TFS workspaces. + +## Available commands / options + +This is the complete list of commands in the master branch on github. + +### Repository setup + +* [list-remote-branches](commands/list-remote-branches.md) - since 0.17 +* [clone](commands/clone.md) - since 0.9 +* [quick-clone](commands/quick-clone.md) - since 0.9 +* [bootstrap](commands/bootstrap.md) - since [0.11][v0.11] +* [init](commands/init.md) - since 0.9 + +### Pull from TFS + +* [clone](commands/clone.md) - since 0.9 +* [fetch](commands/fetch.md) - since 0.9 +* [pull](commands/pull.md) - since 0.9 +* [quick-clone](commands/quick-clone.md) - since 0.9 +* [unshelve](commands/unshelve.md) - since [0.11][v0.12] +* [shelve-list](commands/shelve-list.md) - since [0.12][v0.12] +* [init-branch](commands/init-branch.md) - since v0.16 (prefer the [branch](commands/branch.md) command) +* [labels](commands/labels.md) - since v0.17 + +### Push to TFS + +* [rcheckin](commands/rcheckin.md) - since [0.12][v0.12] +* [checkin](commands/checkin.md) - since 0.10 +* [checkintool](commands/checkintool.md) - since 0.10 +* [shelve](commands/shelve.md) - since 0.9 + +### Manage TFS branches + +* [list-remote-branches](commands/list-remote-branches.md) - since 0.17 +* [branch](commands/branch.md) - since 0.17 +* [init-branch](commands/init-branch.md) - since v0.16 (prefer the [branch](commands/branch.md) command) + +### Other + +* [info](commands/info.md) +* [cleanup](commands/cleanup.md) - since 0.10 +* [cleanup-workspaces](commands/cleanup-workspaces.md) - since 0.10 +* [diagnostics](commands/diagnostics.md) - since 0.9 +* [help](commands/help.md) - since 0.9 +* [verify](commands/verify.md) - since [0.11][v0.11] +* [autotag](commands/autotag.md) option - since [0.12][v0.12] + +## Contributing + +Information about contributing is available in +[CONTRIBUTING.md](https://github.com/git-tfs/git-tfs/blob/master/CONTRIBUTING.md). + +### Migrations +If you're migrating a TFS server from 2008 or 2005 to 2010, you might want to [Specify Alternate TFS URLs](specify-alternate-tfs-urls.md). + +[v0.11]: http://mattonrails.wordpress.com/2011/03/11/git-tfs-0-11-0-release-notes/ "0.11 Release notes" +[v0.12]: http://sparethought.wordpress.com/2011/08/10/git-tfs-bridge-v0-12-released/ + +If you have questions or suggestions about how we could improve git-tfs you could go to [google group](http://groups.google.com/group/git-tfs-dev). + +[Example](http://sparethought.wordpress.com/2011/07/18/how-to-establish-git-central-repository-for-working-against-tfs-with-git-tfs-bridge/) of setting up central git repository that tracks TFS automatically. diff --git a/doc/TF400813-error-with-visualstudio.com.md b/doc/TF400813-error-with-visualstudio.com.md new file mode 100644 index 00000000..9e20330f --- /dev/null +++ b/doc/TF400813-error-with-visualstudio.com.md @@ -0,0 +1,12 @@ +To clone a tfs repository on visualstudio.com, you should : + * Enable alternate credentials. Go to "My profile"->"CREDENTIALS"-> Enter datas and "Enable alternate credentials" + * use the command following this pattern (where 'yourLogin' and 'yourPassword' was defined in the previous step) +`git tfs clone https://[user].visualstudio.com/DefaultCollection $/project/folder --username=yourLogin --password=yourPassword` + +To succeed, visualstudio.com need (for authentication) that you use the TFS2012 version of the TFS dlls. Otherwise, you will see the message : + +`TF400813: Resource not available for anonymous access. Client authentication required` + +To be sure that git-tfs use this version, use the command `git tfs --version` and you should see the text `TFS client library 11.0.0.0`, like in: + +`git-tfs version 0.17.2.0 (TFS client library 11.0.0.0 (MS)) (64-bit)` \ No newline at end of file diff --git a/doc/TROUBLESHOOTING.md b/doc/TROUBLESHOOTING.md new file mode 100644 index 00000000..66f18092 --- /dev/null +++ b/doc/TROUBLESHOOTING.md @@ -0,0 +1,4 @@ +Here are some common git-tfs problems. + +* [Checkin policy doesn't work](troubleshooting-checkin-policies.md) +* [TF400813 error with visualstudio.com](TF400813-error-with-visualstudio.com.md) diff --git a/doc/change-history.md b/doc/change-history.md new file mode 100644 index 00000000..95f228de --- /dev/null +++ b/doc/change-history.md @@ -0,0 +1,79 @@ + +v0.17.1 +------- + +- Fixed `git tfs clone` broken in some cases in 0.17 (#330) + +[Full diff](https://github.com/git-tfs/git-tfs/compare/v0.17.0...v0.17.1) + + +v0.17.0 +------- + +- [branch](commands/branch.md) +- [labels](commands/labels.md) (#256) +- git tfs pull --rebase (#254) +- git tfs clone --with-branches (#255) +- unicode support (#204) +- Use a custom workspace (#266) +- Clean workspaces directory (#269) +- Add a note on the commit to keep trace of the workitems (#276) +- Remove orphan folders (except in specific cases) (#323) + +[Full diff](https://github.com/git-tfs/git-tfs/compare/v0.16.1...v0.17.0) + +v0.16.1 +------- + +- Fixed `git tfs unshelve` (broken in 0.16.0) (#253). + +[Full diff](https://github.com/git-tfs/git-tfs/compare/v0.16.0...v0.16.1) + +v0.16.0 +------- + +- [init-branch](commands/init-branch.md)!! (#232) +- Faster clone (#226) and quick-clone. +- Add `git tfs info` (#219) +- Better metadata processing during rcheckin: remove the flags (#237), ignore whitespace (#238), add `git-tfs-force:` reason (#219). +- Always use CRLF in TFS checkin comments (#239) +- Checkin notes (#245) +- Use authors file more, and save it so you don't have to tell git-tfs about it every time you need it. (#252) + +[Full diff](https://github.com/git-tfs/git-tfs/compare/v0.15.0...v0.16.0) + +v0.15.0 +------- + +- Use [libgit2sharp](https://github.com/libgit2/libgit2sharp). +- Add default comment for shelves (#187) +- Add support for files with international characters (#200) +- Fix the mixed case problem (once and for all?) (#213) +- Add support for authors file +- Set up CI with [travis](http://travis-ci.org/git-tfs/git-tfs) and [teamcity](http://teamcity.codebetter.com/) + +[Full diff](https://github.com/git-tfs/git-tfs/compare/v0.14.0...v0.15.0) + +[v0.14.0](https://github.com/downloads/git-tfs/git-tfs/git-tfs-0.14.0.zip) +------- +- Fixed a bug in shelve (#133). +- Fixed rename problem in checkintool (#148). +- Fixed shelve -f (#157). +- Fixed (or unfixed) case sensitivity (#159). +- When a git subprocess exits with error, show the return/error code (#151). +- Add support for VS11. + +[Full diff from 0.13](https://github.com/git-tfs/git-tfs/compare/v0.13.0...v0.14.0) + +... + + +v0.12.1 +------- +- Fixed: 'TF14045: The identity MYDOMAIN\John Doe is not a recognized identity' (#76, #81) +- Fixed: exception on unshelve if some items was renamed (#77) +- Fixed: rare problem when TFS' mixed mode assemblies cannot be loaded correctly (#93) +- Some fixes for Unicode filenames and TFS usernames (#80) +- git-tfs exit codes are now positive +- git-tfs cleans up files if clone command resulted in exception (#94) +- Restored VS2008 functionality (#99) diff --git a/doc/commands/bootstrap.md b/doc/commands/bootstrap.md new file mode 100644 index 00000000..aa85b1e5 --- /dev/null +++ b/doc/commands/bootstrap.md @@ -0,0 +1,40 @@ +## Summary + +The bootstrap command allows you to quickly configure a cloned git repository for use with the original TFS repository. + +## Synopsis + + Usage: git-tfs bootstrap [parent-commit] + where options are: + + -i, --id, --tfs-remote, --remote + (Type: Value required, Value Type:[String]) + An optional remote ID, useful if this repository will track multiple TFS repositories. + + -d, --debug + (Type: Flag, Value Type:[Boolean]) + Show lots of output. + + -H, -h, --help + (Type: Flag, Value Type:[Boolean]) + ShowHelp + + -V, --version + (Type: Flag, Value Type:[Boolean]) + ShowVersion + + +## How to use this + +`bootstrap` is useful if you create a TFS clone and share it with a colleague who then needs to interact with TFS. While two identical invocations of git tfs clone will produce identical repositories, git clone is always going to be faster than git tfs clone. So, I would guess that most people who want to collaborate on a TFS project using git will benefit from this command. + + [user 1] git tfs clone http://blah/blah/blah $/blah + [user 1] cd blah + [user 1] git remote add shared git@someplace:shared/repo.git + [user 1] git push shared master + + [user 2] git clone git@someplace:shared/repo.git + [user 2] cd repo + [user 2] git tfs bootstrap + +At this point, `user2` will be able to use all the normal git-tfs commands. diff --git a/doc/commands/branch.md b/doc/commands/branch.md new file mode 100644 index 00000000..04f2f9f3 --- /dev/null +++ b/doc/commands/branch.md @@ -0,0 +1,136 @@ +## Summary + +The `branch` command permit to manage TFS branches. With this command, you can display, create, init, rename and delete branches. + +## Synopsis + Usage: git-tfs branch + + * Display remote TFS branches: + git tfs branch -r + git tfs branch -r -all + + * Create a TFS branch from current commit: + git tfs branch $/Repository/ProjectBranchToCreate --comment="Creation of my branch" + + * Rename a remote branch: + git tfs branch --move oldTfsRemoteName newTfsRemoteName + + * Delete a remote branche: + git tfs branch --delete tfsRemoteName + + * Initialise an existing remote TFS branch: + git tfs branch --init $/Repository/ProjectBranch + git tfs branch --init $/Repository/ProjectBranch myNewBranch + git tfs branch --init --all + git tfs branch --init --tfs-parent-branch=$/Repository/ProjectParentBranch $/Repository/ProjectBranch + + -h, -H, --help + -V, --version + -d, --debug Show debug output about everything git-tfs does + -i, --tfs-remote, --remote, --id=VALUE + The remote ID of the TFS to interact with + default: default + -r, --remotes Display the TFS branches of the current TFS root + branch existing on the TFS server + --all Display (used with option --remotes) the TFS + branches of all the root branches existing on + the TFS server + or Initialize (used with option --init) all + existing TFS branches (For TFS 2010 and later) + --comment=VALUE Comment used for the creation of the TFS branch + -m, --move Rename a TFS remote + --delete Delete a TFS remote + --init Initialize an existing TFS branch + -b, --tfs-parent-branch=VALUE + TFS Parent branch of the TFS branch to clone + (TFS 2008 only! And required!!) ex: + $/Repository/ProjectParentBranch + -u, --username=VALUE TFS username + -p, --password=VALUE TFS password + -a, --authors=VALUE Path to an Authors file to map TFS users to Git + users## Examples + +## Display already inited branches + + git tfs branch + +## Display existing TFS branches + +### Display branches from the current repository + + git tfs branch -r + +### Display branches of all the repositories + git tfs branch -r -all + +## Create a TFS branch + +First, checkout with git the revision from where you want to create the TFS branch. Then use the command : + + git tfs branch $/Repository/ProjectBranchToCreate --comment="Creation of my branch" + +You will now have a TFS branch (called $/Repository/ProjectBranchToCreate ) with a first commit with a the comment specified. The local git remote with the same name 'ProjectBranchToCreate' is created. + +If you want to specify another name (but not recommended), use the command : + + git tfs branch $/Repository/ProjectBranchToCreate myWishedRemoteName --comment="Creation of my branch" + + The local git remote with the name 'myWishedRemoteName ' is created. + +## Init an existing TFS branches + +To use this command, you should have cloned only the trunk folder in TFS (and not the whole repository). See [clone](clone.md) command. +Suppose you have on TFS: + + A <- B <- C <- D <- E $/Repository/ProjectTrunk + \ + M <- N $/Repository/ProjectBranch + +You should have done (to clone only the trunk) : + + git tfs clone http://tfs:8080/tfs/DefaultCollection $/Repository/ProjectTrunk + +Then use `branch` like this : +### Init a TFS branches using auto-naming of your git branch + git tfs branch --init $/Repository/ProjectBranch + +### Init a TFS branches naming yourself the git branch + git tfs branch --init $/Repository/ProjectBranch myNewBranch + +### Init all the TFS branches + git tfs branch --init --all +This command init all the branches not already done and ignore existing ones. + +### Init a branch with TFS2008 + +TFS2008 doesn't permit to know the parent of a branch. You should find it yourself with TFS and use the parameter `--tfs-parent-branch` to give it to the `init-branch` command: + + git tfs branch --init --tfs-parent-branch=$/Repository/ProjectParentBranch $/Repository/ProjectBranch + +### Authentication + +For the use of parameters `--username` and `--password`, see the [clone](clone.md) command. + +### Map TFS users to git users + +For the use of parameter `--authors`, see the [clone](clone.md) command. + +## Rename a remote branch + +Note : It will not rename the TFS branch, just the local git remote. + + git tfs branch --move oldTfsRemoteName newTfsRemoteName + + +## Delete a remote branche + +Note : It will not delete the TFS branch, just the local git remote. + + git tfs branch --delete tfsRemoteName + +## See also + +* [clone](clone.md) +* [fetch](fetch.md) +* [checkin](checkin.md) +* [rcheckin](rcheckin.md) diff --git a/doc/commands/checkin.md b/doc/commands/checkin.md new file mode 100644 index 00000000..c9eafcea --- /dev/null +++ b/doc/commands/checkin.md @@ -0,0 +1,37 @@ +## Summary + +This function squashes differences between the last TFS commit and HEAD into one TFS-checkin and mark it as descendant of both previous TFS-checkin and HEAD. + +It works similarly to [checkintool](checkintool.md), except checkintool launches the standard TFS checkin window. + +checkin differs from [rcheckin](rcheckin.md) in that the latter mirrors a series of commits into TFS instead of squashing them into one. + +## Synopsis + + Usage: git-tfs checkin [options] [ref-to-shelve] + where options are: + -d, --debug + Show debug output about everything git-tfs does + + -i, --tfs-remote, --remote, --id=VALUE + The remote ID of the TFS to interact with + + -m, --comment=VALUE + A comment for the changeset + + --no-build-default-comment + Do not concatenate commit comments for the changeset comment. + + --no-merge + Omits setting commit being checked in as parent, thus allowing to rebase remaining onto TFS changeset without exceeding merge commits. + + -f, --force=VALUE + The policy override reason. + + -w, --work-item=VALUE1:VALUE2 + Associated work items: + e.g. -w12345 to associate with 12345 + or -w12345:resolve to resolve 12345 + + --no-gate + Disables gated checkin. diff --git a/doc/commands/checkintool.md b/doc/commands/checkintool.md new file mode 100644 index 00000000..2eccbc75 --- /dev/null +++ b/doc/commands/checkintool.md @@ -0,0 +1,41 @@ +## Summary + +This function launches the standard TFS checkin window to commit your changes into TFS. It squashes differences between the last TFS commit and HEAD into one TFS-checkin and mark it as descendant of both previous TFS-checkin and HEAD. + +It works similarly to [checkin](checkin.md), except checkin doesn't launches the standard TFS checkin window. + +## Synopsis + + Usage: git-tfs checkintool [options] [ref-to-checkin] + -h, -H, --help + -V, --version + -d, --debug Show debug output about everything git-tfs does + -i, --tfs-remote, --remote, --id=VALUE + The remote ID of the TFS to interact with + default: default + -m, --comment=VALUE A comment for the changeset + --no-build-default-comment + Do not concatenate commit comments for the + changeset comment. + --no-merge Omits setting commit being checked in as parent, + thus allowing to rebase remaining onto TFS + changeset without exceeding merge commits. + -f, --force=VALUE The policy override reason. + -w, --work-item=VALUE1:VALUE2 + Associated work items + e.g. -w12345 to associate with 12345 + or -w12345:resolve to resolve 12345 + -c, --code-reviewer=VALUE Set code reviewer + e.g. -c "John Smith" + -s, --security-reviewer=VALUE + Set security reviewer + e.g. -s "John Smith" + -p, --performance-reviewer=VALUE + Set performance reviewer + e.g. -p "John Smith" + --no-gate Disables gated checkin. + +## See also + +* [checkin](checkin.md) +* [rcheckin](rcheckin.md) diff --git a/doc/commands/cleanup-workspaces.md b/doc/commands/cleanup-workspaces.md new file mode 100644 index 00000000..8396064b --- /dev/null +++ b/doc/commands/cleanup-workspaces.md @@ -0,0 +1 @@ +Clean up leftover TFS workspace mappings created by git-tfs (but this should never be the case). \ No newline at end of file diff --git a/doc/commands/cleanup.md b/doc/commands/cleanup.md new file mode 100644 index 00000000..72775463 --- /dev/null +++ b/doc/commands/cleanup.md @@ -0,0 +1,3 @@ +Clean all workspace directories (i.e. `.git\tfs\default\workspace` and workspace for branches) which are used for fetching and checkin changesets from TFS and also do what [cleanup-workspaces](cleanup-workspaces.md) does: clean up leftover TFS workspace mappings created by git-tfs. + +This command could be run periodically to free some space. diff --git a/doc/commands/clone.md b/doc/commands/clone.md new file mode 100644 index 00000000..697a1d05 --- /dev/null +++ b/doc/commands/clone.md @@ -0,0 +1,83 @@ +## Summary + +The `clone` command creates a new git repository, initialized from +a TFS source tree and fetch all the changesets + +## Synopsis + + Usage: git-tfs clone [options] tfs-url-or-instance-name repository-path + -h, -H, --help + -V, --version + -d, --debug Show debug output about everything git-tfs does + -i, --tfs-remote, --remote, --id=VALUE + The remote ID of the TFS to interact with + default: default + --template=VALUE Passed to git-init + --shared[=VALUE] Passed to git-init + --ignore-regex=VALUE a regex of files to ignore + --no-metadata leave out the 'git-tfs-id:' tag in commit + messages + Use this when you're exporting from TFS and + don't need to put data back into TFS. + -u, --username=VALUE TFS username + -p, --password=VALUE TFS password + --all, --fetch-all + --parents + --authors=VALUE Path to an Authors file to map TFS users to Git users +## Examples + +### Simple + +To clone all of `$/Project1` from your TFS 2010 server `tfs` +into a new directory `Project1`, do this: + + git tfs clone http://tfs:8080/tfs/DefaultCollection $/Project1 + +### Clone only the trunk (or a branch) +Sometimes, it could be interesting to clone only a branch of a TFS repository (for exemple to extract only the trunk of your project and manage branches with `[branch](branch.md)`. Then, do this (the clone will be done in the `MyProject1Directory` directory): + + git tfs clone http://tfs:8080/tfs/DefaultCollection $/Project1/Trunk MyProject1Directory + +### What repository path to clone? + +If you don't know exactly what repository path to clone, see [list-remote-branches](list-remote-branches.md) command to get a list of the existing repositories. + +### Excludes + +Let's say you want to clone `$/Project`, but you don't want to +clone exes. + + git tfs clone --ignore-regex=exe$ http://tfs:8080/tfs/DefaultCollection $/Project1 + +### Authentication + +If the TFS server need an authentication, you could use the _--username_ and _--password_ parameters. If you don't specify theses informations, you will be prompted to enter them. If you use these parameters, the informations, git-tfs will store these informations (in the .git/config file --in clear--) and never prompt you again. If you don't want your password to be saved, don't use these options. + + git tfs clone http://tfs:8080/tfs/DefaultCollection $/Project1 -u=DISSRVTFS03\peter.pan -p=wendy + + +### Map TFS users to git users + +With the parameter _--authors_, you could specify a file containing all the mapping of the TFS users to the git users. Each line describing a mapping following the syntax: + + DISSRVTFS03\peter.pan = Peter Pan + +The clone command will be : + + git tfs clone http://tfs:8080/tfs/DefaultCollection $/Project1 --authors="c:\project_file\authors.txt" + +Once the clone is done, the file is store in the `.git` folder (with the name git-tfs_authors) and used with later `fetch`. You could overwrite it by specifting another file (or go delete it). + + +## After cloning a repository + +It is recommended, especially if the TFS repository is a big one, to run, after a clone : +* a git garbage collect : `git gc` +* a [cleanup](cleanup.md) : `git tfs cleanup` + +## See also + +* [list-remote-branches](list-remote-branches.md) +* [init](init.md) +* [fetch](fetch.md) +* [quick-clone](quick-clone.md) diff --git a/doc/commands/fetch.md b/doc/commands/fetch.md new file mode 100644 index 00000000..fa08408e --- /dev/null +++ b/doc/commands/fetch.md @@ -0,0 +1,49 @@ +## Summary + +The fetch command fetch all the new changesets from a TFS remote + +## Synopsis + + Usage: git-tfs fetch [options] [tfs-remote-id]... + -h, -H, --help + -V, --version + -d, --debug Show debug output about everything git-tfs does + -i, --tfs-remote, --remote, --id=VALUE + The remote ID of the TFS to interact with + default: default + --all, --fetch-all + --parents + --authors=VALUE Path to an Authors file to map TFS users to Git + users + --ignore-regex=VALUE a regex of files to ignore + --no-metadata leave out the 'git-tfs-id:' tag in commit + messages + Use this when you're exporting from TFS and + don't need to put data back into TFS. + -u, --username=VALUE TFS username + -p, --password=VALUE TFS password +## Examples + +### Simple + +To fetch all the changeset of the `default` branch: + + git tfs fetch + +### Fetch from a branch + +To fetch all the changeset of the `tfs/myBranch` branch: + + git tfs fetch -i myBranch + +### Authentication + +For the use of parameters `--username` and `--password`, see the [clone](clone.md) command. + +### Map TFS users to git users + +For the use of parameter `--authors`, see the [clone](clone.md) command. + +## See also + +* [clone](clone.md) diff --git a/doc/commands/init-branch.md b/doc/commands/init-branch.md new file mode 100644 index 00000000..234d82f6 --- /dev/null +++ b/doc/commands/init-branch.md @@ -0,0 +1,65 @@ +## Summary + +The `init-branch` command creates a git branch for an existing TFS branch (or all) and fetch all the changeset of the TFS branch. + +To use this command, you should have cloned only the trunk folder in TFS (and not the whole repository). See [clone](clone.md) command. + +## Synopsis + Usage: git-tfs init-branch [$/Repository/path |--all] + -h, -H, --help + -V, --version + -d, --debug Show debug output about everything git-tfs does + --all Clone all the TFS branches (For TFS 2010 and + later) + -b, --tfs-parent-branch=VALUE + TFS Parent branch of the TFS branch to clone + (TFS 2008 only! And required!!) ex: $/Repository/ProjectParentBranch + -u, --username=VALUE TFS username + -p, --password=VALUE TFS password +## Examples + +Suppose you have on TFS: + + A <- B <- C <- D <- E $/Repository/ProjectTrunk + \ + M <- N $/Repository/ProjectBranch + +You should have done (to clone only the trunk) : + + git tfs clone http://tfs:8080/tfs/DefaultCollection $/Repository/ProjectTrunk + +Then use `init-branch` like this : +### Init a TFS branches using auto-naming of your git branch + git tfs init-branch $/Repository/ProjectBranch + +### Init a TFS branches naming yourself the git branch + git tfs init-branch $/Repository/ProjectBranch myNewBranch + +### Init all the TFS branches + git tfs init-branch --all +This command init all the branches not already done and ignore existing ones. + +### Init a branch with TFS2008 + +TFS2008 doesn't permit to know the parent of a branch. You should find it yourself with TFS and use the parameter `--tfs-parent-branch` to give it to the `init-branch` command: + + git tfs init-branch --tfs-parent-branch=$/Repository/ProjectParentBranch $/Repository/ProjectBranch + +### Authentication + +For the use of parameters `--username` and `--password`, see the [clone](clone.md) command. + +### Map TFS users to git users + +For the use of parameter `--authors`, see the [clone](clone.md) command. + +## And Now... + +After that your branch is created, you should use the commands [fetch](fetch.md) and [checkin](checkin.md) or [rcheckin](rcheckin.md) with the parameter `-i` to work with the TFS branch. + +## See also + +* [clone](clone.md) +* [fetch](fetch.md) +* [checkin](checkin.md) +* [rcheckin](rcheckin.md) diff --git a/doc/commands/init.md b/doc/commands/init.md new file mode 100644 index 00000000..c072f246 --- /dev/null +++ b/doc/commands/init.md @@ -0,0 +1,41 @@ +## Summary + +The `init` command creates a new git repository, initialized from a TFS source tree (without fetching the changesets). Fetching changeset should be done with [fetch](fetch.md) command. + +Prefer the [clone](clone.md) command to init and fetch changesets from a TFS repository! + +## Synopsis + + Usage: git-tfs init [options] tfs-url-or-instance-name repository-path [git-repository] + -h, -H, --help + -V, --version + -d, --debug Show debug output about everything git-tfs does + -i, --tfs-remote, --remote, --id=VALUE + The remote ID of the TFS to interact with + default: default + --template=VALUE Passed to git-init + --shared[=VALUE] Passed to git-init + --autocrlf=VALUE Normalize line endings (default: false) + --ignore-regex=VALUE a regex of files to ignore + --no-metadata leave out the 'git-tfs-id:' tag in commit + messages + Use this when you're exporting from TFS and + don't need to put data back into TFS. + -u, --username=VALUE TFS username + -p, --password=VALUE TFS password + +## Examples + +### Simple + +To init `$/Project1` from your TFS 2010 server `tfs` +into a new directory `Project1`, do this: + + git tfs init http://tfs:8080/tfs/DefaultCollection $/Project1 + + +## See also + +* [clone](clone.md) +* [quick-clone](quick-clone.md) +* [fetch](fetch.md) diff --git a/doc/commands/labels.md b/doc/commands/labels.md new file mode 100644 index 00000000..1217ad3f --- /dev/null +++ b/doc/commands/labels.md @@ -0,0 +1,31 @@ +## Summary + +The `labels` command fetch all the tfs labels. + +Note : Due to how TFS manage labels, this command fetch a lot of datas and could be quite long :( + +## Synopsis + + Usage: git-tfs labels [options] [tfsRemoteId] + ex : git tfs labels + git tfs labels -i myRemoteBranche + git tfs labels --all + -h, -H, --help + -V, --version + -d, --debug Show debug output about everything git-tfs does + -i, --tfs-remote, --remote, --id=VALUE + The remote ID of the TFS to interact with + default: default + --all, --fetch-all Fetch all the labels on all the TFS remotes (For + TFS 2010 and later) + -n, --label-name=VALUE Fetch all the labels respecting this name filter + -e, --exclude-label-name=VALUE + Exclude all the labels respecting this regex + name filter + -u, --username=VALUE TFS username + -p, --password=VALUE TFS password + -a, --authors=VALUE Path to an Authors file to map TFS users to Git + users +## Examples + +TODO... \ No newline at end of file diff --git a/doc/commands/list-remote-branches.md b/doc/commands/list-remote-branches.md new file mode 100644 index 00000000..d22e376a --- /dev/null +++ b/doc/commands/list-remote-branches.md @@ -0,0 +1,49 @@ +## Summary + +The `list-remote-branches` command help you find the branches to clone of a TFS server. + +## Synopsis + + Usage: git tfs list-remote-branches tfs-url-or-instance-name + git tfs list-remote-branches http://myTfsServer:8080/tfs/TfsRepository + + -h, -H, --help + -V, --version + -d, --debug Show debug output about everything git-tfs does + -u, --username=VALUE TFS username + -p, --password=VALUE TFS password +## Examples + +To display all the remotes of a TFS server, do this: + + git tfs list-remote-branches http://tfs:8080/tfs/DefaultCollection + +## Output + TFS branches that could be cloned : + + $/project/trunk [*] + | + +- $/project/branch1 + | + +- $/project/branch2 + | + +- $/project/branch3 + | + +- $/project/branch3-1 + + Cloning root branches (marked by [*]) is recommended! + +Then you can use the `[clone](clone.md)` command with the good remote branch of your choice! +However, it is recommended to clone the root branch and then use the `[branch](branch.md)` command to manage branches. + +### Authentication + +If the TFS server need an authentication, you could use the _--username_ and _--password_ parameters. If you don't specify theses informations, you will be prompted to enter them. This informations are not store by git-tfs. + + git tfs list-remote-branches http://tfs:8080/tfs/DefaultCollection -u=DISSRVTFS03\peter.pan -p=wendy + +## See also + +* [clone](clone.md) +* [quick-clone](quick-clone.md) +* [init-branch](init-branch.md) diff --git a/doc/commands/pull.md b/doc/commands/pull.md new file mode 100644 index 00000000..f6254ec3 --- /dev/null +++ b/doc/commands/pull.md @@ -0,0 +1,55 @@ +## Summary + +The `pull` command fetches TFS changesets (like the `fetch` command) and merges (or rebase) the current branch with the commits fetched (creation of a merge commit or rebase all the commits). + +## Synopsis + + Usage: git-tfs pull [options] + -h, -H, --help + -V, --version + -d, --debug Show debug output about everything git-tfs does + -i, --tfs-remote, --remote, --id=VALUE + The remote ID of the TFS to interact with + default: default + --all, --fetch-all + --parents + --authors=VALUE Path to an Authors file to map TFS users to Git + users + --ignore-regex=VALUE a regex of files to ignore + --no-metadata leave out the 'git-tfs-id:' tag in commit + messages + Use this when you're exporting from TFS and + don't need to put data back into TFS. + -u, --username=VALUE TFS username + -p, --password=VALUE TFS password + -r, --rebase rebase your modifications on tfs changes + +## Examples + +### Simple + +To pull all the changesets of the `default` branch (and create a merge commit): + + git tfs pull + +To pull all the changesets of the `default` branch and rebase your modifications onto: + + git tfs pull --rebase + +### Fetch from a branch + +To pull all the changeset of the `tfs/myBranch` branch: + + git tfs pull -i myBranch + +### Authentication + +For the use of parameters `--username` and `--password`, see the [clone](clone.md) command. + +### Map TFS users to git users + +For the use of parameter `--authors`, see the [clone](clone.md) command. + +## See also + +* [fetch](fetch.md) diff --git a/doc/commands/quick-clone.md b/doc/commands/quick-clone.md new file mode 100644 index 00000000..be693d04 --- /dev/null +++ b/doc/commands/quick-clone.md @@ -0,0 +1,89 @@ +## Summary + +The quick-clone command creates a new git repository, initialized from the last change-set in a TFS source tree, ignoring the full history. Useful for making code changes or additions where past history isn't relevant. + +## Synopsis + + Usage: git-tfs quick-clone [options] tfs-url-or-instance-name repository-path + where options are: + + -i, --id, --tfs-remote, --remote + (Type: Value required, Value Type:[String]) + An optional remote ID, useful if this repository will track multiple TFS + repositories. + + -d, --debug + (Type: Flag, Value Type:[Boolean]) + Show lots of output. + + -H, -h, --help + (Type: Flag, Value Type:[Boolean]) + ShowHelp + + -V, --version + (Type: Flag, Value Type:[Boolean]) + ShowVersion + --shared + (Type: Value required, Value Type:[Object]) + The --shared option to pass to git-init. + + --template + (Type: Value required, Value Type:[String]) + The --template option to pass to git-init. + --no-metadata + (Type: Flag, Value Type:[Boolean]) + If specified, git-tfs will leave out the git-tfs-id: lines at the end of every + commit. + + --ignore-regex + (Type: Value required, Value Type:[String]) + If specified, git-tfs will not sync any paths that match this regular expression. + --no-metadata + (Type: Flag, Value Type:[Boolean]) + If specified, git-tfs will leave out the git-tfs-id: lines at the end of every + commit. + + -p, --Password + (Type: Value required, Value Type:[String]) + Password for TFS connection + + -u, --Username + (Type: Value required, Value Type:[String]) + Username for TFS connection + + --ignore-regex + (Type: Value required, Value Type:[String]) + If specified, git-tfs will not sync any paths that match this regular expression. + -c, --changeset + (Type: Value optional, Value Type:[Int32]) + Specify a changeset to clone from + + --fetch-all, --all + (Type: Flag, Value Type:[Boolean]) + all + + -p, --parents + (Type: Flag, Value Type:[Boolean]) + parents + +## Examples + +### Simple + +To clone the latest changeset in `$/Project1` from your TFS 2010 server `tfs` +into a new directory `Project1`, do this: + + git tfs quick-clone http://tfs:8080/tfs/DefaultCollection $/Project1 + +### Excludes + +Let's say you want to clone `$/Project`, but you don't want to +clone exes. + + git tfs quick-clone --ignore-regex=exe$ http://tfs:8080/tfs/DefaultCollection $/Project1 + +## See also + +* [init](init.md) +* [fetch](fetch.md) +* [clone](clone.md) diff --git a/doc/commands/rcheckin.md b/doc/commands/rcheckin.md new file mode 100644 index 00000000..198cf1d7 --- /dev/null +++ b/doc/commands/rcheckin.md @@ -0,0 +1,104 @@ +## Summary + +Checkins path of commits from last found TFS-commit to HEAD with comments provided for corresponding git commits. Preserves merge commits. + +## Features +[Special actions in commit messages](../special-actions-in-commit-messages.md) can be inserted, to associate or resolve TFS work items or override checkin policies. + +## Synopsis + + Usage: git-tfs rcheckin [options] + where options are: + + -i, --tfs-remote, --id, --remote + (Type: Value required, Value Type:[String]) + An optional remote ID, useful if this repository will track multiple TFS repositories. + + -A, --authors=VALUE Path to an Authors file to map TFS users to Git users + + -d, --debug + (Type: Flag, Value Type:[Boolean]) + Show lots of output. + + -h, -H, --help + (Type: Flag, Value Type:[Boolean]) + ShowHelp + +## Examples + +### Simple + +Suppose you have + + A [tfs/default, C1] <- B <- C [master, HEAD] + +After executing `git tfs rcheckin` you would have + + A [C1] <- B [C2] <- C [master, HEAD, tfs/default, C3] + +Comments to B and C in TFS are preserved (same as in git excluding `git-tfs-id` markings). + +### Merge preserving + +Suppose you have + + A [tfs/default, C1] <- B <- C <- D <- E [master, HEAD] + \ / + M <------------------------ N + +So that M and N were commits on some branch and C is first parent of D which is merge-commit. After executing `git tfs rcheckin` you would have + + A [C1] <- B [C2] <- C [C3] <- D [C4] <- E [tfs/default, master, HEAD, C5] + \ / + M <--------------------- N + +Comments on B, C and E are preserved. Comment on D will have following structure: + + Comment from D + Comment from M + Comment from N + +TFS can't see M and N, so in order to preserve commit messages in its history rcheckin formats messages in this way. + +### Rcheckin on a branch + +To checkins commits on the `tfs/myBranch` branch: + + git tfs rcheckin -i myBranch + +### Rcheckin commits of other users + +_(feature in the source tree, not yet released)_ + +You could check in commits of other users in TFS. To be able to do that, you must specify the path toward an author file with the option `--authors` which permit to match TFS users to git users. See [clone](clone.md) command for more informations about the format. + + git tfs rcheckin --authors="c:\path\to\authors.txt" + +Note : To be able to check in commits of other users, you should have a special right defined in TFS. To activate, Right click on the TFS project, then "Security..." and select "Allow" to the "Check in other user's changes" permission (CheckinOther). + +## Internals + +Internally rcheckin takes from `rev-list --ancestry-path --first-parent tfs/default..HEAD` commit which is the closest derivative of tfs/default, checkins it to TFS, fetches newly checkined commit back and rebases HEAD's tail onto it. Then it repeats this process until no more commits in the ancestry-path. So, technically speaking you'll have new line of commits with same changes. It is important to know if you have some work based on some of commits being rcheckin-ed. + +## Known problems + +Suppose you have situation similar to described in 'Merge preserving' section earlier but branching takes place from one of commits being rcheckin-ed, for example from B: + + A [tfs/default, C1] <- B <- C <- D <- E [master, HEAD] + \ / + M <-- N + +Due to nature of rebase and workflow described in 'Internals' section after B will be checked in to TFS we got back new commit, say B'. And B' is not parent of M. So, when rcheckin will finish you'll have + + A [C1] <- B' [C2] <- C' [C3] <- D' [C4] <- E [tfs/default, master, HEAD, C5] + \ / + B <---------- M <--------- N + +Thus, commit B will stay in history as parent of M and equivalent commit B' will be fetched from TFS. It is confusing and hopefully will be fixed someday. + + + +## See also + +* [checkin](checkin.md) +* [checkintool](checkintool.md) diff --git a/doc/commands/shelve-list.md b/doc/commands/shelve-list.md new file mode 100644 index 00000000..d7349ff4 --- /dev/null +++ b/doc/commands/shelve-list.md @@ -0,0 +1,39 @@ +## Summary + +Lists the TFS shelvesets for the given or current user. + + Usage: git-tfs shelve-list -u [options] + -h, -H, --help + -V, --version + -d, --debug Show debug output about everything git-tfs does + -i, --tfs-remote, --remote, --id=VALUE + The remote ID of the TFS to interact with + default: default + -s, --sort=VALUE How to sort shelvesets + date, owner, name, comment + -f, --full Detailed output + -u, --user=VALUE Shelveset owner (default: current user) + Use 'all' to get all shelvesets. + +## Examples + +### List the TFS shelvesets for the current TFS user. + +`git tfs shelve-list` + +### List the TFS shelvesets for the all the TFS users. + +`git tfs shelve-list -u=all` + +### List the full defails of TFS shelvesets for the current TFS user. + +`git tfs shelve-list --full` + +### List the sorted (by date) TFS shelvesets for the current TFS user. + +`git tfs shelve-list --sort=date` + +## See also + +* [unshelve](unshelve.md) +* [shelve](unshelve.md) diff --git a/doc/commands/shelve.md b/doc/commands/shelve.md new file mode 100644 index 00000000..d392c56d --- /dev/null +++ b/doc/commands/shelve.md @@ -0,0 +1,66 @@ +## Summary +Creates a TFS shelveset from a Git branch. + + + Usage: git-tfs shelve [options] shelveset-name [ref-to-shelve] + where options are: + + -i, --id, --remote, --tfs-remote + (Type: Value required, Value Type:[String]) + An optional remote ID, useful if this repository will track multiple + TFS repositories. + + -d, --debug + (Type: Flag, Value Type:[Boolean]) + Show lots of output. + + -h, -H, --help + (Type: Flag, Value Type:[Boolean]) + ShowHelp + + -V, --version + (Type: Flag, Value Type:[Boolean]) + ShowVersion + -p, --evaluate-policies + (Type: Flag, Value Type:[Boolean]) + Evaluate checkin policies + -m, --comment + (Type: Value required, Value Type:[String]) + A comment for the changeset. + + --build-default-comment + (Type: Flag, Value Type:[Boolean]) + Use the comments from the commits on the current branch to create a + default checkin message (checkintool only) + + -f, --force + (Type: Value optional, Value Type:[String]) + To force a checkin, supply the policy override reason as an argument + to this flag. + + -w, --associated-work-item + (Type: 0 to many values accepted, Value Type:[String]) + WorkItemsToAssociate + + --resolved-work-item + (Type: 0 to many values accepted, Value Type:[String]) + WorkItemsToResolve + +## Examples + +### Shelve current branch + +`git tfs shelve MyShelvesetName` + +### Shelve another branch + +`git tfs shelve MyShlevesetName MyBranch` + +### Shelve a branch from a different remote + +`git tfs shelve MyShelveset OtherRemote/MyBranch` + +## See also + +* [unshelve](unshelve.md) +* [shelve-list](shelve-list.md) diff --git a/doc/commands/unshelve.md b/doc/commands/unshelve.md new file mode 100644 index 00000000..051cf2c6 --- /dev/null +++ b/doc/commands/unshelve.md @@ -0,0 +1,27 @@ +## Summary +Unshelves a TFS shelveset into a Git branch. + + Usage: git-tfs unshelve -u + -h, -H, --help + -V, --version + -d, --debug Show debug output about everything git-tfs does + -i, --tfs-remote, --remote, --id=VALUE + The remote ID of the TFS to interact with + default: default + -u, --user=VALUE Shelveset owner (default: current user) + Use 'all' to search all shelvesets. + +## Examples + +### Create a branch from a shelveset under the current TFS user + +`git tfs unshelve MyShelvesetName MyBranch` + +### Create a branch from a shelveset under the defined TFS user + +`git tfs unshelve -u UserName MyShelvesetName MyBranch` + +## See also + +* [shelve-list](shelve-list.md) +* [shelve](shelve.md) diff --git a/doc/commands/verify.md b/doc/commands/verify.md new file mode 100644 index 00000000..d5768758 --- /dev/null +++ b/doc/commands/verify.md @@ -0,0 +1,24 @@ +## Summary + +The verify command helps identify inaccuracies of a fetch, clone, or quick-clone from TFS. + +## Synopsis + + Usage: git-tfs verify [options] + where options are: + + -i, --id, --tfs-remote, --remote + (Type: Value required, Value Type:[String]) + An optional remote ID, useful if this repository will track multiple TFS repositories. + + -d, --debug + (Type: Flag, Value Type:[Boolean]) + Show lots of output. + + -H, -h, --help + (Type: Flag, Value Type:[Boolean]) + ShowHelp + + -V, --version + (Type: Flag, Value Type:[Boolean]) + ShowVersion diff --git a/docs/config.md b/doc/config.md similarity index 100% rename from docs/config.md rename to doc/config.md diff --git a/doc/develop-on-mono.md b/doc/develop-on-mono.md new file mode 100644 index 00000000..cb4adc86 --- /dev/null +++ b/doc/develop-on-mono.md @@ -0,0 +1,79 @@ + +## Building on Mono + +Some manual changes (see below) are required in order to build git-tfs on Mono. + +Once you have made the changes, you can use `xbuild` to build and the `mono-git-tfs` shell script to run git-tfs. + +``` +$ xbuild +... +$ ./mono-git-tfs help ++ GIT_TFS_CLIENT=Fake ++ mono ./GitTfs/bin/Debug/git-tfs.exe --version +git-tfs version 0.12.1.0 (37b71b4d) (TFS client library (FAKE)) (32-bit) +``` + +### Manual changes required to build on Mono. + +Create a script called GetCurrentVersion and make it executable. + +``` +#!/bin/sh +git show --stat HEAD +``` + +Use unix's `cp` instead of `xcopy` to copy the VsFake plugin into the runtime directory. + +``` +diff --git a/GitTfs.VsFake/GitTfs.VsFake.csproj b/GitTfs.VsFake/GitTfs.VsFake.csproj +index 86f48df..9f7d4b6 100644 +--- a/GitTfs.VsFake/GitTfs.VsFake.csproj ++++ b/GitTfs.VsFake/GitTfs.VsFake.csproj +@@ -115,6 +115,6 @@ + + --> + +- xcopy /y "$(TargetDir)*.dll" "$(SolutionDir)GitTfs\$(OutDir)" ++ cp -v $(TargetDir)*.dll $(SolutionDir)GitTfs\$(OutDir) + + +``` + +Disable building of the normal TFS plugins, and other projects that depend on them. + +```diff +diff --git a/GitTfs.sln b/GitTfs.sln +index c7ead94..3a1f885 100644 +--- a/GitTfs.sln ++++ b/GitTfs.sln +@@ -40,8 +40,6 @@ Global + {55C169E0-93CC-488C-9885-1D4EAF4EA236}.Release|x86.Build.0 = Release|x86 + {55C169E0-93CC-488C-9885-1D4EAF4EA236}.Vs2010_Debug|x86.ActiveCfg = Debug|x86 + {55C169E0-93CC-488C-9885-1D4EAF4EA236}.Vs2010_Debug|x86.Build.0 = Debug|x86 +- {DDFB4746-2BCE-4B34-8E45-056324CF140D}.Debug|x86.ActiveCfg = Debug|x86 +- {DDFB4746-2BCE-4B34-8E45-056324CF140D}.Debug|x86.Build.0 = Debug|x86 + {DDFB4746-2BCE-4B34-8E45-056324CF140D}.Release|x86.ActiveCfg = Release|x86 + {DDFB4746-2BCE-4B34-8E45-056324CF140D}.Release|x86.Build.0 = Release|x86 + {DDFB4746-2BCE-4B34-8E45-056324CF140D}.Vs2010_Debug|x86.ActiveCfg = Debug|x86 +@@ -52,19 +50,13 @@ Global + {7C7FEA7A-24A1-4834-9815-1DF980C340F3}.Release|x86.Build.0 = Release|x86 + {7C7FEA7A-24A1-4834-9815-1DF980C340F3}.Vs2010_Debug|x86.ActiveCfg = Debug|x86 + {7C7FEA7A-24A1-4834-9815-1DF980C340F3}.Vs2010_Debug|x86.Build.0 = Debug|x86 +- {09BF8124-19A8-45BE-896B-536CA0F3F0FC}.Debug|x86.ActiveCfg = Debug|x86 +- {09BF8124-19A8-45BE-896B-536CA0F3F0FC}.Debug|x86.Build.0 = Debug|x86 + {09BF8124-19A8-45BE-896B-536CA0F3F0FC}.Release|x86.ActiveCfg = Release|x86 + {09BF8124-19A8-45BE-896B-536CA0F3F0FC}.Release|x86.Build.0 = Release|x86 + {09BF8124-19A8-45BE-896B-536CA0F3F0FC}.Vs2010_Debug|x86.ActiveCfg = Debug|x86 +- {C5A374D3-A2E1-407C-9D6D-541FDB53BD62}.Debug|x86.ActiveCfg = Debug|x86 +- {C5A374D3-A2E1-407C-9D6D-541FDB53BD62}.Debug|x86.Build.0 = Debug|x86 + {C5A374D3-A2E1-407C-9D6D-541FDB53BD62}.Release|x86.ActiveCfg = Release|x86 + {C5A374D3-A2E1-407C-9D6D-541FDB53BD62}.Release|x86.Build.0 = Release|x86 + {C5A374D3-A2E1-407C-9D6D-541FDB53BD62}.Vs2010_Debug|x86.ActiveCfg = Debug|x86 + {C5A374D3-A2E1-407C-9D6D-541FDB53BD62}.Vs2010_Debug|x86.Build.0 = Debug|x86 +- {B2BF1C1C-BB58-4DEF-BFEF-DE0D2FE2E8F7}.Debug|x86.ActiveCfg = Debug|x86 +- {B2BF1C1C-BB58-4DEF-BFEF-DE0D2FE2E8F7}.Debug|x86.Build.0 = Debug|x86 + {B2BF1C1C-BB58-4DEF-BFEF-DE0D2FE2E8F7}.Release|x86.ActiveCfg = Release|x86 + {B2BF1C1C-BB58-4DEF-BFEF-DE0D2FE2E8F7}.Release|x86.Build.0 = Release|x86 + {B2BF1C1C-BB58-4DEF-BFEF-DE0D2FE2E8F7}.Vs2010_Debug|x86.ActiveCfg = Debug|x86 +``` diff --git a/doc/reporting-issues.md b/doc/reporting-issues.md new file mode 100644 index 00000000..248568c2 --- /dev/null +++ b/doc/reporting-issues.md @@ -0,0 +1,6 @@ +If you want to report an issue, please give us these informations : +- the version of git-tfs you use : `git tfs info` +- the version of TFS you use (and if that is migrated from a previous version) +- the version of Visual Studio or Team Explorer Everywhere you use (if possible) +- the debug informations when the bug could be reproduce. Just add the option `-d` to the command that do crash. +- and like all good reporting, the most informations you can on the context and what you are trying to do and steps to reproduce the problem (if possible) \ No newline at end of file diff --git a/doc/running-the-unit-tests.md b/doc/running-the-unit-tests.md new file mode 100644 index 00000000..369af1d5 --- /dev/null +++ b/doc/running-the-unit-tests.md @@ -0,0 +1,45 @@ +The unit tests for git-tfs use [xUnit.net](http://xunit.codeplex.com). All the necessary bits of xunit should be installed by nuget. + +## CI-style + +If you want to run tests like the CI build, then do this: `msbuild CI.proj`. + +## Building + +To build the tests, you only need to build the GitTfs, GitTfs.VsFake, LibGit2Sharp, and GitTfsTest projects in VS. All of these will build if you right-click on GitTfsTest and choose 'Build'. From the command-line, you can `msbuild GitTfs.sln /t:GitTfsTest`. + +## Running + +To run the tests, you can use the gui runner or the console runner. If you have a VS extension with support for xUnit.net, then you may be able to run the tests inside Visual Studio. + +### xUnit.net GUI runner + +The gui runner is `packages\xunit.runners.1.9.1\tools\xunit.gui.clr4.x86.exe`. Load the GitTfsTest assembly (i.e. GitTfsTest\bin\Debug\GitTfsTest.dll). + +### xUnit.net console runner + +Here is an example running the tests with the console runner: + +``` +C:\src\git-tfs>packages\xunit.runners.1.9.1\tools +\xunit.console.clr4.x86.exe GitTfsTest\bin\Debug\GitTfsTest.dll +xUnit.net console test runner (32-bit .NET 4.0.30319.269) +Copyright (C) 2007-11 Microsoft Corporation. + +xunit.dll: Version 1.9.1.1600 +Test assembly: C:\src\git-tfs\GitTfsTest\bin\Debug\GitTfsTest.dll + +Sep.Git.Tfs.Test.Integration.CloneTests.FailOnNoProject [SKIP] + eventually + +Sep.Git.Tfs.Test.Integration.CloneTests.ClonesEmptyProject [SKIP] + eventually + +Sep.Git.Tfs.Test.Commands.HelpTest.ShouldWriteCommandHelp [SKIP] + Not sure why this doesn't work. + +Sep.Git.Tfs.Test.Commands.HelpTest.ShouldWriteGeneralHelp [SKIP] + Not sure why this doesn't work. + +103 total, 0 failed, 4 skipped, took 16.156 seconds +``` \ No newline at end of file diff --git a/doc/special-actions-in-commit-messages.md b/doc/special-actions-in-commit-messages.md new file mode 100644 index 00000000..bafd41ab --- /dev/null +++ b/doc/special-actions-in-commit-messages.md @@ -0,0 +1,34 @@ +The [rcheckin](rcheckin.md) command reads checkin information from git commit messages +with certain git commit messages. + +* `git-tfs-work-item: ` will link the new changeset with the given work item and the default action type. +* `git-tfs-work-item: ` will link the new changeset with the given work item and the given action type. +* `git-tfs-code-reviewer: ` sets the Code Reviewer field. +* `git-tfs-security-reviewer: ` sets the Security Reviewer field. +* `git-tfs-performance-reviewer: ` sets the Performance Reviewer field. +* `git-tfs-force: ` will force the checkin, overriding TFS checkin policies with the given reason. + + +For example, the following commit message +produces the checkin comment "Make this change", +links to work item 123, +resolves work item 234, +sets George Washington as the Code Reviewer, +sets John Adams as the Security Reviewer, +sets Thomas Jefferson as the Performance Reviewer, +and overrides any checkin policy failures with the reason "Because". + +``` +commit 7440baf7ef01f9bb78d7ad02c3f1341758676ad2 +Author: Matt Burke +Date: Thu May 16 15:31:11 2013 -0400 + + Make this change + + git-tfs-work-item: 123 + git-tfs-work-item: 234 resolve + git-tfs-code-reviewer: George Washington + git-tfs-security-reviewer: John Adams + git-tfs-performance-reviewer: Thomas Jefferson + git-tfs-force: Because +``` diff --git a/doc/specify-alternate-tfs-urls.md b/doc/specify-alternate-tfs-urls.md new file mode 100644 index 00000000..3e4933ac --- /dev/null +++ b/doc/specify-alternate-tfs-urls.md @@ -0,0 +1,5 @@ +If you upgrade TFS to 2010 (or otherwise change the server URL), you will want to tell git-tfs about the change (so that it doesn't refetch the entire repository). + + git config tfs-remote.default.legacy-urls http://tfs:8080 # comma-separated list of old URLs. + git config tfs-remote.default.url http://tfs:8080/tfs/DefaultCollection # current URL. + git tfs fetch \ No newline at end of file diff --git a/doc/troubleshooting-checkin-policies.md b/doc/troubleshooting-checkin-policies.md new file mode 100644 index 00000000..d7dd350b --- /dev/null +++ b/doc/troubleshooting-checkin-policies.md @@ -0,0 +1,54 @@ +If you see an error like this: + +``` +[ERROR] Policy: Internal error in Changeset Comments Policy. +Error loading the Changeset Comments Policy policy (The policy assembly 'Microsoft.TeamFoundation.PowerTools.CheckinPolicies.ChangesetComments, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is not registered.). +Installation instructions: To install this policy, follow the instructions in CheckForComments.cs. +``` + +The first thing to check is that you can perform normal TFS checkins (in Visual Studio). If you can't, first solve that problem, and then check git-tfs again. + +If you can perform checkins in Visual Studio, then the problem is that git-tfs can't find the checkin policy (in this example above, `ChangesetComments`) that the Team Foundation Server told it to run. Depending on how this happened, there are a couple of possible solutions. + +## Git-tfs should be using the same version of Visual Studio that you are. + +Sometimes git-tfs uses a different version of Visual Studio than you are. This most commonly happens when you are developing with the previous version of Visual Studio (e.g. VS2010), and install the latest version (e.g. VS2012) to try it out, but the checkin policies are not yet registered with the new version of Visual Studio. Git-tfs by default prefers the newest version of Visual Studio. To see which version of the TFS client libraries git-tfs is using, do this: + +``` +C:\> git tfs info + +git version 1.8.0.msysgit.0 + +git-tfs version 0.16.1.0 (TFS client library 11.0.0.0 (MS)) (32-bit) + C:\tools\gittfs\git-tfs.exe +``` + +TFS client library 11 is VS 2012, 10 is VS 2010, and 9 is VS 2008. + +You can tell git-tfs to use a specific client library by setting the `GIT_TFS_CLIENT` environment variable to the version of Visual Studio you are using (e.g. `2010`). If you set this in the Environment Variables control panel, then git-tfs will use the specified client library in all future cmd windows that you open. Don't forget to relaunch your console after setting the Environment Variable otherwise the old ones will be used. + +## The checkin policies need to be registered. + +There are some cases where Visual Studio can find the checkin policy implementation, but git-tfs still can't (especially VS2012 because a bug in the install of the TFS component). This can be solved by adding information about the checkin policy to the Windows registry. + +Depending of the version of Visual Studio (here VS2012), look for the registry key : + + - for a 32bits system : + [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\11.0\TeamFoundation\SourceControl\Checkin Policies] + + - for a 64bits system : + [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\11.0\TeamFoundation\SourceControl\Checkin Policies] + +If some of the values are not set, the paths to the corresponding files should be specified. You should find and specify the paths to the assemblies. Here are the paths for a standard install of VS2012: + + - for "Microsoft.TeamFoundation.Build.Controls" : + C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PrivateAssemblies\Microsoft.TeamFoundation.Build.Controls.dll + + - for "Microsoft.TeamFoundation.VersionControl.Controls" : + C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PrivateAssemblies\Microsoft.TeamFoundation.VersionControl.Controls.dll + +You could also create a reg file using [this gist](https://gist.github.com/pmiossec/5678176). + +See [#258](https://github.com/git-tfs/git-tfs/issues/258) for [more information](https://github.com/git-tfs/git-tfs/issues/258#issuecomment-11247086) to this problem. + +(Note: this [may be caused by running git-tfs as a 32-bit executable on some 64-bit systems](https://github.com/git-tfs/git-tfs/issues/258#issuecomment-11588802).) diff --git a/doc/vsfake.md b/doc/vsfake.md new file mode 100644 index 00000000..09c7b440 --- /dev/null +++ b/doc/vsfake.md @@ -0,0 +1,30 @@ +VsFake is a stub TFS connection for git-tfs that allows git-tfs to run in the absence of a TFS server. This should enable a couple of things: + +1. Reproduction of bugs in a repeatable and portable fashion. +2. [Development on non-Windows workstations, running Mono](develop-on-mono.md). + +## Usage + +To use the VsFake driver, you will need to set the `GIT_TFS_CLIENT` environment variable. + +In cmd: + +``` +> set GIT_TFS_CLIENT=Fake +> git-tfs --version +``` + +In bash (or other bourne-style shells, e.g. zsh): + +``` +$ export GIT_TFS_CLIENT=Fake +$ git-tfs --version +# or +$ GIT_TFS_CLIENT=Fake git-tfs --version +``` + +## Status + +The plan for VsFake is to implement a mock TFS endpoint whose behavior is defined by configuration files. In development (not just on Mono), this plugin should make it easier to reproduce and investigate bugs. + +As of 30 Jan 2011, VsFake is only implemented enough for git-tfs to start and show help. diff --git a/doc/what-1.0-means.md b/doc/what-1.0-means.md new file mode 100644 index 00000000..5c96349c --- /dev/null +++ b/doc/what-1.0-means.md @@ -0,0 +1,7 @@ +Here are some things we might want to do before 1.0: + +* (required) replace (some of Process.Start and GitSharp) with LibGit2Sharp. +* (desired) speed up fetch/clone, possibly with a multi-argument form of Workspace.Get. +* (desired) use `git-config` to set command line options. For example, instead of `git tfs checkin --no-build-default-comment`, a user might be able to `git config tfs.builddefaultcomment=false` to get the same behavior. + +Feel free to pull other things in from the [Wishlist](wishlist.md). diff --git a/doc/wishlist.md b/doc/wishlist.md new file mode 100644 index 00000000..abdd64a3 --- /dev/null +++ b/doc/wishlist.md @@ -0,0 +1,19 @@ +Here are some things I'd like to do with git-tfs: + +* Figure out [what 1.0 means](what-1.0-means.md) and get there. +* Merge other forks + * non-default credentials (https://github.com/jhollingworth/git-tfs/commit/389aee4240630a1c30604d79e1194beaaa9a55bb) + * no temp file (https://github.com/JamesDunne/git-tfs/commit/2524dc2700b2836721920e0a190aeabe894d7b8d) does this work faster? does it solve the 'large file' problem? + * add a config param for using git commits in the tfs checkin comment (inspired by https://github.com/hammerdr/git-tfs/commit/7d9863775a53fd1664022cf3ff7e3920c4579f96) +* Use a newer build of henon/gitsharp to fix [the out of memory problem](https://github.com/git-tfs/git-tfs/issues/22). +* Use [libgit2/libgit2sharp](https://github.com/libgit2/libgit2sharp) for more git operations +* Clean up the object model. +* Translate TFS branches into git branches. +* Translate TFS labels into git tags. +* Faster import (clone and/or quick-clone) ([in progress](https://github.com/git-tfs/git-tfs/issues/173)) + * git-fast-import? + * TFS get specific version, then add? +* Config params to support a more concise notation for TFS server URLs and/or a default server URL. +* A more nuanced fetch spec, similar to working directory specs from TFS. +* Work in bare repositories. +* make tfs a "real" remote with git-remote-<vcs> ?