Permalink
Browse files

08-git-and-other-scms: Fix command for svn author names

The command for creating the svn user list is wrong.
It does not output the list in the format which is required
by git-svn clone.
This issue has already been fixed for some languages in
commit 758d464.
This patch applies this fix for all languages.
Additionally the output is directly written into the file
users.txt where it is expected to be according to the
subsequent git-svn clone command.
  • Loading branch information...
1 parent 5b9a1a9 commit 242709838456a7be97aae819df54c7278c2d6da3 Christoph Korn committed Mar 1, 2013
@@ -362,7 +362,8 @@ However, the import isn’t perfect; and because it will take so long, you may a
To get a list of the author names that SVN uses, you can run this:
- $ svn log --xml | grep author | sort -u | perl -pe 's/.>(.?)<./$1 = /'
+ $ svn log --xml | grep -P "^<author" | sort -u | \
+ perl -pe 's/<author>(.*?)<\/author>/$1 = /' > users.txt
That gives you the log output in XML format — you can look for the authors, create a unique list, and then strip out the XML. (Obviously this only works on a machine with `grep`, `sort`, and `perl` installed.) Then, redirect that output into your users.txt file so you can add the equivalent Git user data next to each entry.
@@ -362,7 +362,8 @@ However, the import isn’t perfect; and because it will take so long, you may a
To get a list of the author names that SVN uses, you can run this:
- $ svn log --xml | grep author | sort -u | perl -pe 's/.>(.?)<./$1 = /'
+ $ svn log --xml | grep -P "^<author" | sort -u | \
+ perl -pe 's/<author>(.*?)<\/author>/$1 = /' > users.txt
That gives you the log output in XML format — you can look for the authors, create a unique list, and then strip out the XML. (Obviously this only works on a machine with `grep`, `sort`, and `perl` installed.) Then, redirect that output into your users.txt file so you can add the equivalent Git user data next to each entry.
@@ -362,7 +362,8 @@ However, the import isn’t perfect; and because it will take so long, you may a
To get a list of the author names that SVN uses, you can run this:
- $ svn log --xml | grep author | sort -u | perl -pe 's/.>(.?)<./$1 = /'
+ $ svn log --xml | grep -P "^<author" | sort -u | \
+ perl -pe 's/<author>(.*?)<\/author>/$1 = /' > users.txt
That gives you the log output in XML format — you can look for the authors, create a unique list, and then strip out the XML. (Obviously this only works on a machine with `grep`, `sort`, and `perl` installed.) Then, redirect that output into your users.txt file so you can add the equivalent Git user data next to each entry.
@@ -363,7 +363,7 @@ Takový import však není úplně dokonalý a vzhledem k tomu, jak dlouho můž
Chcete-li získat seznam jmen autorů používaných v SVN, spusťte tento příkaz:
$ svn log --xml | grep -P "^<author" | sort -u | \
- perl -pe 's/<author>(.*?)<\/author>/$1 = /'
+ perl -pe 's/<author>(.*?)<\/author>/$1 = /' > users.txt
Vytvoříte tím log ve formátu XML. Můžete v něm vyhledávat autory, vytvořit si vlastní seznam a XML zase vyjmout. (Tento příkaz pochopitelně funguje pouze na počítačích, v nichž je nainstalován `grep`, `sort` a `perl`.) Poté tento výstup přesměrujte do souboru users.txt, abyste mohli vedle každého záznamu přidat stejná data o uživatelích Git.
@@ -487,7 +487,8 @@ Trotzdem ist der Import nicht perfekt. Und weil das ziemlich lange dauern wird,
Um eine Liste der Namen der Autoren bekommen, die SVN benutzen, kannst Du folgendes Kommando ausführen:
- $ svn log --xml | grep author | sort -u | perl -pe 's/.>(.?)<./$1 = /'
+ $ svn log --xml | grep -P "^<author" | sort -u | \
+ perl -pe 's/<author>(.*?)<\/author>/$1 = /' > users.txt
<!--That gives you the log output in XML format — you can look for the authors, create a unique list, and then strip out the XML. (Obviously this only works on a machine with `grep`, `sort`, and `perl` installed.) Then, redirect that output into your users.txt file so you can add the equivalent Git user data next to each entry.-->
@@ -363,7 +363,7 @@ However, the import isn’t perfect; and because it will take so long, you may a
To get a list of the author names that SVN uses, you can run this:
$ svn log --xml | grep -P "^<author" | sort -u | \
- perl -pe 's/<author>(.*?)<\/author>/$1 = /'
+ perl -pe 's/<author>(.*?)<\/author>/$1 = /' > users.txt
That gives you the log output in XML format — you can look for the authors, create a unique list, and then strip out the XML. (Obviously this only works on a machine with `grep`, `sort`, and `perl` installed.) Then, redirect that output into your users.txt file so you can add the equivalent Git user data next to each entry.
@@ -362,7 +362,8 @@ However, the import isn’t perfect; and because it will take so long, you may a
To get a list of the author names that SVN uses, you can run this:
- $ svn log --xml | grep author | sort -u | perl -pe 's/.>(.?)<./$1 = /'
+ $ svn log --xml | grep -P "^<author" | sort -u | \
+ perl -pe 's/<author>(.*?)<\/author>/$1 = /' > users.txt
That gives you the log output in XML format — you can look for the authors, create a unique list, and then strip out the XML. (Obviously this only works on a machine with `grep`, `sort`, and `perl` installed.) Then, redirect that output into your users.txt file so you can add the equivalent Git user data next to each entry.
@@ -362,7 +362,8 @@ However, the import isn’t perfect; and because it will take so long, you may a
To get a list of the author names that SVN uses, you can run this:
- $ svn log --xml | grep author | sort -u | perl -pe 's/.>(.?)<./$1 = /'
+ $ svn log --xml | grep -P "^<author" | sort -u | \
+ perl -pe 's/<author>(.*?)<\/author>/$1 = /' > users.txt
That gives you the log output in XML format — you can look for the authors, create a unique list, and then strip out the XML. (Obviously this only works on a machine with `grep`, `sort`, and `perl` installed.) Then, redirect that output into your users.txt file so you can add the equivalent Git user data next to each entry.
@@ -446,7 +446,7 @@ Créez un fichier appelé `users.txt` contenant cette équivalence dans le forma
Pour récupérer la liste des noms d'auteurs utilisés par SVN, vous pouvez utiliser la ligne suivante :
$ svn log --xml | grep -P "^<author" | sort -u | \
- perl -pe 's/<author>(.*?)<\/author>/$1 = /'
+ perl -pe 's/<author>(.*?)<\/author>/$1 = /' > users.txt
Cela génère une sortie au format XML — vous pouvez visualiser les auteurs, créer une liste unique puis éliminer l'XML.
Évidemment, cette ligne ne fonctionne que sur une machine disposant des commandes `grep`, `sort` et `perl`.
@@ -363,7 +363,8 @@ Subversion に慣れているので SVN が出力する形式で歴史を見た
SVN で使っている作者の一覧を取得するには、このようにします。
- $ svn log --xml | grep author | sort -u | perl -pe 's/.>(.?)<./$1 = /'
+ $ svn log --xml | grep -P "^<author" | sort -u | \
+ perl -pe 's/<author>(.*?)<\/author>/$1 = /' > users.txt
これは、まずログを XML フォーマットで出力します。その中から作者を捜して重複を省き、XML を除去します (ちょっと見ればわかりますが、これは `grep` や `sort`、そして `perl` といったコマンドが使える環境でないと動きません)。この出力を users.txt にリダイレクトし、そこに Git のユーザーデータを書き足していきます。
@@ -362,7 +362,8 @@ Subversion 저장소를 클론하면 쓸데 없는 파일을 커밋하지 않도
SVN에 기록된 Author 이름은 어떤 것들이 있는지 다음 명령으로 조회한다:
- $ svn log --xml | grep author | sort -u | perl -pe 's/.>(.?)<./$1 = /'
+ $ svn log --xml | grep -P "^<author" | sort -u | \
+ perl -pe 's/<author>(.*?)<\/author>/$1 = /' > users.txt
우선 XML 형식으로 SVN 로그를 출력하고, 거기서 Author 정보만 찾고, 중복된 것을 제거하고, XML Tag는 버린다. 물론 `grep`, `sort`, `perl` 명령이 동작하는 시스템에서만 이 명령을 사용할 수 있다. 이 결과에 Git Author 정보를 더해서 `users.txt` 만든다.
@@ -362,7 +362,8 @@ However, the import isn’t perfect; and because it will take so long, you may a
To get a list of the author names that SVN uses, you can run this:
- $ svn log --xml | grep author | sort -u | perl -pe 's/.>(.?)<./$1 = /'
+ $ svn log --xml | grep -P "^<author" | sort -u | \
+ perl -pe 's/<author>(.*?)<\/author>/$1 = /' > users.txt
That gives you the log output in XML format — you can look for the authors, create a unique list, and then strip out the XML. (Obviously this only works on a machine with `grep`, `sort`, and `perl` installed.) Then, redirect that output into your users.txt file so you can add the equivalent Git user data next to each entry.
@@ -362,7 +362,8 @@ Maar, de import is niet perfect; en omdat het zo lang zal duren, kun je het maar
Om een lijst te krijgen van de auteurnamen, die SVN gebruikt kun je dit uitvoeren:
- $ svn log --xml | grep author | sort -u | perl -pe 's/.>(.?)<./$1 = /'
+ $ svn log --xml | grep -P "^<author" | sort -u | \
+ perl -pe 's/<author>(.*?)<\/author>/$1 = /' > users.txt
Daarmee krijg je de log output in XML formaat – je kunt hierin zoeken naar de auteurs, een lijst met unieke vermeldingen creëren en dan de XML eruit halen. (Dit werkt natuurlijk alleen op een machine waarop `grep`, `sort` en `Perl` geïnstalleerd is.) Daarna stuur je die output naar je users.txt bestand zodat je de gelijkwaardige Git gebruiker data naast iedere vermelding kunt zetten.
@@ -362,7 +362,8 @@ However, the import isn’t perfect; and because it will take so long, you may a
To get a list of the author names that SVN uses, you can run this:
- $ svn log --xml | grep author | sort -u | perl -pe 's/.>(.?)<./$1 = /'
+ $ svn log --xml | grep -P "^<author" | sort -u | \
+ perl -pe 's/<author>(.*?)<\/author>/$1 = /' > users.txt
That gives you the log output in XML format — you can look for the authors, create a unique list, and then strip out the XML. (Obviously this only works on a machine with `grep`, `sort`, and `perl` installed.) Then, redirect that output into your users.txt file so you can add the equivalent Git user data next to each entry.
@@ -362,7 +362,8 @@ No entanto, a importação não é perfeita; e já que vai demorar tanto tempo,
Para obter uma lista dos nomes de autores que o SVN usa, você pode executar isto:
- $ svn log --xml | grep author | sort -u | perl -pe 's/.>(.?)<./$1 = /'
+ $ svn log --xml | grep -P "^<author" | sort -u | \
+ perl -pe 's/<author>(.*?)<\/author>/$1 = /' > users.txt
Isso te dá a saída do log em formato XML — você pode pesquisar pelos autores, criar uma lista única, e depois tirar o XML. (Obviamente isso só funciona em uma máquina com `grep`, `sort`, e `perl` instalados.) Em seguida, redirecione a saída em seu arquivo users.txt assim, você pode adicionar os dados de usuários do Git equivalentes ao lado de cada entrada.
@@ -362,7 +362,8 @@ Git определяет ветку, в которую он отправит в
Для того чтобы получить список авторов, который использует SVN, вы можете выполнить следующее:
- $ svn log --xml | grep author | sort -u | perl -pe 's/.>(.?)<./$1 = /'
+ $ svn log --xml | grep -P "^<author" | sort -u | \
+ perl -pe 's/<author>(.*?)<\/author>/$1 = /' > users.txt
Это даст вам на выходе журнал в формате XML — в нём вы можете просмотреть информацию об авторах, создать из неё список с уникальными записями и избавиться от XML-разметки. (Конечно, эта команда сработает только на машине с установленными `grep`, `sort`, и `perl`). Затем перенаправьте вывод этого скрипта в свой файл users.txt, чтобы потом можно было добавить к каждой записи данные о соответствующих пользователях Git'а.
@@ -362,7 +362,8 @@ However, the import isn’t perfect; and because it will take so long, you may a
To get a list of the author names that SVN uses, you can run this:
- $ svn log --xml | grep author | sort -u | perl -pe 's/.>(.?)<./$1 = /'
+ $ svn log --xml | grep -P "^<author" | sort -u | \
+ perl -pe 's/<author>(.*?)<\/author>/$1 = /' > users.txt
That gives you the log output in XML format — you can look for the authors, create a unique list, and then strip out the XML. (Obviously this only works on a machine with `grep`, `sort`, and `perl` installed.) Then, redirect that output into your users.txt file so you can add the equivalent Git user data next to each entry.
@@ -362,7 +362,8 @@ However, the import isn’t perfect; and because it will take so long, you may a
To get a list of the author names that SVN uses, you can run this:
- $ svn log --xml | grep author | sort -u | perl -pe 's/.>(.?)<./$1 = /'
+ $ svn log --xml | grep -P "^<author" | sort -u | \
+ perl -pe 's/<author>(.*?)<\/author>/$1 = /' > users.txt
That gives you the log output in XML format — you can look for the authors, create a unique list, and then strip out the XML. (Obviously this only works on a machine with `grep`, `sort`, and `perl` installed.) Then, redirect that output into your users.txt file so you can add the equivalent Git user data next to each entry.
@@ -363,7 +363,8 @@ Git 通過搜尋提交歷史中 Subversion 分支的頭部(tip)來決定 dcommit
通過以下命令可以獲得 SVN 作者的列表:
- $ svn log --xml | grep author | sort -u | perl -pe 's/.>(.?)<./$1 = /'
+ $ svn log --xml | grep -P "^<author" | sort -u | \
+ perl -pe 's/<author>(.*?)<\/author>/$1 = /' > users.txt
它將輸出 XML 格式的日誌——你可以找到作者,建立一個單獨的列表,然後從 XML 中抽取出需要的資訊。(顯而易見,本方法要求主機上安裝了`grep`,`sort` 和 `perl`.)然後把輸出重定向到 user.txt 檔,然後就可以在每一項的後面添加相應的 Git 使用者資料。
@@ -362,7 +362,8 @@ Git 通过搜寻提交历史中 Subversion 分支的头部来决定 dcommit 的
通过该命令可以获得 SVN 作者的列表:
- $ svn log --xml | grep author | sort -u | perl -pe 's/.>(.?)<./$1 = /'
+ $ svn log --xml | grep -P "^<author" | sort -u | \
+ perl -pe 's/<author>(.*?)<\/author>/$1 = /' > users.txt
它将输出 XML 格式的日志——你可以找到作者,建立一个单独的列表,然后从 XML 中抽取出需要的信息。(显而易见,本方法要求主机上安装了`grep`,`sort` 和 `perl`.)然后把输出重定向到 user.txt 文件,然后就可以在每一项的后面添加相应的 Git 用户数据。

0 comments on commit 2427098

Please sign in to comment.