Radistao ANested git repositories scripts (batch/cmd): List changes for last week (or any period of time) for certain user with/without some commit message; show current branches
@REM show current branch for every child directory, starting from current one@echo off
setSCRIPT_DIR=%~dp0setlocal EnableDelayedExpansion
for /d %%A in(%SCRIPT_DIR%*)doIFEXIST%%A\.git (rem echo %%Arem read repo namefor%%f in(%%A)dosetrepoName=%%~nxf
rem read branch namefor/f%%i in('git -C %%A rev-parse --abbrev-ref HEAD')dosetbranchName=%%i
setADJUST=!repoName! x
echo!ADJUST:~0,16! -^>!branchName!echo.
)pause
@echo off
REM list all changes by some certain user for last week.REM put this file into root directory, where all git repositories are located.REM if you want to use own git alias.hist config:REM git config --global alias.hist "log --all --pretty=format:'%h %ad%x08%x08%x08%x08%x08%x08%x08%x08%x08 | %s%d [%an]' --graph --date=iso"setAUTHOR=radistao
setSINCE=1 week ago
REM if empty - search all messagessetCOMMIT_MSG=setSCRIPT_DIR=%~dp0pushd%SCRIPT_DIR%for /d %%A in(%SCRIPT_DIR%*)doIFEXIST%%A\.git (echo.
pushd%%A
echo%%A
REM use this line if you don't have own "git config alias.hist", or second line you have it.call git --no-pager log --all ^ --pretty=format:"%%%%h %%%%ad | %%%%s%%%%d [%%%%an]"^ --graph --date=short ^ --since="%SINCE%" --author="%AUTHOR%" --grep="%COMMIT_MSG%"REM if you have hist aliasREM see https://gist.github.com/radistao/3d7b048bd0c011a2598aREM call git --no-pager hist ^ --since="%SINCE%" --author="%AUTHOR%" --grep="%COMMIT_MSG%"REM if you want date in format YYYY-MM-DD HH:MMREM call git --no-pager log --all ^ --pretty=format:"%%%%h %%%%ad%%%%x08%%%%x08%%%%x08%%%%x08%%%%x08%%%%x08%%%%x08%%%%x08%%%%x08 | %%%%s%%%%d [%%%%an]" --date=iso ^ --graph --since="%SINCE%" --regexp-ignore-case --author="%AUTHOR%" --grep="%COMMIT_MSG%"popdecho. )popd
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.