Actually we can just copy the output without parsing. So it's a kind of draft for future
| 1239 | |
| 1240 | //Actually we can just copy the output without parsing. So it's a kind of draft for future |
| 1241 | void 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 | |
| 1272 | VcsItemEvent::Actions actionsFromString(char c) |
| 1273 | { |