Git: Support filtering log entries by author

+ quote arguments with potential spaces.

Change-Id: Ifd1bfecd7c30d145592432dff76c72024d2b1426
Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
Orgad Shaneh
2021-12-10 13:02:13 +02:00
committed by Orgad Shaneh
parent a3af941adf
commit 32d3fa755e
3 changed files with 22 additions and 3 deletions

View File

@@ -44,6 +44,7 @@
#include <utils/algorithm.h>
#include <utils/checkablemessagebox.h>
#include <utils/commandline.h>
#include <utils/fileutils.h>
#include <utils/hostosinfo.h>
#include <utils/mimetypes/mimedatabase.h>
@@ -1137,15 +1138,19 @@ void GitClient::log(const FilePath &workingDirectory, const QString &fileName,
if (!arguments.contains(graphOption) && !arguments.contains(patchOption))
arguments << normalLogArguments();
const QString authorValue = editor->authorValue();
if (!authorValue.isEmpty())
arguments << "--author=" + ProcessArgs::quoteArg(authorValue);
const QString grepValue = editor->grepValue();
if (!grepValue.isEmpty())
arguments << "--grep=" + grepValue;
arguments << "--grep=" + ProcessArgs::quoteArg(grepValue);
const QString pickaxeValue = editor->pickaxeValue();
if (!pickaxeValue.isEmpty())
arguments << "-S" << pickaxeValue;
arguments << "-S" << ProcessArgs::quoteArg(pickaxeValue);
if ((!grepValue.isEmpty() || !pickaxeValue.isEmpty()) && !editor->caseSensitive())
if (!editor->caseSensitive())
arguments << "-i";
if (!fileName.isEmpty())