MCPcopy Create free account
hub / github.com/KDE/kdevelop / parseLogOutput

Method parseLogOutput

plugins/git/gitplugin.cpp:1241–1270  ·  view source on GitHub ↗

Actually we can just copy the output without parsing. So it's a kind of draft for future

Source from the content-addressed store, hash-verified

1239
1240//Actually we can just copy the output without parsing. So it's a kind of draft for future
1241void GitPlugin::parseLogOutput(const DVcsJob* job, QVector<DVcsEvent>& commits) const
1242{
1243// static QRegExp rx_sep( "[-=]+" );
1244// static QRegExp rx_date( "date:\\s+([^;]*);\\s+author:\\s+([^;]*).*" );
1245
1246 static QRegularExpression rx_com( QStringLiteral("commit \\w{1,40}") );
1247
1248 const auto output = job->output();
1249 const auto lines = QStringView{output}.split(QLatin1Char('\n'), Qt::SkipEmptyParts);
1250
1251 DVcsEvent item;
1252 QString commitLog;
1253
1254 for (int i=0; i<lines.count(); ++i) {
1255// qCDebug(PLUGIN_GIT) << "line:" << s;
1256 if (rx_com.matchView(lines[i]).hasMatch()) {
1257// qCDebug(PLUGIN_GIT) << "MATCH COMMIT";
1258 item.setCommit(lines[++i].toString());
1259 item.setAuthor(lines[++i].toString());
1260 item.setDate(lines[++i].toString());
1261 item.setLog(commitLog);
1262 commits.append(item);
1263 }
1264 else
1265 {
1266 //FIXME: add this in a loop to the if, like in getAllCommits()
1267 commitLog += lines[i] + QLatin1Char('\n');
1268 }
1269 }
1270}
1271
1272VcsItemEvent::Actions actionsFromString(char c)
1273{

Callers

nothing calls this directly

Calls 10

outputMethod · 0.80
hasMatchMethod · 0.80
setCommitMethod · 0.80
setLogMethod · 0.80
splitMethod · 0.45
countMethod · 0.45
toStringMethod · 0.45
setAuthorMethod · 0.45
setDateMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected