Commit Graph

858 Commits

Author SHA1 Message Date
Orgad Shaneh
0d600b0761 Git: Support HOMEDRIVE/HOMEPATH home directory
MSYS is using %HOMEDRIVE%%HOMEPATH% as home if exists, and falls back to
%USERPROFILE%. So Git settings are supposed to be in HOMEDRIVE on this
case.

Change-Id: Ia15fd30031eedd3e7669e63b265bed83b03518c8
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2022-01-22 19:40:00 +00:00
Orgad Shaneh
32d3fa755e Git: Support filtering log entries by author
+ quote arguments with potential spaces.

Change-Id: Ifd1bfecd7c30d145592432dff76c72024d2b1426
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2021-12-12 13:55:33 +00:00
Orgad Shaneh
f02d143a81 Git: Fix wording and availability of actions for commit range
Change-Id: Ic3a038b8246e9e6b69ae18fce519f93a685dc10c
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2021-12-02 12:55:52 +00:00
hjk
652b9844e6 Utils: FilePathify Environment::{ap,pre}pendOrSetPath etc
Change-Id: Idfa5ec247337570936b0236cab9d3a5669792ca0
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-11-10 07:26:31 +00:00
Jarek Kobus
b6228eb182 Fix signal slot connection
QtcProcess isn't derived from QProcess anymore.

Change-Id: I6c92163cc0bb73dc8e350ffa05ecbb5a25a88f9a
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-11-03 13:46:20 +00:00
Eike Ziller
6ba849ee6e Merge remote-tracking branch 'origin/5.0' into 6.0
Change-Id: I1244ca0b6193d00ded38e5d4c12b605f4e96fdae
2021-09-30 09:00:11 +02:00
hjk
b5a4d38022 Git: Take Prepend to PATH into account again
Task-number: QTCREATORBUG-26329
Change-Id: If4ac35cc95a47e4f82c6205ad24d8bdc69ddf1af
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-09-29 15:42:32 +00:00
Artem Sokolovskii
48b4af21aa Vcs: Use QtcProcess
Change-Id: I5fb19144b17b817a783fcf927f3a74dbdaaa97ab
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-08-25 12:28:39 +00:00
hjk
4bf6008158 Vcs: Use FilePath for working directory in DiffEditorController
Change-Id: I7b5e1349bc679bd90b7781fbe0b40485ec653473
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-08-20 15:06:26 +00:00
hjk
2adaea866f Git: Use QtcProcess in GitClient
Change-Id: Ia92d803ea8f647681ab5ffe51fa9a55bd5924df7
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-08-20 12:14:51 +00:00
hjk
584217a52f Use more FileUtils based file dialogs
Change-Id: I1e7ec0493c26afe58e17afb8923a2b1023f6dcd4
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-08-19 08:33:22 +00:00
hjk
ab98f31a1d Git: FilePathify GitClient::tryLauchingGitK and surroundings
Change-Id: Icdbd0aab546824c9213402169a165290dd86d3c5
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-08-17 11:47:34 +00:00
hjk
bbde6ac9bf VCS: Use more FilePath in ShellCommand and surroundings
Change-Id: Ie8c5fac09b45a54bcbe9a876044b653e7fccede5
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-08-17 07:16:04 +00:00
hjk
7c28c4f744 Utils: Introduce a FilePath constructor from char arrays
Similar to QT_RESTRICTED_CAST_FROM_ASCII to avoid the need for
decorations in user code.

At the same time, drop some convenience constructors and functions
in CommandLine and Icon essentially serving the same purpose.

Change-Id: Ida4e5ac19c2da0a4298a97b2a8e1511d56bbb79d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-17 05:34:10 +00:00
hjk
b72582c050 Git: Use FilePath in findRepositoryForDirectory
Change-Id: Ia711377111d529e14ed864669df83e1b1bb2bfc9
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-08-02 14:40:49 +00:00
hjk
ff57cb548d Vcs: Use more FilePath for file paths
Change-Id: I855cde65d034a9647972a7fddf1e8266d7ccfa88
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-08-02 14:40:33 +00:00
hjk
ecbd9f4558 VCS: Partially use FilePath in VcsBaseClient
Change-Id: I024b051ab98ece42ec011bd1c92887a946925c1a
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-07-30 13:10:59 +00:00
hjk
edcedabed9 Vcs: Use FilePath in IVersionControl API
Adapt first level of users.

Change-Id: Ifcd7bff45631ff3b9e26a9e3176daa6cf0cf2e56
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-07-29 13:20:23 +00:00
Orgad Shaneh
d2aa0f4ed9 Git: Fix regression on cherry-pick
Amends commit 55f768e1b0.

Fixes: QTCREATORBUG-25975
Change-Id: Ie49b64f777bd7155cc226b70c0c473a5ac1ce282
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
2021-07-07 10:16:54 +00:00
Orgad Shaneh
86df204bad Git: Fix regression in log output on Windows
Current path appeared instead of the committer date.

