git-cvsimport: Add -A <author-conv-file> option
PATCH 1/1 git-cvsimport: Add -A <author-conv-file> option
This patch adds the option to specify an author name/email conversion file in the format
exon=Andreas Ericsson <[email protected]>
spawn=Simon Pawn <[email protected]>
which will translate the ugly cvs authornames to the more informative git style.
The info is saved in $GIT_DIR/cvs-authors, so that subsequent incremental imports will use the same author-info even if no -A option is specified. If an -A option *is* specified, the info in $GIT_DIR/cvs-authors is appended/updated appropriately.
Docs updated accordingly.
---
Documentation/git-cvsimport.txt | 20 ++++++++++++++ git-cvsimport.perl | 56 +++++++++++++++++++++++++++++++++++---- 2 files changed, 70 insertions(+), 6 deletions(-)
a1883e11a55c4684c0c5123c75425623a54f44cf
Documentation/git-cvsimport.txt +20 -0
@@ -89,6 +89,26 @@ If you need to pass multiple options, se -s <subst>:: Substitute the character "/" in branch names with <subst> +-A <author-conv-file>:: + CVS by default uses the unix username when writing its + commit logs. Using this option and an author-conv-file + in this format + + exon=Andreas Ericsson <[email protected]> + spawn=Simon Pawn <[email protected]> + + git-cvsimport will make it appear as those authors had + their GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL set properly + all along. + + For convenience, this data is saved to $GIT_DIR/cvs-authors + each time the -A option is provided and read from that same + file each time git-cvsimport is run. + + It is not recommended to use this feature if you intend to + export changes back to CVS again later with + git-link[1]::git-cvsexportcommit. + OUTPUT ------ If '-v' is specified, the script reports what it is doing.
git-cvsimport.perl +50 -6
88 lines not on this page · raw message
Signature · 1 line
1.1.1-g4c34-dirty
ISTR there was a thread that suggested using CVSROOT/users file for this purpose.
http://thread.gmane.org/gmane.comp.version-control.git/8167
Quoted 4 lines · Junio C Hamano
ISTR there was a thread that suggested using CVSROOT/users file for this purpose.
http://thread.gmane.org/gmane.comp.version-control.git/8167
This should went into docs for cvsimport. Before now I knew there is a way to import authors but I did not find anything in cvsimport script. This patch shows not only me lost this feature.
Quoted 5 lines · Junio C Hamano
ISTR there was a thread that suggested using CVSROOT/users file for this purpose.
http://thread.gmane.org/gmane.comp.version-control.git/8167
ISTR?
That patch doesn't work when importing from sourceforge (among others), because no-one uses their [email protected] address (and often just filter them out because they attract so much spam). It also does nothing for when the username isn't the leading part of the email-addres, or for GIT_AUTHOR_NAME, which is the most disturbing since it ruffles the shortlog output. We use that shortlog to get a gisted changelog for the sales and marketing people. I can recommend this. They're absolutely thrilled to see things like "Only use vararg macros #ifdef __GNUC__" and "declare **envp const throughout mplex api". ;)
Anyways, I can keep this separate if you don't want to accept it. I'll most likely implement some config-reading to it too though so I don't have to type the repository name and such each time I run it.
Signature · 3 lines
Andreas Ericsson [email protected] OP5 AB www.op5.se Tel: +46 8-230225 Fax: +46 8-230231
Quoted 6 lines · Andreas Ericsson
Quoted 3 lines · Junio C Hamano
ISTR there was a thread that suggested using CVSROOT/users file for this purpose.
http://thread.gmane.org/gmane.comp.version-control.git/8167ISTR?
I seem to recall...
Quoted 3 lines
That patch doesn't work when importing from sourceforge...
Anyways, I can keep this separate if you don't want to accept it.
Oh, I haven't formed an opinion on accept/reject yet. I was just trying to see if you are aware of that (especially Pasky's message in that thread) and thought about issues like "if in some repositories CVSROOT/users is in usable form then perhaps making sure -A file has the same format and suggest its use in the documentation would be nicer".
Quoted 10 lines · Junio C Hamano
Quoted 1 line · Andreas Ericsson
Anyways, I can keep this separate if you don't want to accept it.
Oh, I haven't formed an opinion on accept/reject yet. I was just trying to see if you are aware of that (especially Pasky's message in that thread) and thought about issues like "if in some repositories CVSROOT/users is in usable form then perhaps making sure -A file has the same format and suggest its use in the documentation would be nicer".
OK, after a little googling around, I have formed an opinion. I agree to the patch in principle, but at least it would be nicer to use "CVSROOT/users" compatible format before giving it to the general public.
http://computing.ee.ethz.ch/sepp/cvs-1.10-to/cvsbook/main_70.html
seems to indicate that:
- colon ':' is used instead of your '='.
- RHS, if it contains a whitespace, is quoted either with single or double quote.
It was a bit unclear to me how quote characters are to be quoted, so the patch needs a bit of research, quoting (when writing out new records) and unquoting (when reading) in the script, but otherwise I think it is a welcome change.
Opinions from other heavy CVS users?