From c05a8cc0e0ebd9d696f2c7fc37b36db3e3e54daa Mon Sep 17 00:00:00 2001 From: Jeff Date: Mon, 27 Apr 2026 10:49:36 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E6=97=A0=E5=8F=82=E6=95=B0=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E9=9C=80=E8=A6=81=E6=9A=82=E5=81=9C=E4=B8=8D=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E9=80=80=E5=87=BA=E3=80=82=202=E3=80=81=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E6=A0=87=E7=AD=BE=E5=90=8E=EF=BC=8C=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=88=B0=E8=BF=9C=E7=A8=8B=E4=BB=93=E5=BA=93?= =?UTF-8?q?=E4=B8=AD=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GitVer/GitVer.cpp | 2 ++ GitVer/GitVer_tag.cpp | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/GitVer/GitVer.cpp b/GitVer/GitVer.cpp index 6ee4f12..10dd7be 100644 --- a/GitVer/GitVer.cpp +++ b/GitVer/GitVer.cpp @@ -818,6 +818,8 @@ int main(int argc, TCHAR* argv[], TCHAR* envp[]) int nCmdRet = HandleCreateTagInteractive(); LogCommandEnd(_T("interactive"), dwStartTick, nCmdRet); PrintCommandFailedWithCode(_T("interactive"), nCmdRet); + // 暂停,便于查看输出日志(Windows 控制台) + system("pause"); return nCmdRet; } diff --git a/GitVer/GitVer_tag.cpp b/GitVer/GitVer_tag.cpp index 45f9db5..dc57b2d 100644 --- a/GitVer/GitVer_tag.cpp +++ b/GitVer/GitVer_tag.cpp @@ -230,6 +230,24 @@ int HandleCreateTagInteractive() return 34; } + // ֤شɹ󣬳͵Զ origin + CString strPushCmd; + strPushCmd.Format(_T("cmd /c git push origin %s"), QuoteCmdArg(strNewTag).GetString()); + CString strPushResult = StartProcess(NULL, strPushCmd.GetBuffer(), lpRepoPath); + strPushCmd.ReleaseBuffer(); + strPushResult.Trim(); + if (strPushResult.Left(6).CompareNoCase(_T("fatal:")) == 0 || strPushResult.Left(5).CompareNoCase(_T("error")) == 0) + { + _tprintf(_T(": ͱǩԶʧ: %s\n"), strPushResult.GetString()); + // ѡ񷵻طʾʧܣֻǸ澯سɹ + return 36; + } + else + { + _tprintf(_T("ɹ: ͱǩԶ origin: %s\n"), strNewTag.GetString()); + } + _tprintf(_T("ɹ: ǩ %s\n"), strNewTag.GetString()); + return 0; } \ No newline at end of file