Commit Graph

2199 Commits

Author SHA1 Message Date
Jarek Kobus
29ecc7b5dd VcsCommand: Rename execute() to start()
In order to conform to QtcProcess API.

Change-Id: I71fcc03846f32cd3c2df39824ce3f6730c20ebbb
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-21 05:33:46 +00:00
Jarek Kobus
b795bd8042 VcsPlugin: Use VcsCommand::done() signal instead of finished()
Conform to QtcProcess interface. Use result() when needed.

Change-Id: Idd4c71d9a103e8649b08ec7787c2f286423a31ec
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-20 10:41:35 +00:00
Jarek Kobus
012de6b4c3 PushHandler: Use cleanedStdErr()
Instead of connecting to stdErrText() signal.

Change-Id: Ib9fb94ca3fb0b5cbf4871e0ea3b06a047c31d272
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-09-20 10:41:06 +00:00
Jarek Kobus
d78ccc30cb ConflictHandler: Use cleanedStdOut() and cleanedStdErr()
Instead of connecting to stdOutText() and stdErrText() signals.

Change-Id: I3a90fe2a6b17eb804dbd67691a4685e236232456
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-09-20 10:29:51 +00:00
Jarek Kobus
eda8a4244f GitBaseDiffEditorController: Use cleanedStdOut()
Instead of connecting to stdOutText() signal.

Change-Id: Ia9d1d38934e254a8824620947a409fc52f7f531f
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-19 10:31:45 +00:00
Jarek Kobus
2f093aec66 GitPlugin: Drop unneeded namespace specifiers
We have using namespace in this file.

Change-Id: I6e9f1259c917c446e52c5e407ec2139cc29c7216
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-06 15:09:49 +00:00
Jarek Kobus
b04b24ca81 GitGrep: Use QtcProcess instead of VcsCommand
Originally VcsCommand was created in main thread,
while VcsCommand::runCommand() has been called
in worker thread. Fix it by using QtcProcess
directly in worker thread.

Change-Id: I65f3476c0b89466c4347b0469e4cbad89c09072d
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-06 14:13:42 +00:00
Jarek Kobus
a9eb732ce6 FileSearchResult: Use FilePath for fileName
This saves about 2 seconds out of 5 seconds spent in
displayResult() for converting from QString into
FilePath in main thread (use case: gitgrep with
2 million hits).

Change-Id: I6334e8559986501c34c90a5c7c6b4acc9a6953e0
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-09-06 07:02:15 +00:00
hjk
1567d24980 Utils: Replace PathChooser::{fileP,p}athChanged signals
... by a new PathChooser::textChanged signal.

They were both emitted in reaction to the underlying line edit's
textChanged() signal.

Use 'textChanged()' as name to mimic/match the Qt side. This also
makes it more clear on the user code side, when this happens.

Some textChanged() consumers should probably use editingFinished()
instead, but that's left for later changes.

Change-Id: Ib07347f616cbf1c5d09bc2f8671ca860d185d1f9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-09-06 05:01:51 +00:00
Jarek Kobus
9087547eaa GitGrep: Don't pass SuppressFailMessage with SilentOutput
SilentOutput defines SuppressFailMessage already.

Change-Id: I80761ed2041f809968890464573863c47b3fac84
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-05 09:14:06 +00:00
Jarek Kobus
6d6346044c VcsBase: Rename vcsFullySynchronousExec into vcsSynchronousExec
Get rid of original vcsSynchronousExec(), as it was calling
vcsFullySynchronousExec().

Change-Id: I911dc786d54c34c211d03661c37df9b58d60a20b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-02 13:46:12 +00:00
Jarek Kobus
6f3c03f1f9 GitClient: Replace for-each-ref command with QtcProcess
There is no need to use VcsCommand when NoOutput is passed.
Get rid of asyncForEachRefCmd().

Change-Id: I91b2226c365c7ce374eccc4884aba7aab5158cb2
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-01 16:35:51 +00:00
Jarek Kobus
66bfdffe0c GitClient: Replace describe command with QtcProcess
There is no need to use VcsCommand when NoOutput is passed.
Get rid of execBgCommand().

Change-Id: I58354e99ddc0c4049325560022ba6e755092b817
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-01 16:35:41 +00:00
Jarek Kobus
4e74e2aa03 GitClient: Replace rev-list command with QtcProcess
There is no need to use VcsCommand when NoOutput is passed.
Get rid of asyncUpstreamStatus().

Change-Id: Iae6869be9640c7662545906d28314ac47cd69e3d
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-09-01 15:55:41 +00:00
Eike Ziller
04e50438eb Utils: Remove Utils::optional
Since we are now requiring macOS 10.14 we can remove our local
implementation of optional and use std::optional for macOS too.

