echo off echo "This batch file will create a file containing the commit messages for all commits between and old and new tag in the development branch." rem Handle some bad inputs if "%1" == "/?" goto :myErrorFunc if "%1" == "-?" goto :myErrorFunc if "%1" == "-h" goto :myErrorFunc if "%1" == "-help" goto :myErrorFunc if "%~1"=="" goto :myErrorFunc rem Checkout to update development branch rem git checkout development rem Request commital messages excluding merges between two tags and save to a file. rem See stachoverflow: https://stackoverflow.com/questions/2541767/what-is-the-proper-way-to-test-if-a-parameter-is-empty-in-a-batch-file/2544545 git log --no-merges --pretty=format:"%%s" %1...%2 > %3 goto :end :myErrorFunc echo "This batch file should be run under any folder under the C_Sharp folder git repo." echo "This batch file requires 3 parameters: OldTag NewTag OutputfileName." echo " OldTag: git tags from an old tag (e.g. TIPro_5.5.31)" echo " NewTag: git tags from an recent tag (e.g. TIPro_5.5.32)" echo " OutputfileName: name of output file (Change_Notes)" echo " Example: GetDevBranchCommitMessages.bat TIPro_5.5.10 TIPro_5.5.11 Change_Notes.txt" exit /b 1 @REM ------------------------------------------------------------------------ :end echo "Done, results in file %3."