diff --git a/docs/changelog.md b/docs/changelog.md index d3fbec270..333cc5dfe 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,3 +1,13 @@ +### vX.X.X - 2026-01-07 (DEV) + +Bug Fix and Feature release + +#### Added + +* Add more information about the credential stores to give the user the possibility to easily see the tradeoffs of every credential store + +---- + ### v2.0.0 - 2025-11-30 Bug Fix and Feature release diff --git a/rsrc/linux/com.github.Murmele.Gittyup.appdata.xml.in b/rsrc/linux/com.github.Murmele.Gittyup.appdata.xml.in index 23adab103..dbeadbeda 100644 --- a/rsrc/linux/com.github.Murmele.Gittyup.appdata.xml.in +++ b/rsrc/linux/com.github.Murmele.Gittyup.appdata.xml.in @@ -5,7 +5,10 @@ MIT Gittyup Graphical Git client designed to help you understand and manage your source code history - Gittyup Community + + @GITTYUP_IDENTIFIER@ + Gittyup Community +

Graphical Git client designed to help you understand and manage your source code history

@@ -22,6 +25,10 @@
+ + Development + + @GITTYUP_IDENTIFIER@.desktop diff --git a/src/cred/CredentialHelper.cpp b/src/cred/CredentialHelper.cpp index f9bc061c4..1d6569f27 100644 --- a/src/cred/CredentialHelper.cpp +++ b/src/cred/CredentialHelper.cpp @@ -25,7 +25,8 @@ namespace { const QString kLogKey = "credential/log"; const QString cacheStoreName = "cache"; -const QString storeStoreName = "store"; +const QString storeStoreName = "git-credential-store"; +const QString storeStoreNameOld = "store"; const QString osxKeyChainStoreName = "osxkeychain"; const QString winCredStoreName = "wincred"; const QString libSecretStoreName = "libsecret"; @@ -41,7 +42,8 @@ CredentialHelper *CredentialHelper::instance() { if (isHelperValid(helperName)) { if (helperName == cacheStoreName) { instance = new Cache; - } else if (helperName == storeStoreName) { + } else if (helperName == storeStoreName || + helperName == storeStoreNameOld) { auto path = QString::fromLocal8Bit(qgetenv("HOME") + "/.git-credentials"); instance = new Store(path); @@ -61,22 +63,37 @@ bool CredentialHelper::isHelperValid(const QString &name) { return !name.isEmpty(); } -QStringList CredentialHelper::getAvailableHelperNames() { - QStringList list; - list.append(cacheStoreName); - list.append(storeStoreName); +QVector +CredentialHelper::getAvailableHelperInformation() { + QVector list; + list.append(HelperInformation( + cacheStoreName, tr("Caching the credentials in the RAM. Required to " + "enter credentials on every startup"))); + list.append(HelperInformation( + storeStoreName, tr("Storing the credentials unencrypted on disk, " + "protected only by filesystem permissions git-credential-store"))); #if defined(Q_OS_MAC) - list.append(osxKeyChainStoreName); + list.append( + HelperInformation(osxKeyChainStoreName, tr("MacOS credential manager"))); #elif defined(Q_OS_WIN) - list.append(winCredStoreName); + list.append( + HelperInformation(winCredStoreName, tr("Windows credential manager"))); #else QLibrary lib("secret-1", 0); if (lib.load()) { - list.append(libSecretStoreName); + list.append(HelperInformation(libSecretStoreName, + tr("Secret Service D-Bus client library"))); } + // libsecret replaces libgnome-keyring. QLibrary lib2(gnomeKeyringStoreName, 0); if (lib2.load()) { - list.append(gnomeKeyringStoreName); + list.append(HelperInformation( + gnomeKeyringStoreName, + tr("Prefer libsecret " + "over gnome-keyring if available"))); } #endif return list; diff --git a/src/cred/CredentialHelper.h b/src/cred/CredentialHelper.h index 45a1b92f1..4096f1eb2 100644 --- a/src/cred/CredentialHelper.h +++ b/src/cred/CredentialHelper.h @@ -33,7 +33,14 @@ class CredentialHelper : public QObject { static bool isLoggingEnabled(); static void setLoggingEnabled(bool enabled); - static QStringList getAvailableHelperNames(); + struct HelperInformation { + HelperInformation(const QString &name, const QString &description) + : name(name), description(description) {} + QString name; + QString description; + }; + + static QVector getAvailableHelperInformation(); static bool isHelperValid(const QString &name); protected: diff --git a/src/cred/Store.h b/src/cred/Store.h index 88679f24a..3f4e759e1 100644 --- a/src/cred/Store.h +++ b/src/cred/Store.h @@ -13,6 +13,12 @@ #include "CredentialHelper.h" #include +/*! + * \brief The Store class + * git-credential-store + * https://git-scm.com/docs/git-credential-store + * Storing the credentials encoded but unencrypted on disk + */ class Store : public CredentialHelper { public: Store(const QString &path); diff --git a/src/dialogs/SettingsDialog.cpp b/src/dialogs/SettingsDialog.cpp index 68da02938..786f7a058 100644 --- a/src/dialogs/SettingsDialog.cpp +++ b/src/dialogs/SettingsDialog.cpp @@ -49,6 +49,7 @@ #include #include #include +#include #ifdef Q_OS_UNIX #include "cli/Installer.h" @@ -124,6 +125,8 @@ class GeneralPanel : public QWidget { connect(privacy, &QLabel::linkActivated, [] { AboutDialog::openSharedInstance(AboutDialog::Privacy); }); + mCredentialStoresDescription = new QLabel(); + QFormLayout *form = new QFormLayout; form->addRow(tr("User name:"), mName); form->addRow(tr("User email:"), mEmail); @@ -135,6 +138,8 @@ class GeneralPanel : public QWidget { form->addRow(tr("Language:"), mLanguages); form->addRow(tr("Credentials:"), mStoreCredentials); form->addRow(tr("Credential store type:"), mAvailableStores); + form->addRow(tr("Available Credential stores:"), + mCredentialStoresDescription); form->addRow(QString(), privacy); mSingleInstance = @@ -260,12 +265,25 @@ class GeneralPanel : public QWidget { auto currentHelper = config.value("credential.helper"); auto checked = CredentialHelper::isHelperValid(currentHelper); + if (!checked) { + QMessageBox msg(QMessageBox::Information, tr("No credential store set"), + tr("No credential store is set. Go to the application " + "settings to set the desired credential store")); + msg.exec(); + } mStoreCredentials->setChecked(checked); - auto availableHelpers = CredentialHelper::getAvailableHelperNames(); - foreach (auto helper, availableHelpers) { - mAvailableStores->addItem(helper); + QString info = tr("") + ""; + for (const auto &helper : + CredentialHelper::getAvailableHelperInformation()) { + info += QStringLiteral("
%1%2") + .arg(helper.name, helper.description); + mAvailableStores->addItem(helper.name); } + info += "
"; + mCredentialStoresDescription->setText(info); + mAvailableStores->setToolTip(tr("Available Credential stores")); + mAvailableStores->setWhatsThis(info); mAvailableStores->setEditable(true); mAvailableStores->setCurrentText(currentHelper); @@ -286,6 +304,7 @@ class GeneralPanel : public QWidget { QComboBox *mLanguages; QCheckBox *mStoreCredentials; QComboBox *mAvailableStores; + QLabel *mCredentialStoresDescription; QCheckBox *mSingleInstance; };