Skip to content

Commit 26e1922

Browse files
committed
Merge pull request #112 from pmiossec/fix_git-tfs
Fix git tfs
2 parents 326ec06 + 8678551 commit 26e1922

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

book/09-git-and-other-scms/sections/client-tfs.asc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ If you find yourself on a team that's using TFVC but you'd rather use Git as you
1414
(((git-tf)))(((git-tfs)))
1515
In fact, there are two: git-tf and git-tfs.
1616

17-
Git-tfs (found at http://git-tfs.com[]) is a .NET project, and (as of this writing) it only runs on Windows.
17+
Git-tfs (found at https://github.com/git-tfs/git-tfs[]) is a .NET project, and (as of this writing) it only runs on Windows.
1818
To work with Git repositories, it uses the .NET bindings for libgit2, a library-oriented implementation of Git which is highly performant and allows a lot of flexibility with the guts of a Git repository.
1919
Libgit2 is not a complete implementation of Git, so to cover the difference git-tfs will actually call the command-line Git client for some operations, so there are no artificial limits on what it can do with Git repositories.
20-
Its support of TFVC features is very mature, since it uses the Visual Studio assemblies for operations with servers (however, this means you need a version of Visual Studio installed that includes access to TFVC; as of this writing, none of the free-of-charge versions of Visual Studio can connect with a TFS server).
20+
Its support of TFVC features is very mature, since it uses the Visual Studio assemblies for operations with servers.
21+
This does mean you'll need access to those assemblies, which means you need to install a recent version of Visual Studio (any edition since version 2010, including Express since version 2012), or the Visual Studio SDK.
2122

2223
Git-tf (whose home is at https://gittf.codeplex.com[]) is a Java project, and as such runs on any computer with a Java runtime environment.
2324
It interfaces with Git repositories through JGit (a JVM implementation of Git), which means it has virtually no limitations in terms of Git functions.
@@ -133,7 +134,7 @@ Git-tfs maps the branch you cloned from to `tfs/default`, and others get their o
133134

134135
Another thing to notice is the `git-tfs-id:` lines in the commit messages.
135136
Instead of tags, git-tfs uses these markers to relate TFVC changesets to Git commits.
136-
This has the implication that your Git commits may have a different SHA-1 hash before and after they has been pushed to TFVC.
137+
This has the implication that your Git commits will have a different SHA-1 hash before and after they has been pushed to TFVC.
137138

138139
===== Git-tf[s] Workflow
139140

book/09-git-and-other-scms/sections/import-tfs.asc

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
==== TFS
33

44
(((TFS)))(((Importing, from TFS)))
5-
If your team is convering their source control from TFVC to Git, you'll want the highest-fidelity conversion you can get.
5+
If your team is converting their source control from TFVC to Git, you'll want the highest-fidelity conversion you can get.
66
This means that, while we covered both git-tfs and git-tf for the interop section, we'll only be covering git-tfs for this part, because git-tfs supports branches, and this is prohibitively difficult using git-tf.
77

88
[NOTE]
@@ -17,11 +17,18 @@ You can get this information from the `tf` command-line client, like so:
1717

1818
[source,powershell]
1919
----
20-
PS> tf history $/myproject -recursive | cut -b 11-20 | tail -n+3 | uniq | sort > AUTHORS
20+
PS> tf history $/myproject -recursive > AUTHORS_TMP
2121
----
2222

23-
This grabs all of the changesets in the history of the project.
24-
The `cut` command ignores everything except characters 11-20 from each line (you'll have to experiment with the length of the fields to get these numbers right).
23+
This grabs all of the changesets in the history of the project and put it in the AUTHORS_TMP file that we will process to extract the data of the 'User' column (the 2nd one).
24+
Open the file and find at which characters start and end the column and replace, in the following command-line, the parameters `11-20` of the `cut` command with the ones found:
25+
26+
[source,powershell]
27+
----
28+
PS> cat AUTHORS_TMP | cut -b 11-20 | tail -n+3 | uniq | sort > AUTHORS
29+
----
30+
31+
The `cut` command keeps only the characters between 11 and 20 from each line.
2532
The `tail` command skips the first two lines, which are field headers and ASCII-art underlines.
2633
The result of all of this is piped to `uniq` to eliminate duplicates, and saved to a file named `AUTHORS`.
2734
The next step is manual; in order for git-tfs to make effective use of this file, each line must be in this format:

0 commit comments

Comments
 (0)