diff --git a/src/plugins/git/commitdata.cpp b/src/plugins/git/commitdata.cpp index 1bc66adf0dc..7455d05ccb7 100644 --- a/src/plugins/git/commitdata.cpp +++ b/src/plugins/git/commitdata.cpp @@ -48,7 +48,7 @@ void CommitData::clear() { panelInfo.clear(); panelData.clear(); - amendSHA1.clear(); + amendHash.clear(); enablePush = false; files.clear(); diff --git a/src/plugins/git/commitdata.h b/src/plugins/git/commitdata.h index 51dabbb808d..b8329c8db48 100644 --- a/src/plugins/git/commitdata.h +++ b/src/plugins/git/commitdata.h @@ -84,7 +84,7 @@ public: static QString stateDisplayName(const FileStates &state); CommitType commitType; - QString amendSHA1; + QString amendHash; QTextCodec *commitEncoding = nullptr; GitSubmitEditorPanelInfo panelInfo; GitSubmitEditorPanelData panelData; diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index c8b4912b2a9..f98caead913 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -1608,7 +1608,7 @@ static QString msgParentRevisionFailed(const FilePath &workingDirectory, const QString &revision, const QString &why) { - //: Failed to find parent revisions of a SHA1 for "annotate previous" + //: Failed to find parent revisions of a hash for "annotate previous" return Tr::tr("Cannot find parent revisions of \"%1\" in \"%2\": %3") .arg(revision, workingDirectory.toUserOutput(), why); } @@ -1685,7 +1685,7 @@ QString GitClient::synchronousShortDescription(const FilePath &workingDirectory, // leaving it in breaks command line quoting on Windows, see QTCREATORBUG-23208. const QString quoteReplacement = "_-_"; - // Short SHA1, author, subject + // Short hash, author, subject const QString defaultShortLogFormat = "%h (%aN " + quoteReplacement + "%s"; const int maxShortLogLength = 120; @@ -2661,7 +2661,7 @@ bool GitClient::readDataFromCommit(const FilePath &repoDirectory, const QString CommitData &commitData, QString *errorMessage, QString *commitTemplate) { - // Get commit data as "SHA1authoremailmessage". + // Get commit data as "hashauthoremailmessage". const QStringList arguments = {"log", "--max-count=1", "--pretty=format:%h\n%aN\n%aE\n%B", commit}; const CommandResult result = vcsSynchronousExec(repoDirectory, arguments, RunFlags::NoOutput); @@ -2677,7 +2677,7 @@ bool GitClient::readDataFromCommit(const FilePath &repoDirectory, const QString ? QTextCodec::codecForName("UTF-8") : commitData.commitEncoding; QByteArray stdOut = result.rawStdOut(); - commitData.amendSHA1 = QLatin1String(shiftLogLine(stdOut)); + commitData.amendHash = QLatin1String(shiftLogLine(stdOut)); commitData.panelData.author = authorCodec->toUnicode(shiftLogLine(stdOut)); commitData.panelData.email = authorCodec->toUnicode(shiftLogLine(stdOut)); if (commitTemplate) @@ -2800,7 +2800,7 @@ bool GitClient::getCommitData(const FilePath &workingDirectory, // For cherry-picked commit, read author data from the commit (but template from MERGE_MSG) if (gitDir.pathAppended(CHERRY_PICK_HEAD).exists()) { authorFromCherryPick = readDataFromCommit(repoDirectory, CHERRY_PICK_HEAD, commitData); - commitData.amendSHA1.clear(); + commitData.amendHash.clear(); } if (!authorFromCherryPick) { const Author author = getAuthor(workingDirectory); @@ -2839,19 +2839,19 @@ bool GitClient::getCommitData(const FilePath &workingDirectory, } // Log message for commits/amended commits to go to output window -static inline QString msgCommitted(const QString &amendSHA1, int fileCount) +static inline QString msgCommitted(const QString &amendHash, int fileCount) { - if (amendSHA1.isEmpty()) + if (amendHash.isEmpty()) return Tr::tr("Committed %n files.", nullptr, fileCount); if (fileCount) - return Tr::tr("Amended \"%1\" (%n files).", nullptr, fileCount).arg(amendSHA1); - return Tr::tr("Amended \"%1\".").arg(amendSHA1); + return Tr::tr("Amended \"%1\" (%n files).", nullptr, fileCount).arg(amendHash); + return Tr::tr("Amended \"%1\".").arg(amendHash); } bool GitClient::addAndCommit(const FilePath &repositoryDirectory, const GitSubmitEditorPanelData &data, CommitType commitType, - const QString &amendSHA1, + const QString &amendHash, const FilePath &messageFile, SubmitFileModel *model) { @@ -2914,7 +2914,7 @@ bool GitClient::addAndCommit(const FilePath &repositoryDirectory, // Do the final commit QStringList arguments = {"commit"}; if (commitType == FixupCommit) { - arguments << "--fixup" << amendSHA1; + arguments << "--fixup" << amendHash; } else { arguments << "-F" << messageFile.nativePath(); if (commitType == AmendCommit) @@ -2931,7 +2931,7 @@ bool GitClient::addAndCommit(const FilePath &repositoryDirectory, const CommandResult result = vcsSynchronousExec(repositoryDirectory, arguments, RunFlags::UseEventLoop); if (result.result() == ProcessResult::FinishedWithSuccess) { - VcsOutputWindow::appendMessage(msgCommitted(amendSHA1, commitCount)); + VcsOutputWindow::appendMessage(msgCommitted(amendHash, commitCount)); updateCurrentBranch(); return true; } @@ -3449,9 +3449,9 @@ bool GitClient::synchronousStashRemove(const FilePath &workingDirectory, const Q } /* Parse a stash line in its 2 manifestations (with message/without message containing - * +subject): + * +subject): \code -stash@{1}: WIP on : +stash@{1}: WIP on : stash@{2}: On : \endcode */ diff --git a/src/plugins/git/gitclient.h b/src/plugins/git/gitclient.h index 18ca49ff838..e7a91bda0b1 100644 --- a/src/plugins/git/gitclient.h +++ b/src/plugins/git/gitclient.h @@ -303,7 +303,7 @@ public: bool addAndCommit(const Utils::FilePath &workingDirectory, const GitSubmitEditorPanelData &data, CommitType commitType, - const QString &amendSHA1, + const QString &amendHash, const Utils::FilePath &messageFile, VcsBase::SubmitFileModel *model); diff --git a/src/plugins/git/giteditor.cpp b/src/plugins/git/giteditor.cpp index ded53ff5dfe..aa5cd86be34 100644 --- a/src/plugins/git/giteditor.cpp +++ b/src/plugins/git/giteditor.cpp @@ -272,7 +272,7 @@ void GitEditorWidget::aboutToOpen(const FilePath &filePath, const FilePath &real QString GitEditorWidget::decorateVersion(const QString &revision) const { - // Format verbose, SHA1 being first token + // Format verbose, hash being first token return gitClient().synchronousShortDescription(sourceWorkingDirectory(), revision); } @@ -280,7 +280,7 @@ QStringList GitEditorWidget::annotationPreviousVersions(const QString &revision) { QStringList revisions; QString errorMessage; - // Get the SHA1's of the file. + // Get the hashes of the file. if (!gitClient().synchronousParentRevisions( sourceWorkingDirectory(), revision, &revisions, &errorMessage)) { VcsOutputWindow::appendSilently(errorMessage); diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index b9035562b3b..9a5589b2284 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -1362,7 +1362,7 @@ IEditor *GitPluginPrivate::openSubmitEditor(const FilePath &fileName, const Comm QString title; switch (cd.commitType) { case AmendCommit: - title = Tr::tr("Amend %1").arg(cd.amendSHA1); + title = Tr::tr("Amend %1").arg(cd.amendHash); break; case FixupCommit: title = Tr::tr("Git Fixup Commit"); @@ -1393,14 +1393,14 @@ bool GitPluginPrivate::activateCommit() auto model = qobject_cast(editor->fileModel()); const CommitType commitType = editor->commitType(); - const QString amendSHA1 = editor->amendSHA1(); - if (model->hasCheckedFiles() || !amendSHA1.isEmpty()) { + const QString amendHash = editor->amendHash(); + if (model->hasCheckedFiles() || !amendHash.isEmpty()) { // get message & commit if (!DocumentManager::saveDocument(editorDocument)) return false; if (!gitClient().addAndCommit(m_submitRepository, editor->panelData(), commitType, - amendSHA1, m_commitMessageFileName, model)) { + amendHash, m_commitMessageFileName, model)) { editor->updateFileModel(); return false; } @@ -1411,7 +1411,7 @@ bool GitPluginPrivate::activateCommit() NoPrompt, editor->panelData().pushAction)) { return false; } - gitClient().interactiveRebase(m_submitRepository, amendSHA1, true); + gitClient().interactiveRebase(m_submitRepository, amendHash, true); } else { gitClient().continueCommandIfNeeded(m_submitRepository); if (editor->panelData().pushAction == NormalPush) { diff --git a/src/plugins/git/gitsubmiteditor.cpp b/src/plugins/git/gitsubmiteditor.cpp index 1e09d6ec9dc..78d51edad84 100644 --- a/src/plugins/git/gitsubmiteditor.cpp +++ b/src/plugins/git/gitsubmiteditor.cpp @@ -106,7 +106,7 @@ void GitSubmitEditor::setCommitData(const CommitData &d) m_commitEncoding = d.commitEncoding; m_workingDirectory = d.panelInfo.repository; m_commitType = d.commitType; - m_amendSHA1 = d.amendSHA1; + m_amenHash = d.amendHash; GitSubmitEditorWidget *w = submitEditorWidget(); w->initialize(m_workingDirectory, d); @@ -243,10 +243,10 @@ GitSubmitEditorPanelData GitSubmitEditor::panelData() const return submitEditorWidget()->panelData(); } -QString GitSubmitEditor::amendSHA1() const +QString GitSubmitEditor::amendHash() const { - const QString commit = submitEditorWidget()->amendSHA1(); - return commit.isEmpty() ? m_amendSHA1 : commit; + const QString commit = submitEditorWidget()->amendHash(); + return commit.isEmpty() ? m_amenHash : commit; } QByteArray GitSubmitEditor::fileContents() const diff --git a/src/plugins/git/gitsubmiteditor.h b/src/plugins/git/gitsubmiteditor.h index 83f7b78ee53..4c7c2e0161f 100644 --- a/src/plugins/git/gitsubmiteditor.h +++ b/src/plugins/git/gitsubmiteditor.h @@ -40,7 +40,7 @@ public: void setCommitData(const CommitData &); GitSubmitEditorPanelData panelData() const; CommitType commitType() const { return m_commitType; } - QString amendSHA1() const; + QString amendHash() const; void updateFileModel() override; protected: @@ -58,7 +58,7 @@ private: VcsBase::SubmitFileModel *m_model = nullptr; QTextCodec *m_commitEncoding = nullptr; CommitType m_commitType = SimpleCommit; - QString m_amendSHA1; + QString m_amenHash; Utils::FilePath m_workingDirectory; bool m_firstUpdate = true; QFutureWatcher m_fetchWatcher; diff --git a/src/plugins/git/gitsubmiteditorwidget.cpp b/src/plugins/git/gitsubmiteditorwidget.cpp index a6635104ea7..d381a8284da 100644 --- a/src/plugins/git/gitsubmiteditorwidget.cpp +++ b/src/plugins/git/gitsubmiteditorwidget.cpp @@ -128,7 +128,7 @@ void GitSubmitEditorWidget::setPanelInfo(const GitSubmitEditorPanelInfo &info) } } -QString GitSubmitEditorWidget::amendSHA1() const +QString GitSubmitEditorWidget::amendHash() const { return m_logChangeWidget ? m_logChangeWidget->commit() : QString(); } diff --git a/src/plugins/git/gitsubmiteditorwidget.h b/src/plugins/git/gitsubmiteditorwidget.h index f15aba5570d..0b8f07c9857 100644 --- a/src/plugins/git/gitsubmiteditorwidget.h +++ b/src/plugins/git/gitsubmiteditorwidget.h @@ -39,7 +39,7 @@ public: GitSubmitEditorWidget(); GitSubmitEditorPanelData panelData() const; - QString amendSHA1() const; + QString amendHash() const; void setHasUnmerged(bool e); void initialize(const Utils::FilePath &repository, const CommitData &data); void refreshLog(const Utils::FilePath &repository); diff --git a/src/plugins/git/instantblame.cpp b/src/plugins/git/instantblame.cpp index 227dbb9d2be..1a8bc3487a4 100644 --- a/src/plugins/git/instantblame.cpp +++ b/src/plugins/git/instantblame.cpp @@ -254,7 +254,7 @@ void InstantBlame::setup() // Porcelain format of git blame output: // Consists of 12 or 13 lines (line 11 can be missing, "boundary", or "previous") -// The first line contains SHA-1, original line, current line, +// The first line contains hash, original line, current line, // and optional the number of lines in this group when blaming multiple lines. // The last line starts with a tab and is followed by the actual file content. // ---------------------------------------------------------------------------- diff --git a/src/plugins/git/logchangedialog.cpp b/src/plugins/git/logchangedialog.cpp index a1091683311..739e40b8335 100644 --- a/src/plugins/git/logchangedialog.cpp +++ b/src/plugins/git/logchangedialog.cpp @@ -30,7 +30,7 @@ namespace Git::Internal { enum Columns { - Sha1Column, + HashColumn, SubjectColumn, ColumnCount }; @@ -43,7 +43,7 @@ public: QVariant data(const QModelIndex &index, int role) const override { if (role == Qt::ToolTipRole) { - const QString revision = index.sibling(index.row(), Sha1Column).data(Qt::EditRole).toString(); + const QString revision = index.sibling(index.row(), HashColumn).data(Qt::EditRole).toString(); const auto it = m_descriptions.constFind(revision); if (it != m_descriptions.constEnd()) return *it; @@ -92,8 +92,8 @@ bool LogChangeWidget::init(const FilePath &repository, const QString &commit, Lo QString LogChangeWidget::commit() const { - if (const QStandardItem *sha1Item = currentItem(Sha1Column)) - return sha1Item->text(); + if (const QStandardItem *hashItem = currentItem(HashColumn)) + return hashItem->text(); return {}; } @@ -109,7 +109,7 @@ QString LogChangeWidget::earliestCommit() const { int rows = m_model->rowCount(); if (rows) { - if (const QStandardItem *item = m_model->item(rows - 1, Sha1Column)) + if (const QStandardItem *item = m_model->item(rows - 1, HashColumn)) return item->text(); } return {}; @@ -124,7 +124,7 @@ void LogChangeWidget::setItemDelegate(QAbstractItemDelegate *delegate) void LogChangeWidget::emitCommitActivated(const QModelIndex &index) { if (index.isValid()) { - const QString commit = index.sibling(index.row(), Sha1Column).data().toString(); + const QString commit = index.sibling(index.row(), HashColumn).data().toString(); if (!commit.isEmpty()) emit commitActivated(commit); } @@ -157,7 +157,7 @@ bool LogChangeWidget::populateLog(const FilePath &repository, const QString &com if (const int rowCount = m_model->rowCount()) m_model->removeRows(0, rowCount); - // Retrieve log using a custom format "Sha1:Subject [(refs)]" + // Retrieve log using a custom format "Hash:Subject [(refs)]" QStringList arguments; arguments << "--max-count=1000" << "--format=%h:%s %d"; arguments << (commit.isEmpty() ? "HEAD" : commit); @@ -188,11 +188,11 @@ bool LogChangeWidget::populateLog(const FilePath &repository, const QString &com } row.push_back(item); } - const QString sha1 = line.left(colonPos); - row[Sha1Column]->setText(sha1); + const QString hash = line.left(colonPos); + row[HashColumn]->setText(hash); row[SubjectColumn]->setText(line.right(line.size() - colonPos - 1)); m_model->appendRow(row); - if (selected == -1 && currentCommit == sha1) + if (selected == -1 && currentCommit == hash) selected = m_model->rowCount() - 1; } } diff --git a/src/plugins/git/logchangedialog.h b/src/plugins/git/logchangedialog.h index 1cdf2c4766f..932fcdf887e 100644 --- a/src/plugins/git/logchangedialog.h +++ b/src/plugins/git/logchangedialog.h @@ -22,7 +22,7 @@ namespace Git::Internal { class LogChangeModel; -// A widget that lists SHA1 and subject of the changes +// A widget that lists hash and subject of the changes // Used for reset and interactive rebase class LogChangeWidget : public Utils::TreeView