git-migration: cvs2gi_fixes.sh (NEW) - script to fix tags in repos produced...
draenog
draenog at pld-linux.org
Tue Feb 8 21:03:43 CET 2011
Author: draenog Date: Tue Feb 8 20:03:43 2011 GMT
Module: git-migration Tag: HEAD
---- Log message:
- script to fix tags in repos produced by cvs2git
---- Files affected:
git-migration:
cvs2gi_fixes.sh (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: git-migration/cvs2gi_fixes.sh
diff -u /dev/null git-migration/cvs2gi_fixes.sh:1.1
--- /dev/null Tue Feb 8 21:03:43 2011
+++ git-migration/cvs2gi_fixes.sh Tue Feb 8 21:03:38 2011
@@ -0,0 +1,18 @@
+#!/bin/sh
+# Often in CVS repo only changed file are tagged. In this case cvs2git produces
+# superfluouss commits to delete not tagged file. Here the tag in converted git
+# repo is moved to the parent if the tagged commit:
+# 1. was made by cvs2svn
+# 2. the only change in the tree is deletion of files
+
+
+git show-ref --tags | \
+while read rev tagname; do
+ if [ `git show --format="%an" --quiet $rev` = "cvs2svn" -a \
+ -z "`git branch --contains $rev`" ]; then
+ git diff-tree --diff-filter=ACMRTUXB --quiet $rev~ $rev && \
+ git update-ref "$tagname" $rev~
+ fi
+done
+
+
================================================================
More information about the pld-cvs-commit
mailing list