#!/bin/bash

#set -e

function compare_cvs {
  GIT_TAG=$1

  git --git-dir=psqlodbc-migrated.git archive  -o /tmp/gitver.tar $GIT_TAG
  rm -rf /tmp/gitver
  mkdir /tmp/gitver
  tar xf /tmp/gitver.tar -C /tmp/gitver 

  # check out the same tag from CVS
  cd psqlodbc
  cvs -q update -dPC -r $GIT_TAG
  cd ..

  echo "##### Comparing $GIT_TAG #####"
  diff -u -N -r -x CVS /tmp/gitver psqlodbc
  echo "##### end comparison #####"
}




compare_cvs REL-07_02_0003
compare_cvs REL-07_02_0004
compare_cvs REL-07_02_0005
compare_cvs REL-07_03_0100
compare_cvs REL-07_03_0200
compare_cvs REL-07_03_0209
compare_cvs REL-07_03_0257
compare_cvs REL-07_03_0260
compare_cvs REL-08_00_0001
compare_cvs REL-08_00_0002
compare_cvs REL-08_00_0004
compare_cvs REL-08_00_0005
compare_cvs REL-08_00_0100
compare_cvs REL-08_00_0101
compare_cvs REL-08_00_0102
compare_cvs REL-08_00_0103
compare_cvs REL-08_01_0001
compare_cvs REL-08_01_0002
compare_cvs REL-08_01_0003
compare_cvs REL-08_01_0004
compare_cvs REL-08_01_0005
compare_cvs REL-08_01_0006
compare_cvs REL-08_01_0100
compare_cvs REL-08_01_0101
compare_cvs REL-08_01_0102
compare_cvs REL-08_01_0200
compare_cvs REL-08_02_0100
compare_cvs REL-08_02_0200
compare_cvs REL-08_02_0300
compare_cvs REL-08_02_0400
compare_cvs REL-08_02_0500
compare_cvs REL-08_03_0100
compare_cvs REL-08_03_0200
compare_cvs REL-08_03_0300
compare_cvs REL-08_03_0400
compare_cvs REL-08_04_0100
compare_cvs REL-08_04_0200
compare_cvs REL-09_00_0100
compare_cvs REL-09_00_0101
compare_cvs REL-09_00_0200
compare_cvs REL-09_00_0300
compare_cvs REL-09_00_0310
compare_cvs REL-09_01_0100
compare_cvs REL-09_01_0200
compare_cvs REL6_5
compare_cvs REL7_0
compare_cvs REL7_1
compare_cvs REL7_1_2
compare_cvs REL7_1_BETA
compare_cvs REL7_1_BETA3
compare_cvs REL7_2_BETA1
compare_cvs REL7_2_BETA2
compare_cvs REL7_2_BETA3
compare_cvs REL7_2_BETA4
compare_cvs REL7_2_BETA5
compare_cvs REL7_2_RC2
compare_cvs PRE_LIBPQ
compare_cvs REL-07_03_ENHANCED
compare_cvs REL7_0_PATCHES
