Commit Graph

1019 Commits

Author SHA1 Message Date
Andre Hartmann
6b2ff42f0d GitPlugin: Add color to diff description text
Change-Id: I19d8bbaf77d0b6070b8300ca9fc0868579cab4e8
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2024-08-05 14:21:28 +00:00
Jarek Kobus
779390829c TaskTree: Introduce For element
Improve code readability by requiring iteratable Group
to be named For.

The For's c'tor requires an iterator element as a first arg.

The For's c'tor allows for passing exactly one iterator element.

It's not possible to place iterators inside Group element anymore.

Change-Id: I9dfe2c0da058abac161f66c4e336da2417c383f1
Reviewed-by: hjk <hjk@qt.io>
2024-07-10 13:39:40 +00:00
Jarek Kobus
6c2c287335 GitClient: Call done handlers also in case of an error
This removes the "Precedes: <resolving>" label when
doing git show on a very fresh, local commit.

The same fix applies to "Branches", though not sure if
it's possible that there is no branch.

Change-Id: I08614d47b229bd04256de1a059876d679cc57b99
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2024-07-09 07:03:43 +00:00
Jarek Kobus
faff9bb220 GitClient: Simplify recipe
Use LoopList element instead of constructing large tree.

Change-Id: Ie10af350c7ed15a7d06363414174042b65c7ec53
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2024-07-09 07:03:34 +00:00
hjk
efae651924 Utils: Introduce a convenience function creatorColor()
... forwarding to creatorTheme()->color(...)

Change-Id: Iefaa043495127b3e500ed225584481d3ec0f8c1f
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-05-29 13:49:25 +00:00
hjk
917523d7e3 Fix a few {QByteArray,QList}::count related deprecation warnings
Change-Id: I493e557a2ec976560c9e37312d8ae860490a2831
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-05-24 07:06:47 +00:00
Jarek Kobus
53de9701f4 CommandLine: Use more 1-arg c'tor
Change-Id: If52c4094f94859d51e31862d913b1756e333e512
Reviewed-by: hjk <hjk@qt.io>
2024-05-16 12:45:42 +00:00
Eike Ziller
5af531cd39 Utils: Fix build with MSVC with C++20
Rename process.h back to qtcprocess.h

MSVC's "threads" standard header includes <process.h>, and that ends up
including our process.h from Utils.

There already was a hacky workaround in place for a similar issue with
MINGW, but that doesn't work with MSVC because that doesn't have

Simply use a name that doesn't conflict.

Change-Id: I1159cd2096b4f2dbc4a1728d0131dd6edd30ebd3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2024-02-28 08:09:05 +00:00
Andre Hartmann
1117954950 Git: Respect author and mail mapping
Git allows mapping authors and mail addresses:
https://git-scm.com/docs/gitmailmap

While using this file already worked for (instant)
blame, log and show still used the original values
from the repo. This patch makes the display within
Creator consistent.

Change-Id: I3c0e764c435a505e285941f4fdc91131f85af590
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2024-02-22 13:15:43 +00:00
Marcus Tillmanns
291a893f5f VCS: Allow remote vcs operations
Both VcsBaseClient::vcsBinary() and VcsBaseClient::processEnvironment()
get an additional parameter "FilePath target" to allow selecting binaries
and environment based on where the repository is located.

This allows to select e.g. a git binary on a remote device, and the
environment of the remote device for each VCS operation.

A bunch of file path operations are either fixed or ported to actually use
FilePath correctly.

Change-Id: I6afc645772fde3dff3ec19c13efe538e5888e952
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2024-02-12 11:25:06 +00:00
Marcus Tillmanns
70e013fd25 Git: Cleanup gitExecutable()
Using expected removes a bunch of handling code.

Change-Id: Id524912d82aa693fbb39c7e7fa34abd77153f92e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2024-02-08 13:24:38 +00:00
Jarek Kobus
8bcc78a044 Various plugins: Fix some more C++20 warnings about [=] captures
Change-Id: If20aac4320c84096a07d67cc137886638286acf8
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-02-06 08:34:44 +00:00
Jarek Kobus
7fc991ac8e Process: Remove no-op calls to setTimeoutS()
The timeout is only used with runBlocking(), otherwise it's no-op.

