From 8a64320214916404c148b1607ce163e1ea3c4d08 Mon Sep 17 00:00:00 2001 From: Alexander Zhirov Date: Fri, 30 May 2025 19:06:29 +0300 Subject: [PATCH 1/3] =?UTF-8?q?=D0=92=20=D0=B1=D0=B8=D0=B1=D0=BB=D0=B8?= =?UTF-8?q?=D0=BE=D1=82=D0=B5=D0=BA=D1=83=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B0=20=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8?= =?UTF-8?q?=D1=8F=20=D1=80=D0=B0=D0=B7=D0=B1=D0=B8=D1=82=D0=B8=D1=8F=20?= =?UTF-8?q?=D1=81=D1=82=D1=80=D0=BE=D0=BA=D0=B8=20=D0=BF=D0=BE=20=D0=BF?= =?UTF-8?q?=D0=B5=D1=80=D0=B2=D0=BE=D0=BC=D1=83=20=D1=81=D0=B8=D0=BC=D0=B2?= =?UTF-8?q?=D0=BE=D0=BB=D1=83=20=D0=BF=D1=80=D0=BE=D0=B1=D0=B5=D0=BB=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/snag/lib/lib.d | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/snag/lib/lib.d b/source/snag/lib/lib.d index 902691d..6db6056 100644 --- a/source/snag/lib/lib.d +++ b/source/snag/lib/lib.d @@ -2,6 +2,8 @@ module snag.lib.lib; import std.regex; import std.process; +import std.algorithm; +import std.string; bool isValidHash(string hash) { auto hashPattern = ctRegex!r"^[a-fA-F0-9]{7}$"; @@ -17,3 +19,9 @@ bool checkGit() { auto result = execute(["which", "git"]); return !result.status; } + +string[] splitByFirstSpace(string line) { + auto spaceIndex = line.indexOf(' '); + return spaceIndex == -1 ? + [line] : [line[0 .. spaceIndex], line[spaceIndex + 1..$]]; +} From 552b635b59cdce96d26645cf16521d8aa6fcb5c7 Mon Sep 17 00:00:00 2001 From: Alexander Zhirov Date: Fri, 30 May 2025 19:07:09 +0300 Subject: [PATCH 2/3] =?UTF-8?q?-=20=D0=9A=D0=BE=D1=80=D1=80=D0=B5=D0=BA?= =?UTF-8?q?=D1=82=D0=BD=D1=8B=D0=B9=20=D0=B2=D1=8B=D0=B2=D0=BE=D0=B4=20?= =?UTF-8?q?=D0=BF=D1=83=D1=82=D0=B8=20=D1=84=D0=B0=D0=B9=D0=BB=D0=B0/?= =?UTF-8?q?=D0=B4=D0=B8=D1=80=D0=B5=D0=BA=D1=82=D0=BE=D1=80=D0=B8=D0=B8=20?= =?UTF-8?q?=D0=BF=D1=80=D0=B8=20=D0=B2=D1=8B=D0=B7=D0=BE=D0=B2=D0=B5=20sta?= =?UTF-8?q?tus=20-=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=20?= =?UTF-8?q?=D0=B2=D1=8B=D0=B2=D0=BE=D0=B4=20=D1=81=D0=B5=D0=BA=D1=83=D0=BD?= =?UTF-8?q?=D0=B4=20=D0=BF=D1=80=D0=B8=20=D0=B2=D1=8B=D0=B7=D0=BE=D0=B2?= =?UTF-8?q?=D0=B5=20info?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/snag/core/core.d | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/snag/core/core.d b/source/snag/core/core.d index 9917240..156d59a 100644 --- a/source/snag/core/core.d +++ b/source/snag/core/core.d @@ -131,7 +131,7 @@ class Snag { } writeln("The following list of files requires backup:"); result.output.split('\n')[0..$-1].map!(e => - e.strip.split + e.strip.splitByFirstSpace ).each!(e => writefln("\t%s\t/%s", gitStatus(e[0], true), e[1]) ); @@ -250,7 +250,7 @@ class Snag { [ "log", "--all", - "--date=format:%Y.%m.%d %H:%M", + "--date=format:%Y.%m.%d %H:%M:%S", "--pretty=" ~ format ], "Failed to retrieve the list of snapshots" From e43b792df8bd7558bbdd0dace62199a8d2da2f30 Mon Sep 17 00:00:00 2001 From: Alexander Zhirov Date: Fri, 30 May 2025 19:11:31 +0300 Subject: [PATCH 3/3] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=B8=D0=BD=D1=84=D0=BE=D1=80=D0=BC=D0=B0=D1=86?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=B4=D0=BB=D1=8F=20=D1=84=D0=B8=D0=B4=D0=B1?= =?UTF-8?q?=D1=8D=D0=BA=D0=B0=20=D0=BF=D1=80=D0=B8=20=D0=B2=D0=BE=D0=B7?= =?UTF-8?q?=D0=BD=D0=B8=D0=BA=D0=BD=D0=BE=D0=B2=D0=B5=D0=BD=D0=B8=D0=B8=20?= =?UTF-8?q?=D0=BD=D0=B5=D0=BF=D1=80=D0=B5=D0=B4=D0=B2=D0=B8=D0=B4=D0=B5?= =?UTF-8?q?=D0=BD=D0=BD=D1=8B=D1=85=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BE=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/app.d | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/app.d b/source/app.d index a79b3f8..d952688 100644 --- a/source/app.d +++ b/source/app.d @@ -237,7 +237,9 @@ int main(string[] args) return EXIT_FAILURE; } catch (Exception e) { writeln( - "AN UNEXPECTED ERROR HAS OCCURRED! PLEASE REPORT IT TO THE AUTHOR OF THE SNAG!\n\n", + "AN UNEXPECTED ERROR HAS OCCURRED!\n", + "PLEASE REPORT IT TO THE AUTHOR OF THE SNAG: ", + "alexander@zhirov.kz (Alexander Zhirov)\n\n", e ); return EXIT_FAILURE;