Commit Graph

898 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
Jarek Kobus
f794bb0acf GitPlugin: Avoid using sender()
Change-Id: Ie711630dd4b92bdc69990f421f69b578bc0fe9dc
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-07-22 13:30:08 +00:00
Jarek Kobus
195a7aff1d GitClient: Avoid using sender()
Change-Id: I844b7c6545ae2244e5e45907e775fef53dd12931
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-07-20 14:16:57 +00:00
Jarek Kobus
89e7201048 VcsBase: Hide VcsCommand class
Make it an implementation detail.
Introduce VcsBaseClient::createVcsCommand() method instead
for instantiating VcsCommands.

Replace all occuriences of VcsBase::VcsCommand in public API
with Utils::ShellCommand.

Change-Id: Ie438cc3a5e867b3ee8f9e935b56b2f16ea453f8a
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-07-13 16:01:28 +00:00
Jarek Kobus
0490e3426d ShellCommand: Merge VcsCommand::VcsRunFlags into RunFlags
Use ShellCommand class name in signal-slot connections.

Change-Id: Id50ee6887708558a2ba0972ece6c420b0be36f72
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-07-12 14:49:10 +00:00
Jarek Kobus
e793841b4f Remove Core::ShellCommand
Move the implementation into VcsCommand.
Use Utils::ShellCommand inside coreplugin API.

Change-Id: I74a34057b33832a138b05f1dfa6937565027edb4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-07-11 10:04:08 +00:00
Eike Ziller
f4c60fdf58 Git: Do not run 'git --version' synchronously at startup
We can easily delay this, and if git acts up for some reason, we don't
have to block startup.

Task-number: QTCREATORBUG-27765
Change-Id: I25aa6f8d04d1fd4b9d87f8ccf7ffd591f7bbe519
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-06-29 12:39:28 +00:00
Jarek Kobus
a1ad64a50b GitClient: Don't call blocking waitForStarted()
Connect to done() signal in order to detect the start
failure and try to start a gitk from different path.
All trials of starting gitk are done sequentially
and non-blocking.

Give process a parent in order to avoid process leak
on shutdown.

Change-Id: I1d74bfeaca23d38643f3d2f262428732314aefe4
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-06-28 17:29:50 +00:00
Jarek Kobus
94adc1a566 MergeTool: Don't call blocking waitForStarted()
Connect to done() signal instead of finished().
In case the process failed to start it will delete
itself from inside done handler.

Change-Id: I277779904d571759bf3877860d64e80ad304c2da
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-06-22 06:30:04 +00:00
David Schulz
153ff77a6b Utils: use cleaned stdout all over the place again
Amends 5ee880ce5e

Change-Id: Ie0202db7d8455372c3697087d9571db6706b45a1
Reviewed-by: hjk <hjk@qt.io>
2022-06-17 13:04:42 +00:00
Orgad Shaneh
a2797ec80e VCS: Append newlines to system messages in output pane
Change-Id: I3ca2d2e90ea0a97dd75feb7d1f8220564a138fb5
Reviewed-by: hjk <hjk@qt.io>
2022-05-19 06:15:44 +00:00
Orgad Shaneh
086b47afee Git: Fix compilation with Qt5
Change-Id: Ib35095ccdacd13eaf2f599c9b47f7934c5d02591
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-05-12 12:41:11 +00:00
Orgad Shaneh
78b08f57a2 Git: Make git show more async
git describe --tags can take very long when there are many tags.

Run all the describe commands in parallel, and let the user work while
they are running.

Change-Id: Iee56a5d51f93e9c799521bb0b06ba08bb45cb237
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2022-05-12 08:04:16 +00:00
Jarek Kobus
92d7e4601d QtcProcess: Forward declare Environment in QtcProcess header
Change-Id: If85a8a07b144c94cb6e45f66dcb06573ef07c777
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2022-05-09 07:42:40 +00:00
Jarek Kobus
8e0ae8ba96 QtcProcess: Limit the inclusion of qtcprocess.h
Move the rest of QtcProcess enums to processenums.h.
Move ExitCodeInterpreter into processenums.h.
Remove superfluous Utils:: prefix.

Change-Id: Iaa596f353d33d6930085a621b114cc15a35caa80
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-03-02 13:30:39 +00:00
Eike Ziller
f562ebf239 Mimetypes: Make implementation switchable between new and old
- configure with QTC_USE_NEW_MIMEDATABASE to switch to the new one in
  utils/mimetypes2/
- added utils/mimeutils.h header for the Qt Creator specific static
  wrappers, that also includes the "public" headers for MimeType et al
  from the new or old implementation, depending on configuration
- change all utils/mimetypes/ includes to utils/mimeutils.h
- move the implementation for the wrappers to
  utils/mimetypes(2)/mimeutils.cpp
- also move the MimeDatabase declaration in the "old" implementation
  back to utils/mimetypes/mimedatabase.h

Change-Id: Ie8de229c035d6cd9a5e4739dc0fa78d9c17228e3
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-02-25 07:19:58 +00:00
Orgad Shaneh
2ee739b362 Git: Fix bad access to temporary storage
+ limit the fix to cases with HOMESHARE.

Change-Id: Ic108ab49eb3b64d5e1d302466c74610acc412175
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2022-01-31 12:49:40 +00:00
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