From: mitty Date: Sun, 14 Apr 2013 08:39:51 +0000 (+0000) Subject: * wrapper for git.exe X-Git-Url: http://lab.mitty.jp/git/?a=commitdiff_plain;h=b14ab8eca1296a579df9f7379638e8f21cd7d3fc;p=lab.git * wrapper for git.exe * set %PROMPT% '$P (%BRANCH%) $G' while current directory is git repository git-svn-id: https://lab.mitty.jp/svn/lab/trunk@211 7d2118f6-f56c-43e7-95a2-4bb3031d96e7 --- diff --git a/misc/git.cmd b/misc/git.cmd new file mode 100644 index 0000000..a3b5a1c --- /dev/null +++ b/misc/git.cmd @@ -0,0 +1,22 @@ +@echo off + +set DEFAULT=$P$G + +git.exe %* + + +git.exe branch > NUL 2>&1 +if %ERRORLEVEL% EQU 128 goto norepos + + +for /f "tokens=2" %%i in ('git branch') do set BRANCH=%%i +prompt $P (%BRANCH%) $G + +goto end + + +:norepos +prompt %DEFAULT% + + +:end