diff options
author | Mauro S. M. Rodrigues <maurosr@linux.vnet.ibm.com> | 2015-01-16 20:12:04 +0000 |
---|---|---|
committer | Mauro S. M. Rodrigues <maurosr@linux.vnet.ibm.com> | 2015-01-16 20:32:58 +0000 |
commit | c473cda72f2ea6e3af6b16f61fd73234ba42cd8b (patch) | |
tree | 0ab4a40865241a847579e9e3676c6b7c7c67d3f2 | |
parent | 84dee6b7818c2c755b8338c527b0059f74f9f07a (diff) | |
download | tempest-lib-c473cda72f2ea6e3af6b16f61fd73234ba42cd8b.tar.gz |
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
-rwxr-xr-x | tools/migrate_from_tempest.sh | 13 |
1 files 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 |