This is probably due to the changes in handling commands. The command has
%cD%Creset. %cD% is interpreted as current directory, unless escaped.

Change-Id: Id564c338dc1f4d882e4449430000b7dcebdd7288
Reviewed-by: hjk <hjk@qt.io>
2021-07-06 08:09:05 +00:00
hjk
430e81facd All: Replace most SynchronousProcess by QtcProcess
Change-Id: I0bf22fef2cd4a7297ef5a1e9aa9c3e2b9348ba42
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-23 07:55:31 +00:00
Tasuku Suzuki
9e5ba5d679 Git: fix archive file name
When a filename such as a.tar.gz is given and the filter tar.gz is
selected, Qt Creator generated a.tar.gz.tar.gz because string from the
filter doesn't start with a "." and QFileInfo::completeSuffix() starts with
a ".".

Change-Id: I58fedf79a88b25cd595e17adb8d5660e066658f0
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-06-15 00:52:11 +00:00
hjk
0ba4338467 Utils: Rename QtcProcess::Result::Finished to FinishedWithSuccess
To make clear that this is not just any finish.

Also change FinishedError to FinishedWithError, to create
symmetry.

Also adapt enum member description to reality.

Change-Id: I13e05391eb86fdb24e2ae660f14dfddb282e1104
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-06-02 14:16:36 +00:00
David Schulz
a13aef759e Utils: filepathify fileutils
Change-Id: Ic9048369f64d793f5f567cdb0c715488fb5a4ff6
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-05-18 14:30:53 +00:00
David Schulz
8b7a90ac51 Utils: filepathify TextFileFormat
Change-Id: I6a4e2d38b0bbdec661a4a492901d9182a9f2e502
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-05-18 12:35:49 +00:00
hjk
55f768e1b0 Utils: Make process results accessible through QtcProcess object
The result is fully stored in the object anyway. Using the extra
SynchronousProcessResponse structure only causes copies of
the data and complicates access on the user side in
a lot of cases.

The result bits are now also accessible individually.

There's obvious room for follow-up changes on the topic, e.g.
ShellCommand::runCommand's parameter list could shrink to
just a SynchronousProcess parameter.

Change-Id: I45aa7eb23832340be06905929280c012e1217263
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-05-14 13:19:01 +00:00
hjk
f2f40efa03 Utils: Move process arguments class out of QtcProcess
The main QtcProcess interface is nowadays a CommandLine, with no
explicit references left to QtcProcess::Arguments and related static
helper functions, so it only clutters the QtcProcess class interface

So move these items out of QtcProcess, later potentially to a separate
file pair.

Change-Id: I45c300b656f5b30e2e2717232c855fdd97c2d1d7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-11 09:45:24 +00:00
hjk
c23cdd9262 Utils: Merge {synchronous,qtc}process.{h,cpp} file pairs
Mechanical to prepare merging the actual classes.
Adapting #includes.

Change-Id: I77a2c28129287778bc870c30cb890cd26bc2e62b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-10 09:47:51 +00:00
hjk
793d673f39 Vcs/Utils: Use Utils::Environment for ShellCommand
Change-Id: Ica289ab2f83d52270923c4ff4983860cfbe0b494
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-05 12:21:29 +00:00
Tasuku Suzuki
ffd5fc055f Git: Improve technical term "Tarball" for archive
Retrieve filters' name and suffix from mime database in Utils

Change-Id: Ia48b44541d2104abb61dac27b9ce5820e341cbf6
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-04-07 12:58:26 +00:00
hjk
ce85282866 VcsBase: Remove VcsBaseClientSettings
It's replaced by VcsBaseSettings.

Change-Id: I60a0e4e267337f71e8a32b9b220565b765c973b1
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-03-22 09:34:52 +00:00
hjk
aa69415ac7 Git: Aspectify settings
Change-Id: I87dfeba360967cc77cc230811bcd9f67b3ea6e38
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-03-19 13:39:33 +00:00
Orgad Shaneh
e3ace00a43 Git: Deduplicate stderr output on commit
It appears while the process is running, then printed again when it's done.

Change-Id: I86737eccfcf34d82ccca1ec4b9a7f42fc66bf86c
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-10-14 16:49:51 +00:00
Orgad Shaneh
48c56416f5 Git: Do not prompt to add files in a submodule
Fixes: QTCREATORBUG-23845
Change-Id: Ibf20eed26469b5a8599927e5ac2d458bbff9a156
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-10-04 17:06:23 +00:00
Orgad Shaneh
eb6a2f2b89 Git: Enable Show for file in a specified revision
Fixes: QTCREATORBUG-24689
Change-Id: Ic4ceb1c59f39009c28be7f34ee62f65fd41506c1
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-09-29 07:09:18 +00:00
Tasuku Suzuki
367d0dc4f7 Improve git archive userbility
Archive should be saved at one level upper directory from repo dir.
When user change archive name to e.g. project-v1.0, Qt Creator saves it
to project-v1.tar.gz now. It should be project-v1.0.tar.gz

