RetroShare/build_scripts/Windows-msys2/build/git-log.bat

43 lines
1.1 KiB
Batchfile
Raw Normal View History

@echo off
2020-06-01 16:11:23 -04:00
setlocal enabledelayedexpansion
2020-06-01 16:11:23 -04:00
if "%~2"=="" (
echo.
echo Parameter error.
echo Usage git-log sourcepath outputfile
exit /B 1
)
2020-06-01 16:11:23 -04:00
set logfile=%~2
copy nul %logfile% > nul
2020-06-01 16:11:23 -04:00
pushd %~1
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%
) else (
2020-06-01 16:11:23 -04:00
echo HEAD >> %logfile%
)
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
)
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%
2020-06-01 16:11:23 -04:00
popd
2020-06-01 16:11:23 -04:00
endlocal enabledelayedexpansion