summaryrefslogtreecommitdiff
path: root/src/plugins/git/gitclient.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Git: Pass only files after -- on BlameOrgad Shaneh2022-10-141-1/+2
| | | | | | | It works, but is likely to break at some point. Change-Id: I97952a7cb6cd3569adc694db7537fab807bda0ea Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Git: Respect text encoding in project settings on diffOrgad Shaneh2022-10-141-2/+3
| | | | | | Fixes: QTCREATORBUG-21794 Change-Id: Ib4be9811c0ab1cba5cad4adbfe740a6d99f420d1 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Git: Fix removing nested filesOrgad Shaneh2022-10-111-1/+4
| | | | | | | | | * Add -- before file list on add/remove. * Run in the correct directory. Fixes: QTCREATORBUG-27405 Change-Id: Ie04cd19981dac465cf70dba8b089fd18a4ecdf8b Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Git: Fix adding existing files in nested directoriesOrgad Shaneh2022-10-111-5/+6
| | | | | | | | Amends 48c56416f5e128c04f2d2d867b518775e0527607. Fixes: QTCREATORBUG-27644 Change-Id: I4ef58c017e4fcf8fa48905f7e0b649433b3cac0f Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* VcsCommand: Simplify ProgressParserJarek Kobus2022-10-071-16/+9
| | | | | | | | | | | Get rid of abstract base ProgressParser and replace it with ProgressParser function. The only one former subclass GitProgressParser is now functor object. Pass future interface directly to the ProgressParser function, along with input text to be parsed. Change-Id: Icbcf0b6e55097f8b38eb8a32ceaa4414723116d0 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-071-3/+3
| | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace. Task-number: QTBUG-99313 Change-Id: I88edd91395849574436299b8badda21bb93bea39 Reviewed-by: hjk <hjk@qt.io>
* Git: Convert to Tr::trAlessandro Portale2022-10-061-149/+148
| | | | | Change-Id: I7fb1753109a9263c70c01713f5f4895db6b73662 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* VcsBase: Move RunFlags into separate headerJarek Kobus2022-10-061-50/+50
| | | | | | | | | It is going to be used outside of VcsCommand, too. Use RunFlags enum as an argument to several functions instead of unsigned. Change-Id: I355c80a845a9b5982108fbde3412754392dce702 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* VcsCommand: Change the default logic for fully syncJarek Kobus2022-10-051-1/+1
| | | | | | | | | | | | | | | Remove VcsCommand::FullySynchronous flag. Rename VcsCommand::NoFullySync into UseEventLoop. By default the command will run fully synchronous (i.e. without nested event loop). Only when UseEventLoop is specified, and the command runs in main thread, the nested event loop will be used. This change should preserve the current behavior on all code paths. Change-Id: Id4bbaf68402ceed5e3fcc6f294521e87eb0b8d4d Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* VcsBasePlugin: Use more FilePathJarek Kobus2022-10-041-5/+5
| | | | | | Change-Id: I7bc80245b093b210439efdf3ea353b52b288dcc0 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* DiffEditor: Cleanup includesJarek Kobus2022-09-291-2/+0
| | | | | Change-Id: Id8127b9b0c99ee2a0d5d367cb551a1d5779c5d38 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* VcsCommand: Rename execute() to start()Jarek Kobus2022-09-211-1/+1
| | | | | | | In order to conform to QtcProcess API. Change-Id: I71fcc03846f32cd3c2df39824ce3f6730c20ebbb Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* VcsPlugin: Use VcsCommand::done() signal instead of finished()Jarek Kobus2022-09-201-19/+18
| | | | | | | Conform to QtcProcess interface. Use result() when needed. Change-Id: Idd4c71d9a103e8649b08ec7787c2f286423a31ec Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* PushHandler: Use cleanedStdErr()Jarek Kobus2022-09-201-29/+33
| | | | | | | | Instead of connecting to stdErrText() signal. Change-Id: Ib9fb94ca3fb0b5cbf4871e0ea3b06a047c31d272 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* ConflictHandler: Use cleanedStdOut() and cleanedStdErr()Jarek Kobus2022-09-201-2/+4
| | | | | | | | 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>
* GitBaseDiffEditorController: Use cleanedStdOut()Jarek Kobus2022-09-191-2/+2
| | | | | | | | Instead of connecting to stdOutText() signal. Change-Id: Ia9d1d38934e254a8824620947a409fc52f7f531f Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* VcsBase: Rename vcsFullySynchronousExec into vcsSynchronousExecJarek Kobus2022-09-021-44/+43
| | | | | | | | Get rid of original vcsSynchronousExec(), as it was calling vcsFullySynchronousExec(). Change-Id: I911dc786d54c34c211d03661c37df9b58d60a20b Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* GitClient: Replace for-each-ref command with QtcProcessJarek Kobus2022-09-011-6/+0
| | | | | | | | 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>
* GitClient: Replace describe command with QtcProcessJarek Kobus2022-09-011-15/+26
| | | | | | | | 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>
* GitClient: Replace rev-list command with QtcProcessJarek Kobus2022-09-011-9/+0
| | | | | | | | | 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>
* Use SPDX license identifiersLucie Gérard2022-08-261-24/+2
| | | | | | | | | 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>
* Git: Support user configured comment characterOrgad Shaneh2022-08-261-0/+8
| | | | | | Task-number: QTCREATORBUG-28042 Change-Id: I96aea27434ba138637728a7fd7d1450e1eee260a Reviewed-by: André Hartmann <aha_1980@gmx.de>
* VcsCommand: Remove unused SshPasswordPromptJarek Kobus2022-08-261-15/+6
| | | | | Change-Id: I402d619656d8339b1e81bc9ae96acf56178505d2 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* VCS: Use qtcEnvironmentVariable* instead of qEnvironmentVariable*Eike Ziller2022-08-261-3/+2
| | | | | | | | | | | | 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>
* GitClient: Reuse VcsCommand::NoOutputJarek Kobus2022-08-261-21/+17
| | | | | | Change-Id: If30d78a34ae77a7397af6374f8b733809ecaab20 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: add shortcuts to uncommitted changes dialogDavid Schulz2022-08-261-3/+3
| | | | | Change-Id: Ifde8158b7902fb6a280545349ab8d8c0a723782c Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* FileUtils: Adds toFilePathList functionMarcus Tillmanns2022-08-041-1/+1
| | | | | | Change-Id: Ie3137751135fdb6c3161cc886f307323fcce6b72 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* VcsOutputWindow: Use FilePath for repositoryJarek Kobus2022-08-031-1/+1
| | | | | Change-Id: Ie6669c94a1fa29e48524b9338e74413bb0830229 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* VcsCommand: Remove defaultWorkingRepository() getterJarek Kobus2022-08-031-4/+5
| | | | | | | It wasn't really broadly used. Change-Id: If2e185a7d8d0f920f3ec7f507bf96dd81f4559b0 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* VcsCommand: Remove one addJob overloadJarek Kobus2022-08-031-1/+1
| | | | | | | Remove defaultTimeoutS field, as it wasn't broadly used. Change-Id: I0056788b066eb6d682d5ba7acdb01d5dd3568967 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* VcsCommand: Get rid of setCookie()Jarek Kobus2022-08-021-5/+2
| | | | | | | | 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>
* VcsCommand: Limit the usage of setCookie()Jarek Kobus2022-08-021-1/+0
| | | | | | | | | | 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>
* VcsCommand: Limit the usage of setCookie()Jarek Kobus2022-08-021-67/+75
| | | | | | | | | | | | | | 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>
* VcsCommand: Limit the usage of setCookie()Jarek Kobus2022-08-021-1/+2
| | | | | | | | | 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>
* VcsCommand: Remove cookie() methodJarek Kobus2022-08-011-52/+56
| | | | | Change-Id: I2f83e141b05100c84c140d15a131e06ee62c6f68 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Move ShellCommand into VcsBase pluginJarek Kobus2022-08-011-84/+83
| | | | | | | | | | 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>
* ShellCommand: Introduce CommandResult structureJarek Kobus2022-07-291-216/+175
| | | | | | | | | 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>
* ShellCommand: Remove success() signalJarek Kobus2022-07-291-16/+25
| | | | | | | Use finished() signal instead. Change-Id: I4e28a2c6d90f40790cb9d19411186bd98402f4bb Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* GitPlugin: Avoid using sender()Jarek Kobus2022-07-221-1/+1
| | | | | Change-Id: Ie711630dd4b92bdc69990f421f69b578bc0fe9dc Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* GitClient: Avoid using sender()Jarek Kobus2022-07-201-10/+12
| | | | | Change-Id: I844b7c6545ae2244e5e45907e775fef53dd12931 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* VcsBase: Hide VcsCommand classJarek Kobus2022-07-131-29/+29
| | | | | | | | | | | | 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>
* ShellCommand: Merge VcsCommand::VcsRunFlags into RunFlagsJarek Kobus2022-07-121-57/+57
| | | | | | | Use ShellCommand class name in signal-slot connections. Change-Id: Id50ee6887708558a2ba0972ece6c420b0be36f72 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Remove Core::ShellCommandJarek Kobus2022-07-111-2/+2
| | | | | | | | Move the implementation into VcsCommand. Use Utils::ShellCommand inside coreplugin API. Change-Id: I74a34057b33832a138b05f1dfa6937565027edb4 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: Do not run 'git --version' synchronously at startupEike Ziller2022-06-291-28/+37
| | | | | | | | | | | 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>
* GitClient: Don't call blocking waitForStarted()Jarek Kobus2022-06-281-39/+59
| | | | | | | | | | | | | | | 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>
* MergeTool: Don't call blocking waitForStarted()Jarek Kobus2022-06-221-2/+1
| | | | | | | | | 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>
* Utils: use cleaned stdout all over the place againDavid Schulz2022-06-171-49/+49
| | | | | | | Amends 5ee880ce5e6998170823e6fc9afb6b6c36c6170a Change-Id: Ie0202db7d8455372c3697087d9571db6706b45a1 Reviewed-by: hjk <hjk@qt.io>
* VCS: Append newlines to system messages in output paneOrgad Shaneh2022-05-191-2/+2
| | | | | Change-Id: I3ca2d2e90ea0a97dd75feb7d1f8220564a138fb5 Reviewed-by: hjk <hjk@qt.io>
* Git: Fix compilation with Qt5Orgad Shaneh2022-05-121-3/+9
| | | | | Change-Id: Ib35095ccdacd13eaf2f599c9b47f7934c5d02591 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: Make git show more asyncOrgad Shaneh2022-05-121-52/+75
| | | | | | | | | | | | | 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>