Change-Id: I2bd018261b68da64f7f031a812045dd7784697e1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2022-09-01 06:58:04 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.

Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-08-26 12:27:18 +00:00
Orgad Shaneh
45aa6a12c4 Git: Support user configured comment character
Task-number: QTCREATORBUG-28042
Change-Id: I96aea27434ba138637728a7fd7d1450e1eee260a
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2022-08-26 10:41:27 +00:00
Jarek Kobus
a50afa486a VcsCommand: Remove unused SshPasswordPrompt
Change-Id: I402d619656d8339b1e81bc9ae96acf56178505d2
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-26 08:36:34 +00:00
Eike Ziller
025bdfe702 VCS: Use qtcEnvironmentVariable* instead of qEnvironmentVariable*
And instead of qgetenv.
Takes Qt Creator's setting at "Environment > System > Environment" into
account, which makes it easier on some platforms to set them (e.g.
macOS), can be configured differently in different settings paths, and
potentially can be changed at runtime (depending on usage).

Change-Id: I364e5b663353f37121279a58f4a9fd514cddbbf0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-26 08:03:01 +00:00
Jarek Kobus
278589a014 GitClient: Reuse VcsCommand::NoOutput
Change-Id: If30d78a34ae77a7397af6374f8b733809ecaab20
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-26 06:38:38 +00:00
David Schulz
c10f23a5c6 Git: add shortcuts to uncommitted changes dialog
Change-Id: Ifde8158b7902fb6a280545349ab8d8c0a723782c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-26 06:05:12 +00:00
Orgad Shaneh
4cf75c78ac Git: Minor cleanup in GitSubmitEditorWidget
Accept CommitData struct instead of passing most of its members separately.

Change-Id: I04b3b7ea0c02d12cae87e42d44af3808722b6371
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2022-08-19 08:01:58 +00:00
hjk
ffcf85958f Git: inline changeselectiondialog.ui
Change-Id: I7f4758119623559cec4f1b91a305d3ad55fe55dc
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-05 13:15:35 +00:00
Christian Stenger
391f72ad57 Git: Fix extra token
Amends 9ad5c4254d.

Change-Id: Iaa72752449df47e745d4fb2f0fae693228a5c047
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-05 13:12:40 +00:00
hjk
7070e89904 Git: inline remote*.ui
Change-Id: Idb394e69d3976877d091a5cf65a3babfbafe9e6b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-05 11:52:14 +00:00
hjk
9ad5c4254d Git: inline gitsubmitpanel.ui
Change-Id: Ib6ba5a6c44d413a13300a28ffb575db5799a9927
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-05 11:52:10 +00:00
hjk
24822f96ae Git: inline stashdialog.ui
Change-Id: I3665fcf7622c45d1aef3dacae936252a4f73d32f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-05 09:57:08 +00:00
hjk
4cf40b2456 Git: inline branchcheckoutdialog.ui
Change-Id: I105f63dd7ae0110ecb0afbd13ff70027fb9431b1
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-05 09:56:55 +00:00
hjk
d2a205c74c Git: inline gerritdialog.ui
Change-Id: Idefdd93a80ac87b9798bf2654413a5c78882b391
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-08-04 12:59:59 +00:00
hjk
03035feac3 Git: inline branchadddialog.h
Change-Id: I8919f69bfdfd670855167bace62fb55603595270
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-04 12:57:49 +00:00
Marcus Tillmanns
04205d1225 FileUtils: Adds toFilePathList function
Change-Id: Ie3137751135fdb6c3161cc886f307323fcce6b72
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-08-04 11:33:53 +00:00
hjk
7950a038b4 Merge remote-tracking branch 'origin/8.0'
Change-Id: I1dc664137eeecb7dd69f29af7a08164683d51077
2022-08-03 17:51:42 +02:00
Jarek Kobus
4edb238073 VcsOutputWindow: Use FilePath for repository
Change-Id: Ie6669c94a1fa29e48524b9338e74413bb0830229
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-03 12:23:52 +00:00
Orgad Shaneh
f8c3d860fc Gerrit: Do not pass username to curl for REST requests
It is set in .netrc anyway, and there is a regression in curl that causes
it to fail when passing the user name.

See https://github.com/curl/curl/issues/8653

Change-Id: Ic7aa2d874884db71f71d162486acf4e054eab7e9
Reviewed-by: hjk <hjk@qt.io>
2022-08-03 12:23:09 +00:00
Jarek Kobus
7bd33bc247 VcsCommand: Remove defaultWorkingRepository() getter
It wasn't really broadly used.

Change-Id: If2e185a7d8d0f920f3ec7f507bf96dd81f4559b0
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-03 11:30:36 +00:00
Orgad Shaneh
195fc29ef5 Gerrit: Show command and failures in testConnection
Can be useful when authentication fails.