Change-Id: I7d81e4a73c7182bd19c435c112a2d64c3f40ba2e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2024-01-21 10:14:07 +00:00
Andre Hartmann
95aa370b69 Git: Remove now outdated function comment
Amends 98c0e9764a

Change-Id: I9f7bf520bb5ead83d883a554c97400d183f6fcee
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2024-01-20 17:41:50 +00:00
Jarek Kobus
cbec5438b4 GitClient: Change synchronousStashList() signature
Get rid of unused errorMessage arg.
Return the stash list directly.

Change-Id: I9bf156c5ecda476a5def3c3490d6cb13d011a3cd
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2024-01-20 16:40:40 +00:00
Jarek Kobus
ee09a28e83 GitClient: Make stashNameFromMessage() a static local function
Get rid of unused errorMessage arg.
Return the stash name directly.

Change-Id: I11e7b0ef4dcaa38293cbf5d20b7213cc06850257
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2024-01-20 16:40:34 +00:00
Jarek Kobus
2d54995622 GitUtils: Get rid of unused Stash::clear() method
Make parseStashLine() a local static method returning optional Stash.

Change-Id: If702a4485ce87336ab829b522258e62a930589bf
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2024-01-20 16:40:28 +00:00
Jarek Kobus
98c0e9764a Git: Use QVersionNumber for git version
Parse the version string with base 10 now.

Amends abee98b44817d1aee63b5cd9b673d0c3aa1733ba

Change-Id: I2f0b47380a9714b3f3de475ddabe78875db3b608
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2024-01-20 16:30:51 +00:00
Jarek Kobus
cb6a2da372 VcsCommand: Fix clearing repository
Move a call to setRepository() from c'tor into the setup() method,
as it should be called just before the process is started.

Add an accompanying call to clearRepository() into
the cleanup() method.

Remove other manual calls to setRepository() and clearRepository().

Change-Id: I35b9d4ea72cc885bb8ae34950987a8ca18584fd1
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2024-01-18 16:33:04 +00:00
hjk
892e7c0f3a Git: Separate internal plugin access API from plugin class
Plan is to hide the plugin class definition to the .cpp later.

Change-Id: I27f6d2dd23adb4f3ab47d99b0626956889d2750f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2024-01-15 10:08:10 +00:00
Serg Kryvonos
c3a7279f05 Work on lambdas C++20 compatibility
Change-Id: I0d391c02ae1e1c5a1751b33ca7e83902e1cfe269
Reviewed-by: hjk <hjk@qt.io>
2023-12-13 13:24:22 +00:00
Jarek Kobus
3211fd1e43 GitClient: Make lambda non-mutable
Do a copy of future interface inside the lambda body instead.

Change-Id: If84e37c62e43b815cfea0b5f60fe7fcebca63093
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-12-12 13:53:26 +00:00
Jarek Kobus
ce80a6dad5 TaskTree: Rename TreeStorage<> -> Storage<>
This addresses the 20th point in the master task below.

Task-number: QTCREATORBUG-28741
Change-Id: I696beda87430fbe637abba8054012fb77516e220
Reviewed-by: hjk <hjk@qt.io>
2023-11-20 08:25:50 +00:00
Jarek Kobus
ced3052e7f TaskTree: Get rid of Storage subclass of GroupItem
Make the c'tor of the GroupItem taking the TreeStorageBase
public instead.

This addresses the 20th point in the master task below.

Task-number: QTCREATORBUG-28741
Change-Id: I78320ec24b4e4b915ab549135fb93b45c658b9f2
Reviewed-by: hjk <hjk@qt.io>
2023-11-20 07:47:54 +00:00
Jarek Kobus
4c38f68d0f TaskTree: Rename StopWithDone -> StopWithSuccess
Make naming consistent with recent changes.
"Done" is meant to be an event name when the task / group
finishes. "Done" may finish with "Success" or an "Error".

This addresses the 26th point in the task below.

Task-number: QTCREATORBUG-28741
Change-Id: I53ed6905b1c385c398f49e122e8ca60aa3ad0806
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-11-07 14:09:23 +00:00
Jarek Kobus
2c0a59384c TaskTree: Rename workflow policies
Make naming consistent with recent changes.
"Done" is meant to be an event name when the task / group
finishes. "Done" may finish with "Success" or an "Error".

