From c473cda72f2ea6e3af6b16f61fd73234ba42cd8b Mon Sep 17 00:00:00 2001 From: "Mauro S. M. Rodrigues" Date: Fri, 16 Jan 2015 20:12:04 +0000 Subject: [PATCH] Fix migrate_from_tempest script to work with multiple files The '--follow' option from git log was used to follow the file even if it was renamed for instance, although the option can't deal with multiple files which was blocking us to migrate multiple files at once. This patches fixes the issue by looking one file at time and concatenating their ids in the end. Change-Id: I39a2e94e1c27a83de2b976f263928c5199d44b22 Closes-bug: #1411499 --- tools/migrate_from_tempest.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tools/migrate_from_tempest.sh b/tools/migrate_from_tempest.sh index 4751d0b..7719362 100755 --- a/tools/migrate_from_tempest.sh +++ b/tools/migrate_from_tempest.sh @@ -46,11 +46,14 @@ function count_commits { git clone $TEMPEST_GIT_URL $tmpdir cd $tmpdir -# get only commits that touch our files -commits="$(git log --format=format:%h --no-merges --follow -- $files)" -# then their merge commits - which works fina since we merge commits -# individually. -merge_commits="$(git log --format=format:%h --merges --first-parent -- $files)" +for file in $files; do + # get only commits that touch our files + commits="$commits $(git log --format=format:%h --no-merges --follow -- $file)" + # then their merge commits - which works fina since we merge commits + # individually. + merge_commits="$merge_commits $(git log --format=format:%h --merges --first-parent -- $file)" +done + pattern="\n$(echo $commits $merge_commits | sed -e 's/ /\\|/g')" # order them by filtering each one in the order it appears on rev-list