git-move-refs.py: help the user move fixup tag commits which correspond to a partial tag
James Blackburn <[email protected]> Thu, 4 Aug 2011 15:38:24 +0100
| Newsgroups | gmane.comp.version-control.subversion.cvs2svn.devel |
|---|---|
| Message-ID | <CACyv8ddH1F-MCZXF_Gg4Lpkjo+=UecgTaq=wfYp4P3sP1id3+A@mail.gmail.com> |
------=_Part_17942_1985376660.1312468707469 Content-Type: multipart/alternative; boundary="----=_Part_17943_624617534.1312468707469" ------=_Part_17943_624617534.1312468707469 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi All, As part of a large migration of an old repository. We seeing many cases where a fix-up tag commits are generated corresponding to a partial tag across the original CVS repository. i.e. the tag contains only file/folder deletions, and no file modifications or additions. The reasons for the partial tags vary from: ,v files copied into the repo at a later date, to the developer tagging part of the repo. at release rather than the full module root. It's debatable whether the conversion should remain true to the original repo. and have hundreds of fix-up tag commits, or whether the tag should be enlarged to span the complete repo. In our case, where our repo. is mostly C, where possible (and safe) it seems cleanest that these tags span the complete repo. Attached is a patch to git-move-refs.py to make it easy for the user to make this choice. Something like: # Move tags with no changes to parent python ~/work/workspaces/tools/cvs2svn/contrib/git-move-refs.py # Move tags which represent only file deletions in the repo python ~/work/workspaces/tools/cvs2svn/contrib/git-move-refs.py |sort|uniq > ../move_delete_only_tags_to_parent.sh less ../move_delete_only_tags_to_parent.sh chmod +x ../move_delete_only_tags_to_parent.sh ../move_delete_only_tags_to_parent.sh Cheers, James ------------------------------------------------------ http://cvs2svn.tigris.org/ds/viewMessage.do?dsForumId=1667&dsMessageId=2809094 To unsubscribe from this discussion, e-mail: [[email protected]]. ------=_Part_17943_624617534.1312468707469 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi All,<div><br></div><div>As part of a large migration of an old repositor= y. We seeing many cases where a fix-up tag commits are generated correspond= ing to a partial tag across the original CVS repository. =A0i.e. the tag co= ntains only file/folder deletions, and no file modifications or additions.<= /div> <div><br></div><div>The reasons for the partial tags vary from: ,v files co= pied into the repo at a later date, to the developer tagging part of the re= po. at release rather than the full module root.</div><div><br></div><div> It's debatable whether the conversion should remain true to the origina= l repo. and have hundreds of fix-up tag commits, or whether the tag should = be enlarged to span the complete repo. =A0In our case, where our repo. is m= ostly C, where possible (and safe) it seems cleanest that these tags span t= he complete repo.</div> <div><br></div><div>Attached is a patch to git-move-refs.py to make it easy= for the user to make this choice. Something like:</div><div><br></div><div= ><div># Move tags with no changes to parent</div><div>python ~/work/workspa= ces/tools/cvs2svn/contrib/git-move-refs.py</div> <div><br></div><div># Move tags which represent only file deletions in the = repo</div><div>python ~/work/workspaces/tools/cvs2svn/contrib/git-move-refs= .py |sort|uniq > ../move_delete_only_tags_to_parent.sh</div><div>less ..= /move_delete_only_tags_to_parent.sh</div> <div>chmod +x ../move_delete_only_tags_to_parent.sh</div><div>../move_delet= e_only_tags_to_parent.sh</div></div><div><br></div><div>Cheers,</div><div>J= ames</div><div><br></div><div><br></div><div><br></div> ------=_Part_17943_624617534.1312468707469-- ------=_Part_17942_1985376660.1312468707469 Content-Type: application/octet-stream; name=git-move-refs.patch Content-Transfer-Encoding: base64 X-Attachment-Id: f_gqxu1ohm1 Content-Disposition: attachment; filename=git-move-refs.patch IyMjIEVjbGlwc2UgV29ya3NwYWNlIFBhdGNoIDEuMAojUCBjdnMyc3ZuCkluZGV4OiBjb250cmli L2dpdC1tb3ZlLXJlZnMucHkKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gY29udHJpYi9naXQtbW92ZS1yZWZzLnB5 CShyZXZpc2lvbiA1MzQ0KQorKysgY29udHJpYi9naXQtbW92ZS1yZWZzLnB5CSh3b3JraW5nIGNv cHkpCkBAIC0xMCw2ICsxMCwxNCBAQAogRnVydGhlcm1vcmUsIGlmIG9uZSBvZiB0aGUgcGFyZW50 cyBvZiB0aGUgZml4dXAgY29tbWl0IGlzIGlkZW50aWNhbCB0bwogd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W4gbWF5IGFsc28gbW92ZSB0byBwYXJlbnQKKyAgICAgICAgICAgIGlmIGlz X3B1cmVfZGVsZXRlX2NvbW1pdChjb21taXQpOgorICAgICAgICAgICAgICAgIHByaW50ICIjICIg KyAoIlRhZyIgaWYgInRhZ3MiIGVsc2UgIkJyYW5jaCIpICsgIiBwb2ludHMgYXQgYSBmaXh1cCBj b21taXQgc3Bhbm5pbmcgYSBzdWJzZXQgb2YgdGhlIHJlcG9zaXRvcnkuIENvbnNpZGVyIHRhZ2dp bmcgdGhlIHdob2xlIHJlcG8gYnkgcnVubmluZzoiCisgICAgICAgICAgICAgICAgcHJpbnQgImdp dCAiICsgKCJ0YWciIGlmICJ0YWdzIiBlbHNlICJicmFuY2giKSArICIgLWYgIiArIHJlZiArICIg IiArIHAKKyAgICAgICAgICAgIAogCiAgICAgIyBSZWdpc3RlciB0aGUgcmVzdWx0aW5nIGNvbW1p dCBvYmplY3QgaW4gdGhlIHRyZWVfY2FjaGUKICAgICBhc3NlcnQgdHJlZSBub3QgaW4gdHJlZV9j YWNoZSAjIFNhbml0eSBjaGVjawo= ------=_Part_17942_1985376660.1312468707469--