This addresses the 26th point in the master task below.

Task-number: QTCREATORBUG-28741
Change-Id: Icc882710dc4896626dc9332440aa13a692af54c4
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-11-07 14:09:15 +00:00
Jarek Kobus
37b6cb7f90 TaskTree: Get rid of onGroupError element
Make it possible to setup onGroupDone element with additional
OnDone argument.
The onGroupDone handler may accept extra DoneResult argument.
The onGroupDone handler may also tweak the success bit of a group.

All above features conform to the behavior of the task done handler.

Task-number: QTCREATORBUG-29834
Change-Id: I125bdfe155e585678fb33410632246401cbc9390
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-11-07 14:08:04 +00:00
Jarek Kobus
f84e3074cd TaskTree: Make it possible to invoke done handler only with DoneResult
Remove unused "const Task &" argument from done handlers.

Task-number: QTCREATORBUG-29834
Change-Id: I0e69c1eba88d9fdb78de7ba1705ff3916999dc89
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-11-07 12:05:21 +00:00
Jarek Kobus
dda75153fe TaskTree: Introduce DoneWith enum
This makes it possible to recognize the cancel state
when the task was automatically stopped because of task's
parent group workflow policy or when the user called TaskTree::stop().

This addresses the 2nd point in the master task below.

Task-number: QTCREATORBUG-28741
Task-number: QTCREATORBUG-29834
Change-Id: I2798b9ec1d2f1d667aff51ee0271a5a15a525dc1
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-11-07 11:52:18 +00:00
Jarek Kobus
6e6aa7102c TaskTree: Introduce CallDoneIf enum
Get rid of CustomTask c'tor taking 3 handlers.
If the done handler needs to be called only on
success or an error, add explicit 3rd arg of CallDoneIf type.

Task-number: QTCREATORBUG-29834
Change-Id: I10e55415587e6cac46620dd5177ad8269584583c
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-11-07 11:51:25 +00:00
Jarek Kobus
0e7ecee489 VcsBase: Use common done handler
Instead of specifying two separate done and error handlers,
specify just one that takes additional "bool success" argument.

Task-number: QTCREATORBUG-29834
Change-Id: Ib92ef2dcd960372d9db6c8f50d4017a33c49ccd3
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-11-06 14:33:20 +00:00
Jarek Kobus
d35d0b5100 TaskTree: Add Task c'tor taking one handler for done and error
The overloaded c'tor takes one done handler with an additional
"bool success" argument.

Task-number: QTCREATORBUG-29834
Change-Id: Id579d055721a2a07a5a9f0900aa4a73655f21610
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-11-06 14:33:06 +00:00
Jarek Kobus
7bec91c53e GitClient: Some minor corrections
Use GroupItem instead of ProcessTask inside topRevision().
Replace some [=] captures with more explicit ones.

Change-Id: I2e321f7121f80fd2689ecf57cd9735ba56a7962e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-10-31 19:49:08 +00:00
hjk
342e066886 Utils, all: Standardize on QtcSettings
Change-Id: Id222016f15b1c3bfe6710fe5d0297666d4565ef1
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-09-27 13:25:31 +00:00
hjk
9679412a23 Replace QFile::exists by QFileInfo::exists
QFile::exists only calls QFileInfo::exists, so this saves one
function call per invocation.

Change-Id: I41cb407345654eeead14455a4955b8b9b015aedc
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-09-01 10:24:31 +00:00
hjk
dc6b40a5c0 Use Utils::Storage instead of QVariantMap in a few places
Change-Id: I02833cf2bc3caaadc22ff93ae530e4aebe4c3868
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-23 14:30:50 +00:00
Jarek Kobus
98026b29c6 TaskTree: Get rid of registration macros
Alias task types manually.
Don't require the alias to be inside the Tasking namespace.
Addresses the 22th point of the jira ticket below.

Task-number: QTCREATORBUG-28741
Change-Id: I1bdda7fe5a01e4bcb5052ec328f4e0eace878651
Reviewed-by: hjk <hjk@qt.io>
2023-08-17 10:23:52 +00:00
Jarek Kobus
6845434f3d VcsBaseDiffEditorController: Get rid of inputStorage() method
Pass explicitly the storage to the postProcessTask() instead.