Change-Id: Ibd3700c4ce9cc76b0d9c4cde32730a4e1906ccd6
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-08-03 10:17:49 +00:00
Orgad Shaneh
b3b36f7d2a Gerrit: Refresh server details also when authenticated is changed
For example, if the server was not authenticated, and .netrc was edited
outside Qt Creator.

Change-Id: Ib28b6e924e3fab958410da49ceb45ed4269e195b
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2022-08-03 10:17:34 +00:00
hjk
dac9dff459 Gerrit: inline authenticationdialog.ui
Also, replace /#/settings/http-password by /#/settings/#HTTPCredentials

There should probably be some stretch between the form and
the buttonbox, but it wasn't there in the .ui so I left it
out for now.

Change-Id: Ie07a3283261a1070a489e454f9fb86c0c6dc2ca8
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-08-03 09:44:08 +00:00
Jarek Kobus
191fc196d5 VcsCommand: Remove one addJob overload
Remove defaultTimeoutS field, as it wasn't broadly used.

Change-Id: I0056788b066eb6d682d5ba7acdb01d5dd3568967
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-03 06:09:44 +00:00
Jarek Kobus
278d297397 VcsCommand: Simplify public runCommand()
Get rid of unused workingDirectory (default working
directory will be used) and exitCodeInterpreter.
Simplify internals a bit.

Change-Id: I2a7547e5a594dd7a21f390daeb06778656e9e971
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-02 17:34:31 +00:00
Jarek Kobus
0a7f76ca8d VcsCommand: Get rid of setCookie()
Remove cookie arg from finished() signal, as it's not used
currently. Thus, remove setCookie() method.

Change-Id: Iedd328aece776eebd2d161a36ec28370b8bc4bfc
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-02 09:00:01 +00:00
Jarek Kobus
2c51907b4b VcsCommand: Limit the usage of setCookie()
It looks like the cookie set inside GitClient::vcsExecAbortable()
is never read back again. The only place where we connect to
finished() signal of the command returned by vcsExecAbortable()
is GitClient::pull(), however, we ignore the cookie there.

Change-Id: Iaec08b255309ea406e45695231fe9849d5dc7285
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-02 08:59:56 +00:00
Jarek Kobus
09fb9f3973 VcsCommand: Limit the usage of setCookie()
Don't use setCookie() for setting the push failure status.
Introduce a PushHandler helper that keeps the data collected
when stdErrText() signal is emitted and reuse it when
finished() is being called. Move m_pushFallbackCommand
field into the helper, as its value is meaningful only
in context of the invoked command.

Hide PushFailure enum inside PushHandler.

Change-Id: Id21457734f32e06bb130c3c07c24cb2b7af6e466
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-02 08:59:46 +00:00
Jarek Kobus
1d0f553ac5 VcsCommand: Limit the usage of setCookie()
Don't use setCookie() for setting the line number
to be shown on annotation. Add setDefaultLineNumber()
setter to VcsBaseEditorWidget instead.

Change-Id: I6c52874d48532132a27b2a7a9d161705170f7ade
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-02 06:11:25 +00:00
Jarek Kobus
0de4e9092f VcsCommand: Remove cookie() method
Change-Id: I2f83e141b05100c84c140d15a131e06ee62c6f68
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-01 17:25:59 +00:00
Jarek Kobus
60302debd7 Move ShellCommand into VcsBase plugin
Rename it to VcsCommand. Move also ShellCommandPage into
VcsBase plugin.

Change-Id: I335ac47e3090f2be497643ebcda0eaad2987ac81
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-01 14:33:06 +00:00
Jarek Kobus
0a1ac481ed ShellCommand: Introduce CommandResult structure
Don't require QtcProcess instance when calling
ShellCommand::runCommand().

Change-Id: Ie0287d91c1807465eab12be7eaa2eac561179af7
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-07-29 14:52:02 +00:00
Jarek Kobus
e6e4bc8dad ShellCommand: Remove success() signal
Use finished() signal instead.

Change-Id: I4e28a2c6d90f40790cb9d19411186bd98402f4bb
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-07-29 11:39:10 +00:00
hjk
58c5b126d3 Utils: Settle on lowerSnakeCase for LayoutBuilder::Setter
Change-Id: Icfe487d8c7712cc8ad28f0f61e8ae4778a356fc3
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-07-27 08:40:12 +00:00
hjk
14257a24f9 Utils: Introduce Layouting::{br,st}
... as "standard" ways to define line breaks and simple stretch.

There have already been too many patterns to do it.

Break() and Stretch() still work for the patches in flight, but
they are planned to be removed.

Change-Id: I9b70dcdc11244a904a496b0c55938dfb0b265fc8
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-07-25 09:52:15 +00:00