* wrapper for git.exe
authormitty <mitty@7d2118f6-f56c-43e7-95a2-4bb3031d96e7>
Sun, 14 Apr 2013 08:39:51 +0000 (08:39 +0000)
committermitty <mitty@7d2118f6-f56c-43e7-95a2-4bb3031d96e7>
Sun, 14 Apr 2013 08:39:51 +0000 (08:39 +0000)
 * 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 [new file with mode: 0644]

diff --git a/misc/git.cmd b/misc/git.cmd
new file mode 100644 (file)
index 0000000..a3b5a1c
--- /dev/null
@@ -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