Change-Id: I75ac10969530dfea1eac266b44481be3b1d8249b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-08-02 19:36:13 +00:00
Jarek Kobus
224e4eeb59 GitPlugin: Simplify return statements
Change-Id: If09c93acade749326b95bb1c6068b2d43a4d8551
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-08-02 11:30:02 +00:00
Jarek Kobus
8dd46d0399 Various Plugins: Simplify return FilePath statements
Change-Id: Ia9efb86f722caca1492b577d51442f1f23b804b4
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-08-02 08:19:23 +00:00
hjk
b880525e68 Vcs: Use a StringAspect again for settings().path()
This holds a path list, i.e. possibly several directories, separated
by ';' or ':'. PathChooser can't handle that. Long term this could
be something more sophisticate, but for now it's more a "string" than
one FilePath.

Change-Id: I6665c131e698db3afd268d6ab9bcf3d76a7c7289
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-07-26 15:02:33 +00:00
hjk
778a1d75ba Git: Initialize GitClient on first access
This does not change the current timing of construction a lot as
the GerritPlugin may need it immediately in some cases, in any
case the gitGrep instance will need it.

There's nothing big going on at destruction time, so the prolonged
lifetime until really close to the end does not hurt.

The reason here is that this way we will avoid cases like in change
5e5b90a9a1.

Change-Id: I326d83c1a3d21114322ac6cce8d9e9b782faacdc
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-07-26 10:25:43 +00:00
Jarek Kobus
d30bb92704 GitPlugin: Use PluginManager's futureSynchronizer
It's being deleted on plugin unload, so it should be
a proper substitute.

Change-Id: I27383db72dfa0d5b0df2886b24c96266602ccbac
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: hjk <hjk@qt.io>
2023-07-25 16:18:06 +00:00
hjk
93d96c9d75 Vcs: Code cosmetics
Drop some Utils:: and rely on some aspects' operator()()

Change-Id: I40d2c2973c1c9eff443bb74b8da44e0824d8d5c6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-07-14 09:53:50 +00:00
hjk
b98a08587e Vcs: Use a FilePathAspect for VcsBaseSettings::path
Change-Id: Ic92ef43514f7f4004774ebbd9bb49c026dc735ba
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-06-29 16:15:38 +00:00
Jarek Kobus
664d409489 TaskTree: Rename TaskAction into SetupResult
It's only used as a return value from group's or task's
setup handler. It instructs the running task tree on
how to proceed further.

It addresses the 21th point in the bugreport below.

Task-number: QTCREATORBUG-28741
Change-Id: I25802c76b9e7bc044c6a38197935798d2da9ad02
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2023-06-21 10:24:10 +00:00
Leena Miettinen
8e9f34662e Git: Add full stop to end of message
Change-Id: I66b67d2be82812efaf84bd8150e44fd097abe0cf
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-06-19 09:25:15 +00:00
Jarek Kobus
2caf4efbb2 DiffEditor: Refactor DiffEditorController
Replace requestChunkActions() and chunkActionsRequested()
with a virtual method addExtraActions().
Implement it in GitBaseDiffEditorController.

Task-number: QTCREATORBUG-23242
Change-Id: I5da166b35d1146b9fd439e748803531d982ad2a8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-06-09 07:27:32 +00:00
Jarek Kobus
003b43aee7 TaskTree: Rename setupRoot into setRecipe
The passed Group root element is a recipe with
a full description on how to execute the tasks
and how to handle finished tasks.

We have already virtual methods / setters called like:
deployRecipe, refreshRecipe, reloadRecipe. So, the
common "recipe" is kind of consistent.

Fix typos in warnings.

Addresses the 11th point in the task below.

Task-number: QTCREATORBUG-28741
Change-Id: I1c80f4838b6a3e5ed113eaf8e42b59746d098efe
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-06-08 11:31:57 +00:00
hjk
19a6428f54 More deprecation induced busywork
QString::count() will vanish.

Change-Id: I65672fa648c0969930e9398ec4e541a0771c8a57
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-06-08 07:00:01 +00:00