Revision: 76554
http://sourceforge.net/p/brlcad/code/76554
Author: starseeker
Date: 2020-07-28 11:32:04 +0000 (Tue, 28 Jul 2020)
Log Message:
-----------
Extract CVS commit info from cvs-fast-export
This script uses a cvs-fast-export conversion of the original CVS
repository without an authormap in order to extract the original
association between commit ids and commits. Because SHA1s won't
map for the main conversion, use a combination of message SHA1
and timestamp to uniquely identify the commits. When we move to
map this information into the final commit messages, we will
need to generate a similar map between this information and the
SHA1 values in the repowork input repository. Reading both maps
will then serve as a key connecting new SHA1 values to the old
CVS data.
In addition, we also used the --first-parent option of rev-list
to follow the actual branch chains for the CVS conversions -
these will be recorded as cvs:branch: entries. Anything not
on a branch will be deemed to be cvs:branch:trunk commits.
Modified Paths:
--------------
brlcad/trunk/misc/CMakeLists.txt
Added Paths:
-----------
brlcad/trunk/misc/repoconv/cvs_info.sh
Modified: brlcad/trunk/misc/CMakeLists.txt
===================================================================
--- brlcad/trunk/misc/CMakeLists.txt 2020-07-28 10:01:44 UTC (rev 76553)
+++ brlcad/trunk/misc/CMakeLists.txt 2020-07-28 11:32:04 UTC (rev 76554)
@@ -210,6 +210,7 @@
repoconv/account-map_svnfexport.txt
repoconv/cvs_authormap
repoconv/cvs_authormap_svnfexport.txt
+ repoconv/cvs_info.sh
repoconv/email_fixups.txt
repoconv/cvs_repaired/sphflake.pix,v
repoconv/gitattributes
Added: brlcad/trunk/misc/repoconv/cvs_info.sh
===================================================================
--- brlcad/trunk/misc/repoconv/cvs_info.sh (rev 0)
+++ brlcad/trunk/misc/repoconv/cvs_info.sh 2020-07-28 11:32:04 UTC (rev
76554)
@@ -0,0 +1,77 @@
+#!/bin/bash
+if [ ! -e "cvs-fast-export" ]; then
+ curl -o cvs-fast-export.tar.gz
https://gitlab.com/esr/cvs-fast-export/-/archive/1.48/cvs-fast-export-1.48.tar.gz
+ tar -xvf cvs-fast-export.tar.gz
+ mv cvs-fast-export-1.48 cvs-fast-export
+fi
+cd cvs-fast-export && make cvs-fast-export && cd ..
+
+# To run the conversion (need to use cvs-fast-export rather than cvsconvert
+# for the actual conversion to support the authors file):
+if [ ! -e "brlcad_cvs.tar.gz" ]; then
+ curl -o brlcad_cvs.tar.gz https://brlcad.org/brlcad_cvs.tar.gz
+fi
+rm -rf brlcad_cvs
+tar -xf brlcad_cvs.tar.gz
+cd brlcad_cvs/brlcad
+
+# Create Git repository without author map (to preserve original CVS names)
+echo "Running cvs-fast-export $PWD"
+find . | ../../cvs-fast-export/cvs-fast-export > ../../brlcad_cvs_git.fi
+cd ../..
+rm -rf brlcad_cvs_git
+mkdir brlcad_cvs_git
+cd brlcad_cvs_git
+git init
+cat ../brlcad_cvs_git.fi | git fast-import
+git checkout master
+
+# Find branches
+git branch|sed -e 's/*//'|sed -e 's/ *//' > ../branches.txt
+cd ..
+
+# Find commits on branches
+rm -rf branches
+mkdir branches
+cd brlcad_cvs_git
+
+while IFS="" read -r p || [ -n "$p" ]
+do
+ printf '%s\n' "$p"
+ OFILE=$p
+ git rev-list --first-parent $p > ../branches/$OFILE
+done < ../branches.txt
+
+mv ../branches/master ..
+cd ..
+
+# Find commits unique to branches (i.e. not on master)
+rm -rf branches_uniq
+mkdir branches_uniq
+cd branches
+for f in *;
+do
+ grep -Fvx -f ../master $f > uniq.txt
+ mv uniq.txt ../branches_uniq/$f
+done
+cd ..
+mv master branches_uniq/
+
+
+# Write out information to map files, using as a key msg sha1 + date in seconds
+rm -f branchmap authormap
+cd brlcad_cvs_git
+for f in ../branches_uniq/*;
+do
+ branch="$(basename $f)"
+ while IFS="" read -r p || [ -n "$p" ]
+ do
+ MSGSHA1=$(git log -n1 --pretty=format:"%B" $p | sha1sum | head
-c 40)
+ CDATE=$(git log -n1 --pretty=format:"%ct" $p)
+ AUTHORNAME=$(git log -n1 --pretty=format:"%an" $p)
+ echo $MSGSHA1$CDATE:$branch >> ../branchmap
+ echo $MSGSHA1$CDATE:$AUTHORNAME>> ../authormap
+ done < $f
+done
+
+cd ..
Property changes on: brlcad/trunk/misc/repoconv/cvs_info.sh
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/x-sh
\ No newline at end of property
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits