added personal line counting util
This commit is contained in:
parent
11c0d7b489
commit
fe5200c838
2 changed files with 70 additions and 0 deletions
42
countlines.bat
Normal file
42
countlines.bat
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
@echo off
|
||||
setlocal enabledelayedexpansion
|
||||
|
||||
for /f "delims=" %%i in ('git config user.email') do set AUTHOR=%%i
|
||||
echo Checking commit stats for %AUTHOR%...
|
||||
echo.
|
||||
|
||||
echo === Last 7 days (all .java files) ===
|
||||
git log --author="%AUTHOR%" --since="7 days ago" --pretty=tformat: --numstat | findstr "\.java" > temp_java.txt
|
||||
|
||||
set added=0
|
||||
set removed=0
|
||||
|
||||
for /f "tokens=1,2" %%a in (temp_java.txt) do (
|
||||
set /a added+=%%a
|
||||
set /a removed+=%%b
|
||||
)
|
||||
|
||||
set /a net=added-removed
|
||||
echo Lines added in .java: %added%
|
||||
echo Lines removed in .java: %removed%
|
||||
echo Net lines: %net%
|
||||
echo.
|
||||
|
||||
echo === All time (excluding *Test.java) ===
|
||||
git log --author="%AUTHOR%" --pretty=tformat: --numstat -- . ":(exclude)*Test.java" | findstr "\.java" > temp_java.txt
|
||||
|
||||
set added=0
|
||||
set removed=0
|
||||
|
||||
for /f "tokens=1,2" %%a in (temp_java.txt) do (
|
||||
set /a added+=%%a
|
||||
set /a removed+=%%b
|
||||
)
|
||||
|
||||
set /a net=added-removed
|
||||
echo Lines added in .java (excluding *Test.java): %added%
|
||||
echo Lines removed in .java (excluding *Test.java): %removed%
|
||||
echo Net lines: %net%
|
||||
|
||||
del temp_java.txt
|
||||
endlocal
|
||||
Loading…
Add table
Add a link
Reference in a new issue