From b14ab8eca1296a579df9f7379638e8f21cd7d3fc Mon Sep 17 00:00:00 2001 From: mitty Date: Sun, 14 Apr 2013 08:39:51 +0000 Subject: [PATCH] * 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 --- misc/git.cmd | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 misc/git.cmd 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 -- 1.7.9.5