Change-Id: Ibcd3c6bd8413bbb28fcdae13e5eb43016dc2b6a3
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-09-03 15:34:14 +00:00
Eike Ziller
3944162039 Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/cmakeprojectmanager/cmakebuildstep.cpp
	src/plugins/cmakeprojectmanager/cmakebuildstep.h
	tests/auto/debugger/tst_namedemangler.cpp
	tests/auto/qml/codemodel/check/tst_check.cpp

Change-Id: Iefd5f71c03c0078513b76a92af764a4fb22ee4c2
2020-08-10 15:56:54 +02:00
Orgad Shaneh
14e3a379c1 Git: Suggest branch name based on the commit subject
... when the checked out commit is not a remote branch.

Fixes: QTCREATORBUG-24006
Change-Id: I175a3aedba88bd9e3b5cf298c5c161c56e9d0acd
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-08-04 20:23:45 +00:00
Orgad Shaneh
a48cde86f3 Git: Show full description on tooltip in commit chooser dialogs
Like Push to Gerrit, Rebase, Reset, Fixup Commit.

Fixes: QTCREATORBUG-24366
Change-Id: I0f596f84661a1a4f37fe971683cc0d985a6c9b1f
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-08-02 05:00:50 +00:00
Andre Hartmann
e903f9e350 Git: Fix quoting of repository name
... in the "Uncommited Changes Found" dialog.

Change-Id: I7f987786f4aada47983b849419e2443311dec75f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-07-24 14:04:15 +00:00
hjk
43b658e9e7 Utils: Drop Utils::SkipEmptyParts again
We require Qt 5.14 nowadays.

Change-Id: Iff245257d3cb19207007c0445ee13814e66152dd
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-07-21 12:42:27 +00:00
Orgad Shaneh
c0c5773345 Git: Add new files with --intent-to-add
Sometimes the file is modified after adding it, either by Qt Creator itself
or by the user.

Running Diff on such a file may look strange. Instead of showing the entire
file, it shows the diff since it was added with its initial content.

Fixes: QTCREATORBUG-23441
Change-Id: I712cc574053f39753250685aec148d2b6d7db192
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-07-19 03:59:45 +00:00
Christian Stenger
228f6d04af Git: Replace QRegExp by QRegularExpression
Task-number: QTCREATORBUG-24098
Change-Id: I77a2e9959981b2e173142253baf1668d57982a2e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-07-14 09:09:42 +00:00
hjk
e1c88116b3 Core/Utils: Migrate further to Utils::Id
The coreplugin/id.h header is kept for downstream for now.

Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
(cherry picked from commit 430a33dcd9)
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-07-06 11:15:18 +00:00
Andre Hartmann
c9eedbe0f3 Git: Port colorful log to text colors
Fixes: QTCREATORBUG-24198
Change-Id: Icde06da5ac848fb0f7faf02a8e55fb26136f318c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-07-06 10:55:43 +00:00
hjk
1c81a3b3e8 All: Use Utils::SkipEmptyParts
Task-number: QTCREATORBUG-24098
Change-Id: Iab45de9a9c17ddc39a0e343b1175d4f6cb94b098
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-17 05:55:25 +00:00
Orgad Shaneh
bfcd1149eb Git: Do not read working directory before it is set
This amends commit c17767c78e.

Change-Id: Ide6f9de2420dd1262b27aed83351b76404cdba30
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: hjk <hjk@qt.io>
2020-06-08 13:18:28 +00:00
Andre Hartmann
79766caf52 Git: Use internal log highlighter for old git versions
Git didn't have RGB color support before version 2.3.0.
If an older version is used, fall back to the internal
log highlighter, i.e. don't disable it.

Amends commit d1b096699

Change-Id: I66f84dc4e79f7374d02f6d76c6f912c43e7f04bd
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-05-19 12:00:52 +00:00
Andre Hartmann
d1b0966996 Git: Fix filling commit selection combobox for log
Broken by commit cbb70513bf, which changed the
format for the normal log to override the highlighter.

We still need the hightlighter for the log with diff.

Therefore, a separation between highlighting
and parsing the log is needed to populate the
combobox for commit selection again.

Change-Id: I902ce548fc25875f2cd67b165283ff1236329afa
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-05-16 19:47:46 +00:00
Andre Hartmann
cbb70513bf Git: Allow colorful logs
Requires Git 2.3 or higher for RGB colors.

Can be enabled for the normal or graph log
with the "Color" tool button. For the diff
log, the old behavior is kept (highlighter
is used for the "normal" log, no colors at
all for the graph log)

Fixes: QTCREATORBUG-19624
Change-Id: I8a42a7ad0ebf99ceb459355310311d702dcf9977
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-05-13 14:03:46 +00:00