Revision abfef3bbf5f637c86032763632393ce1ffd23ccc authored by Jakob Stoklund Olesen on 17 April 2014, 06:54:05 UTC, committed by Eric Wong on 24 October 2014, 22:55:26 UTC
In a Subversion repository where many feature branches are merged into a trunk, the svn:mergeinfo property can grow very large. This severely slows down git-svn's make_log_entry() because it is checking all mergeinfo entries every time the property changes. In most cases, the additions to svn:mergeinfo since the last commit are pretty small, and there is nothing to gain by checking merges that were already checked for the last commit in the branch. Add a mergeinfo_changes() function which computes the set of interesting changes to svn:mergeinfo since the last commit. Filter out merged branches whose ranges haven't changed, and remove a common prefix of ranges from other merged branches. This speeds up "git svn fetch" by several orders of magnitude on a large repository where thousands of feature branches have been merged. Signed-off-by: Jakob Stoklund Olesen <stoklund@2pi.dk> Signed-off-by: Eric Wong <normalperson@yhbt.net>
1 parent fbecd99
convert-grafts-to-replace-refs.sh
#!/bin/sh
# You should execute this script in the repository where you
# want to convert grafts to replace refs.
GRAFTS_FILE="${GIT_DIR:-.git}/info/grafts"
. $(git --exec-path)/git-sh-setup
test -f "$GRAFTS_FILE" || die "Could not find graft file: '$GRAFTS_FILE'"
grep '^[^# ]' "$GRAFTS_FILE" |
while read definition
do
if test -n "$definition"
then
echo "Converting: $definition"
git replace --graft $definition ||
die "Conversion failed for: $definition"
fi
done
mv "$GRAFTS_FILE" "$GRAFTS_FILE.bak" ||
die "Could not rename '$GRAFTS_FILE' to '$GRAFTS_FILE.bak'"
echo "Success!"
echo "All the grafts in '$GRAFTS_FILE' have been converted to replace refs!"
echo "The grafts file '$GRAFTS_FILE' has been renamed: '$GRAFTS_FILE.bak'"
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...