Added some debug output.

This commit is contained in:
Gerhard Hoffmann 2023-08-09 15:03:14 +02:00
parent c2b52aa91d
commit 89c2d3a8ae

View File

@ -48,8 +48,9 @@ bool GitClient::gitCloneCustomerRepository() {
}
}
}
qCritical() << "ERROR CLONE RESULT HAS WRONG FORMAT. CLONE_RESULT="
<< result;
qCritical() << QString(80, '*');
qCritical() << "ERROR CLONE RESULT HAS WRONG FORMAT. CLONE_RESULT=" << result;
qCritical() << QString(80, '*');
}
return false;
}
@ -96,7 +97,9 @@ bool GitClient::gitCheckoutBranch() {
Command c(gitCommand);
return c.execute(m_customerRepository); // execute command in customerRepo
}
qCritical() << QString(80, '*');
qCritical() << "ERROR" << m_customerRepository << "DOES NOT EXIST";
qCritical() << QString(80, '*');
return false;
}
@ -108,12 +111,12 @@ bool GitClient::gitCloneAndCheckoutBranch() {
return true;
} else {
// TODO
// m_worker->terminateUpdateProcess();
}
//}
} else {
// TODO
//m_worker->terminateUpdateProcess();
qCritical() << QString(80, '*');
qInfo() << "CLONE" << m_repositoryPath << "AND CHECKOUT FAILED";
qCritical() << QString(80, '*');
}
return false;
}
@ -164,8 +167,9 @@ std::optional<QStringList> GitClient::gitDiff(QString const &commits) {
*/
std::optional<QString> GitClient::gitFetch() {
if (QDir(m_customerRepository).exists()) {
qCritical() << "BRANCH NAME" << m_branchName;
qCritical() << QString(80, '*');
qInfo() << "BRANCH NAME" << m_branchName;
qCritical() << QString(80, '*');
Command c("git fetch");
if (c.execute(m_customerRepository)) {
@ -198,26 +202,39 @@ std::optional<QString> GitClient::gitFetch() {
}
} else {
emit m_worker->showErrorMessage("git fetch",
"regex-match for commits");
"no regex-match for commits");
qCritical() << QString(80, '*');
qCritical() << "NO REGEX MATCH FOR COMMITS";
qCritical() << QString(80, '*');
}
}
}
if (!found) {
emit m_worker->showErrorMessage("git fetch",
QString("unkown branch name ") + m_branchName);
qCritical() << QString(80, '*');
qCritical() << "UNKNOWN BRANCH NAME" << m_branchName;
qCritical() << QString(80, '*');
}
} else {
emit m_worker->showErrorMessage("git fetch",
QString("wrong format for result of 'git fetch' ") + s);
qCritical() << QString(80, '*');
qCritical() << "WRONG FORMAT FOR RESULT OF 'GIT FETCH'" << s;
qCritical() << QString(80, '*');
}
} else {
emit m_worker->showErrorMessage("git fetch",
"empty result for 'git fetch'");
emit m_worker->showErrorMessage("git fetch", "empty result for 'git fetch'");
qCritical() << QString(80, '*');
qCritical() << "EMPTY RESULT FOR 'GIT FETCH'";
qCritical() << QString(80, '*');
}
}
} else {
emit m_worker->showErrorMessage("git fetch",
QString("repository ") + m_customerRepository + " does not exist");
emit m_worker->showErrorMessage("git fetch", QString("repository ") + m_customerRepository + " does not exist");
qCritical() << QString(80, '*');
qCritical() << "REPOSITORY" << m_customerRepository << "DOES NOT EXIST";
qCritical() << QString(80, '*');
}
return std::nullopt;
}
@ -238,7 +255,9 @@ bool GitClient::gitPull() {
qInfo() << "PULLED INTO" << m_customerRepository;
return true;
}
qCritical() << QString(80, '*');
qCritical() << "PULL INTO" << m_customerRepository << "FAILED";
qCritical() << QString(80, '*');
}
return false;
}