Skip to content

Commit 47076b4

Browse files
committed
Easier way to create AUTHOR file
1 parent a23c0e2 commit 47076b4

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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)