2018-10-13 07:19:22 -04:00
|
|
|
@echo off
|
2020-06-01 16:11:23 -04:00
|
|
|
setlocal enabledelayedexpansion
|
2018-10-13 07:19:22 -04:00
|
|
|
|
2020-06-01 16:11:23 -04:00
|
|
|
if "%~2"=="" (
|
|
|
|
echo.
|
|
|
|
echo Parameter error.
|
|
|
|
echo Usage git-log sourcepath outputfile
|
2018-10-13 07:19:22 -04:00
|
|
|
exit /B 1
|
|
|
|
)
|
|
|
|
|
2020-06-01 16:11:23 -04:00
|
|
|
set logfile=%~2
|
|
|
|
copy nul %logfile% > nul
|
2018-10-13 07:19:22 -04:00
|
|
|
|
2020-06-01 16:11:23 -04:00
|
|
|
pushd %~1
|
2018-10-13 07:19:22 -04:00
|
|
|
|
2020-06-01 16:11:23 -04:00
|
|
|
set last=HEAD
|
|
|
|
for /f %%t in ('git tag --sort=-taggerdate --merged ^| findstr v') do (
|
|
|
|
echo generating changelog for !last!..%%t
|
|
|
|
echo ----------------------------------------------- >> %logfile%
|
|
|
|
if !last! neq HEAD (
|
|
|
|
git tag -n !last! >> %logfile%
|
2018-10-13 07:19:22 -04:00
|
|
|
) else (
|
2020-06-01 16:11:23 -04:00
|
|
|
echo HEAD >> %logfile%
|
2018-10-13 07:19:22 -04:00
|
|
|
)
|
2020-06-01 16:11:23 -04:00
|
|
|
rem echo !last! ---^> %%t >> %logfile%
|
|
|
|
echo ----------------------------------------------- >> %logfile%
|
|
|
|
echo. >> %logfile%
|
|
|
|
git log %%t..!last! --no-merges "--pretty=format:%%h %%ai %%<(10,trunc)%%an %%s" >> %logfile%
|
|
|
|
echo. >> %logfile%
|
|
|
|
echo. >> %logfile%
|
|
|
|
set last=%%t
|
2018-10-13 07:19:22 -04:00
|
|
|
)
|
|
|
|
|
2020-06-01 16:11:23 -04:00
|
|
|
echo generating changelog for %last%
|
|
|
|
echo ----------------------------------------------- >> %logfile%
|
|
|
|
git tag -n %last% >> %logfile%
|
|
|
|
echo ----------------------------------------------- >> %logfile%
|
|
|
|
echo. >> %logfile%
|
|
|
|
git log %last% --no-merges "--pretty=format:%%h %%ai %%<(10,trunc)%%an %%s" >> %logfile%
|
2018-10-13 07:19:22 -04:00
|
|
|
|
2020-06-01 16:11:23 -04:00
|
|
|
popd
|
2018-10-13 07:19:22 -04:00
|
|
|
|
2020-06-01 16:11:23 -04:00
|
|
|
endlocal enabledelayedexpansion
|