summaryrefslogtreecommitdiffstats
path: root/tools/windows/create-test-repo.bat
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2020-03-19 14:00:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2020-03-19 14:00:14 +0000
commitdf9615bac55ac6f1c3f516b66279ac0007175030 (patch)
tree84dd81d1c97835271cea7fbdd67c074742365e07 /tools/windows/create-test-repo.bat
parentInitial commit. (diff)
downloadgitlint-df9615bac55ac6f1c3f516b66279ac0007175030.tar.xz
gitlint-df9615bac55ac6f1c3f516b66279ac0007175030.zip
Adding upstream version 0.13.1.upstream/0.13.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tools/windows/create-test-repo.bat')
-rw-r--r--tools/windows/create-test-repo.bat35
1 files changed, 35 insertions, 0 deletions
diff --git a/tools/windows/create-test-repo.bat b/tools/windows/create-test-repo.bat
new file mode 100644
index 0000000..4220ad1
--- /dev/null
+++ b/tools/windows/create-test-repo.bat
@@ -0,0 +1,35 @@
+
+:: Use pushd, so we can popd back at the end (directory changes are not contained inside batch file)
+PUSHD C:\Windows\Temp
+
+:: Determine unique git repo name
+:: Note that date/time parsing on windows is locale dependent, so this might not work on every windows machine
+:: (see https://stackoverflow.com/questions/203090/how-do-i-get-current-date-time-on-the-windows-command-line-in-a-suitable-format)
+@echo off
+For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%c-%%a-%%b)
+For /f "tokens=1-2 delims=/:" %%a in ("%TIME%") do (set mytime=%%a-%%b)
+echo %mydate%_%mytime%
+
+set Reponame=gitlint-test-%mydate%_%mytime%
+echo %Reponame%
+
+:: Create git repo
+git init %Reponame%
+cd %Reponame%
+
+:: Do some basic config
+git config user.name gïtlint-test-user
+git config user.email gitlint@test.com
+git config core.quotePath false
+git config core.precomposeUnicode true
+
+:: Add a test commit
+echo "tëst 123" > test.txt
+git add test.txt
+git commit -m "test cömmit title" -m "test cömmit body that has a bit more text"
+
+:: echo. -> the dot allows us to print and empty line
+echo.
+echo Created C:\Windows\Temp\%Reponame%
+:: Move back to original dir
+POPD