blob: 96f3b90646ba638623c68cf810f896ae882f66a0 [file] [log] [blame]
garciadeblasb90cbe62022-02-01 00:06:42 +01001#!/bin/bash
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14#
15
16if [ $# -ne 2 ]; then
17 echo "Usage $0 <branch> <from_tag>"
18 echo " It will list all the changes in branch <branch> from <from_tag> to the HEAD of the branch"
19 echo " Example: $0 v11.0 v11.0.0"
20 echo " Example: $0 v10.0 v10.0.3"
21 exit 1
22fi
23
24BRANCH="$1"
25FROM_REF="$2"
26TO_REF="HEAD"
27
28OSM_CHANGES_FOLDER="$(mktemp -d -q --tmpdir "osmchanges.XXXXXX")"
29echo "Changes in branch ${BRANCH} from ${FROM_REF} to ${TO_REF} stored in ${OSM_CHANGES_FOLDER}"
30
31#trap 'rm -rf "${OSM_CHANGES_FOLDER}"' EXIT
32
33touch "${OSM_CHANGES_FOLDER}/osm_changes-${BRANCH}-from${FROM_REF}-to${TO_REF}.log"
34
35for repo in NBI osmclient IM NG-UI N2VC NG-UI MON POL PLA RO SOL005 common devops tests; do
36 echo ${repo}
37 git -C ${OSM_CHANGES_FOLDER} clone "https://osm.etsi.org/gerrit/osm/${repo}"
38 git -C ${OSM_CHANGES_FOLDER}/$repo checkout ${BRANCH}
39 git -C ${OSM_CHANGES_FOLDER}/$repo log --pretty=format:"%C(yellow)%h %Cblue%ad %Cgreen%>(13,trunc)%an%Cred%d %Creset%s" --date=short ${FROM_REF}..${TO_REF} > "${OSM_CHANGES_FOLDER}/${repo}_changes-${BRANCH}-from${FROM_REF}-to${TO_REF}.log"
40 echo ${repo} >> "${OSM_CHANGES_FOLDER}/osm_changes-${BRANCH}-from${FROM_REF}-to${TO_REF}.log"
41 git -C ${OSM_CHANGES_FOLDER}/$repo log --pretty=format:"%C(yellow)%h %Cblue%ad %Cgreen%>(13,trunc)%an%Cred%d %Creset%s" --date=short ${FROM_REF}..${TO_REF} >> "${OSM_CHANGES_FOLDER}/osm_changes-${BRANCH}-from${FROM_REF}-to${TO_REF}.log"
42 echo >> "${OSM_CHANGES_FOLDER}/osm_changes-${BRANCH}-from${FROM_REF}-to${TO_REF}.log"
43done
44
45echo "Changes in branch ${BRANCH} from ${FROM_REF} to ${TO_REF} stored in ${OSM_CHANGES_FOLDER}"
46echo "All changes can be found in ${OSM_CHANGES_FOLDER}/osm_changes-${BRANCH}-from${FROM_REF}-to${TO_REF}.log"
47