forked from qt-creator/qt-creator
Git: Add reflog
Change-Id: Id328492826bdcf4b7f7e6933a9dc3931174de0fb Reviewed-by: Petar Perisin <petar.perisin@gmail.com> Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
bbbdee7c60
commit
e1e1936073
@@ -1151,6 +1151,27 @@ void GitClient::log(const QString &workingDirectory, const QString &fileName,
|
||||
executeGit(workingDirectory, arguments, editor);
|
||||
}
|
||||
|
||||
void GitClient::reflog(const QString &workingDirectory)
|
||||
{
|
||||
const QString title = tr("Git Reflog \"%1\"").arg(workingDirectory);
|
||||
const Core::Id editorId = Git::Constants::GIT_LOG_EDITOR_ID;
|
||||
VcsBase::VcsBaseEditorWidget *editor = findExistingVCSEditor("reflogRepository", workingDirectory);
|
||||
if (!editor) {
|
||||
editor = createVcsEditor(editorId, title, workingDirectory, CodecLogOutput,
|
||||
"reflogRepository", workingDirectory, 0);
|
||||
}
|
||||
|
||||
QStringList arguments;
|
||||
arguments << QLatin1String("reflog") << QLatin1String(noColorOption)
|
||||
<< QLatin1String(decorateOption);
|
||||
|
||||
int logCount = settings()->intValue(GitSettings::logCountKey);
|
||||
if (logCount > 0)
|
||||
arguments << QLatin1String("-n") << QString::number(logCount);
|
||||
|
||||
executeGit(workingDirectory, arguments, editor);
|
||||
}
|
||||
|
||||
// Do not show "0000" or "^32ae4"
|
||||
static inline bool canShow(const QString &sha)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user