aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/git/gitclient.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Git: Branch View: Refresh after Create BranchAndre Hartmann4 days1-0/+2
| | | | | | | | | | ... from change context menu, but without checking out the new branch. Fixes: QTCREATORBUG-33846 Change-Id: Ifdc7c949951d20ccc3a79e8e6ee4ad9308cbf695 Reviewed-by: Robert Löhning <robert.loehning@qt.io> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: BranchView: Allow cherry-picking a list of commitsAndre Hartmann5 days1-5/+8
| | | | | | | | ... instead only the top commit of the selected branch. Change-Id: I42cb6e682afd239ee374f475215e580288b5a681 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: André Hartmann <aha_1980@gmx.de>
* Git: Blame: Add option to remove file path and authorAndre Hartmann8 days1-1/+7
| | | | | | | | | | | | | | | | | Git does not provide a way to omit the file path (only an option to force it). For files that have been moved the file path is included in the annotation so we need to filter it out manually. For more flexibility, replace the code with regular expressions. This is a bit slower, but makes the code more maintainable. For example, the filtering of gitclient.cpp (4070 lines) takes 15 ms on my machine and the worst I have seen so far was 20 ms. Fixes: QTCREATORBUG-33636 Change-Id: Ib82e02f1bd0d27248d807c374a61286ad96be93b Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* VCS: Print error when diff or log failAndre Hartmann2025-12-011-2/+7
| | | | | | Change-Id: I915e42033f01b83a3ad32339dcaef3d4ed2572f6 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Git: Add more interactive rebase functionsAndre Hartmann2025-11-301-0/+4
| | | | | | | | | | | | | | | | | Allow rebasing merges and updating references. Add the missing keyword `update-ref` to the highlighter. As the new functions require advanced Git knowledge and more recent Git versions than our current requirement 2.13, make them optional. Credits for inspiration go to: https://www.kdab.com/working-on-multiple-git-branches-without-switching Fixes: QTCREATORBUG-33786 Change-Id: I602a4a0c141621afd0bacd727b74bb7c79f67950 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* VCS: Add diff for file/directory in Projects/File SystemAndre Hartmann2025-11-241-7/+19
| | | | | | Task-number: QTCREATORBUG-33687 Change-Id: I7c85ab761e43b6e0f1b545754477746e6b1b31ca Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Vcs: Remove last 2 usages of RunFlags::UseEventLoopJarek Kobus2025-11-141-2/+1
| | | | | Change-Id: I23b7ab0cf20de98c0bbbffaa807d34f79cdef731 Reviewed-by: André Hartmann <aha_1980@gmx.de>
* Use QString::size() instead QString::length()hjk2025-11-131-5/+5
| | | | | | | Minor gain in debug builds and when stepping. Change-Id: I2540d309661e4babfd7331b068c17657ded2a098 Reviewed-by: David Schulz <david.schulz@qt.io>
* VcsBaseEditor: Remove some dead codehjk2025-11-041-0/+2
| | | | | | | Flagged by Axivion. Plus some cosmetics where I couldn't resist. Change-Id: I237ab3bde9cdc2f662d75857734d64557fa49a94 Reviewed-by: André Hartmann <aha_1980@gmx.de>
* Git: Fix clazy missing reference in for loop warningAndre Hartmann2025-11-041-1/+1
| | | | | | | | | gitclient.cpp:820:18: Missing reference in range-for with non trivial type (Git::Internal::GitClient::ModificationInfo) [clazy-range-loop-reference] Change-Id: I682166fd8c1862a28f3aeb55a6541c3f80ae68c6 Reviewed-by: André Hartmann <aha_1980@gmx.de>
* Git: Simplify file change watcher timerAndre Hartmann2025-11-041-20/+13
| | | | | | | | | | No need to delete the timer when the feature is disabled, just don't start the timer. Then, inline the last usage of setupTimer(). Task-number: QTCREATORBUG-33691 Change-Id: Ia14f932b26583f55181682c5ed444dcc9dbb0b0c Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* TaskTree: Switch to qt-ified QtTaskTreeJarek Kobus2025-10-311-5/+5
| | | | | | | Remove the old Tasking lib. Change-Id: Iacb4939cc873e25d6039efae7dd23510a7baa5f9 Reviewed-by: hjk <hjk@qt.io>
* Use QStringList instead of QList<QString>Alessandro Portale2025-10-021-1/+1
| | | | | Change-Id: I56fabbfe32ab579ef5e9f7c8cc5fde220b99769a Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Use Utils::FilePaths instead of QList<Utils::FilePath>Alessandro Portale2025-10-021-2/+2
| | | | | | | And remove unnecessary Utils:: for FilePath[s] in affected files. Change-Id: I3eba81519c22cded8a48a197c7b1a5d7835673f4 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Git: Stop modification status update when inactiveAndre Hartmann2025-09-021-0/+11
| | | | | | Task-number: QTCREATORBUG-32002 Change-Id: I47ef68a4a9b8b3bfa27db194d41486edbf494ccc Reviewed-by: André Hartmann <aha_1980@gmx.de>
* Git: Fix clazy connect context object warningAndre Hartmann2025-09-021-1/+1
| | | | | | | | gitclient.cpp:804:5: Pass a context object as 3rd connect parameter [clazy-connect-3arg-lambda] Change-Id: I2f34b493ded9c2bf335df1e32909760f2cce9629 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Avoid QtConcurrent module importsChristian Stenger2025-08-261-0/+1
| | | | | | | | | ...as module imports pull in all headers of the module including all headers of modules they depend on. See discussion around QTBUG-88831. Change-Id: Idef4ca1b6c3c5ce9c8085d469bf3942ad0d9b4f9 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Git: Move comment back to the correct placeAndre Hartmann2025-08-051-1/+1
| | | | | | | It seems to have moved away from there long time ago. Change-Id: I9499a536381b627bdca353768d35d5ea0ebf384b Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: SubmitEditor: Prevent amending during mergeAndre Hartmann2025-08-041-0/+10
| | | | | | | | | ... and cherry-pick. They must be finalized with `git commit` after conflict resolution. Change-Id: I04737613475f30aafe767ef1b44f420a7d7c354d Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: SubmitEditor: Add actions for conflicted filesAndre Hartmann2025-08-041-0/+21
| | | | | Change-Id: I2368eb97faf844cd010b005fc19691fec30242d7 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: Expect repo changes on modifying commandsAndre Hartmann2025-08-041-5/+6
| | | | | | | | | | | | | | | | Pull, (interactive) rebase, cherry-pick, revert and synchronous reset etc. can change files and branch states (e.g. ahead/behind markers in the branch view). synchronousMerge() and async reset(hard) already handled this situation correctly. And as soft and mixed resets also affects the ahead/behind markers, make them work like hard reset too. Fixes: QTCREATORBUG-29918 Change-Id: I233466387647756387c3f0a8989021a6d341602d Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* VCS: Consolidate and fix color handlingAndre Hartmann2025-07-301-9/+10
| | | | | | | | | | | | | | | Make file status coloring in Projects, File System and SubmitEditor equal. Therefore merge two enums and and consolidate the different items. Fix that untracked files were shown as unmerged (red) in Projects and File System view. On the other hand, unmerged files were not visualized at all. Also distinguish between untracked and added files. Change-Id: I7ed2a411b16d7b0a024a3f1f42aec5484b279ef0 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: SubmitEditor: Add actions for untracked filesAndre Hartmann2025-07-301-0/+6
| | | | | | | | | | | | | | Add actions to stage and unstage them for commit or to add them or a mask to gitignore. The leading '/' makes the path anchored to the repository root: "/foo/bar/CMakeList.txt.user" "/foo/bar/CMakeList.txt.*" "/foo/bar/*.user" Change-Id: I38583f4e097597486f5ded680f1048ed1f9ea4c0 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: Call onDone only on errorJarek Kobus2025-07-251-1/+2
| | | | | | | | | | | | | | | The 1st Group should never be canceled, even when tasks executed there finish with an error. The 2nd Group could cause the 1st one to be canceled when diff command failed. To prevent the cancelation of the 1st Group, change the top level workflow policy to continueOnError. In this way, even when 2nd Group failed, we continue executing the 1st Group. Change-Id: Ie534564d07026e62ea10002448cedacea0ad2ede Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: André Hartmann <aha_1980@gmx.de>
* TaskTree: Rename CallDoneIf and its valuesJarek Kobus2025-07-231-10/+10
| | | | | | | | | | | | | | | | | | | | In fact, CallDoneIf::Error was called also in case of DoneWith::Cancel. and CallDoneIf::SuccessOrError was called also in case of DoneWith::Cancel. Rename CallDoneIf into CallDone. Api: CallDoneIf::Success -> CallDone::OnSuccess. Api: CallDoneIf::Error -> CallDone::OnErrorOrCancel. Api: CallDoneIf::SuccessOrError -> CallDone::Always. Prepare to make it a flag type. This is a preparation for fixing the 33th point of the bugreport below. Task-number: QTCREATORBUG-28741 Change-Id: I18ef1a66593e01052e1668bd585bb8402f705455 Reviewed-by: hjk <hjk@qt.io>
* GitClient: Wrap the instance around GuardedObjectJarek Kobus2025-07-211-1/+2
| | | | | | | | | | The client, containing running task tree, needs to be destroyed when the main event loop is still spinning. Fixes: QTCREATORBUG-33221 Change-Id: Ib07006ec486de7dcdb8b431df79546c71e8a27b3 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: André Hartmann <aha_1980@gmx.de>
* Git: Make 'git mv' work on remote projectshjk2025-07-171-4/+3
| | | | | | Change-Id: I59edb6b5583e7939874ebd7027840f03a8997813 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: Make reset() fully asynchronousJarek Kobus2025-07-111-12/+28
| | | | | | | Use async status, if needed. Change-Id: I2c6390c3b3ab0b648d603932069740c138635672 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: Introduce statusTask()Jarek Kobus2025-07-111-0/+38
| | | | | Change-Id: I9dc12df5ab9fadc42824ad3fcf32c50fefa37378 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: Move StatusResult outside of GitClientJarek Kobus2025-07-111-19/+19
| | | | | | | And make it an enum class. Change-Id: I578f45652d53ff80723569de72681a423b2cdaa6 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Vcs: Use FilePaths in void IVersionControl::filesChanged()hjk2025-07-111-1/+1
| | | | | | | | Api: IVersionControl::filesChanged(const QStringList &) -> IVersionControl::filesChanged(const Utils::FilePaths &) Change-Id: I77b9718b5eac46aa0b5122d25f319002a1d5c044 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: Make part of recoverDeletedFiles() asynchronousJarek Kobus2025-07-111-11/+13
| | | | | | Change-Id: Ief624c5d56f96a266e206492740264b01ee9f722 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: Make subversion fetch asynchronousJarek Kobus2025-07-111-3/+3
| | | | | | | Rename it to subversionFetch(). Change-Id: If24f1cc7f455f81eb30f5333f554b22bc37750df Reviewed-by: André Hartmann <aha_1980@gmx.de>
* Utils: Make FilePaths a full class instead of a QList<FilePaths> aliashjk2025-07-111-1/+1
| | | | | | | | | | | | | Creates a natural place for named constructor and conversion functions. Api: Created Utils::FilePaths as full class instead of a QList<Utils::FilePaths> alias Api: Utils::FilePath::fromStrings -> Utils::FilePaths::fromStrings Api: Utils::FilePath::fromSettingsList -> Utils::FilePaths::fromSettings Api: Utils::toFilePathList -> Utils::FilePaths::fromStrings Change-Id: I1786519206dd1fb68f410d54ce77a0846dc1f9de Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Git: Get rid of context argJarek Kobus2025-07-091-5/+3
| | | | | | | We enqueueCommand() now, so context is GitClient always. Change-Id: Ic786f7b5e590ff1429609d1c70765c0e3a0d10fe Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Vcs: Get rid of vcsExecWithHandler()Jarek Kobus2025-07-091-26/+27
| | | | | | | Reuse enqueueCommand() instead. Change-Id: I28d325536d219b42517b32a8c0fda1aafe04b177 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Vcs: Get rid of vcsExec()Jarek Kobus2025-07-091-15/+16
| | | | | | | Use enqueueCommand() instead. Change-Id: I8c06e3111514a49fc4c02bbbeef172f52203f466 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: Reuse enqueueCommand in vcsExecAbortable()Jarek Kobus2025-07-091-15/+9
| | | | | Change-Id: I90068eb373e3a33015dd73f61e639b0ec8c5b5c3 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Merge remote-tracking branch 'origin/17.0'Eike Ziller2025-07-081-2/+2
|\ | | | | | | | | | | | | | | Conflicts: src/libs/utils/textfileformat.cpp src/plugins/git/gitclient.cpp Change-Id: I502ca9c1ec28c1df9988ec9fa2ed5949bc45f615
| * Git: Fix wrong "Cannot launch" message for git gui on WindowsOrgad Shaneh2025-07-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | When running a gui application on Windows, the process receives a done signal with error code 259 (STILL_ACTIVE). This is not really an error so there is no reason to notify the user. For gitk only StartFailed is checked, which is better. Do the same for git gui. Change-Id: I332c911bceea92bca5bfc9e2bce488a3eea57417 Reviewed-by: André Hartmann <aha_1980@gmx.de>
* | Vcs: Rename vcsExecWithEditor() into executeInEditor()Jarek Kobus2025-07-071-4/+4
| | | | | | | | | | Change-Id: I8d4b34f855b4fee679e85fdbf31867c44915b4a3 Reviewed-by: André Hartmann <aha_1980@gmx.de>
* | VcsOutputWindow: Add working directory to append functionsAndre Hartmann2025-06-261-47/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Get rid of the setRepository() calls, that were missing from some places anyway and did not support overlapping output from different working directories. Also make the basic append() private and only expose the specialized append...() functions. The working directory is most often a real repo, but sometimes also the working directory of a VCS command. Fixes: QTCREATORBUG-31894 Change-Id: I9988c26307c81dcc5713f339e9d493eaca836131 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* | Utils: Replace some TextCodec::toUnicode() overloadshjk2025-06-251-5/+4
| | | | | | | | | | | | | | | | | | | | ... and fix some fallout. At some point we need solution for the "mib problem". The concept seems unknown in the QStringConverter world. Change-Id: I64b48d5d1720b9eee3b729b3490eb62d57b45213 Reviewed-by: David Schulz <david.schulz@qt.io>
* | Git: Avoid all branches option for line logAndre Hartmann2025-06-201-1/+7
| | | | | | | | | | | | | | | | | | | | | | Both options contradict and lead to an error message if the file is changed in two branches foo and bar: fatal: More than one commit to dig from: refs/heads/foo and refs/heads/bar? Change-Id: I8f7c652aa2000e9e5d258bf1b584d39f267e4198 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* | Utils: Progress towards using TextEncodinghjk2025-06-191-3/+3
| | | | | | | | | | Change-Id: I2aa56d4803980b4e43493542fbf2b103f77f16ab Reviewed-by: David Schulz <david.schulz@qt.io>
* | Utils: Move TextCodec::encodingForLocale() to TextEncodinghjk2025-06-181-1/+1
| | | | | | | | | | Change-Id: I8d1f446dc8061b1ad48e63d6f8b0cb4c9946a0dd Reviewed-by: David Schulz <david.schulz@qt.io>
* | Merge remote-tracking branch 'origin/17.0'Eike Ziller2025-06-171-0/+1
|\| | | | | | | | | | | | | | | Conflicts: cmake/QtCreatorIDEBranding.cmake qbs/modules/qtc/qtc.qbs Change-Id: Iac555437405e993475736232b3cf2402cf9fe8ed
| * Git: Avoid creating unnecessary lock filesAndre Hartmann2025-06-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Starting with Git 2.15 (which is newer than our current requirement 2.13), git status can be used without modifying the index and therefore requiring locks. And by using the environment variable `GIT_OPTIONAL_LOCKS` we are still compatible to 2.13, while most users with newer git version can already benefit from the feature. Task-number: QTCREATORBUG-31952 Change-Id: Id86f564b20fb55f42b3492144df3593503c1a313 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* | VCS: Further reduce QTextCodec dependencyhjk2025-06-131-21/+22
| | | | | | | | | | | | | | | | | | Use the new Utils::TextEncoding (a thin wrapper containing a codec's name) instead of a codec itself. Change-Id: I29d61c9884b7e35dc59d8123e697c63f6b748caa Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* | Git: Improve file modification status updateAndre Hartmann2025-05-251-37/+53
| | | | | | | | | | | | | | | | | | | | | | * Do not spawn parallel git processes, queue them and handle one-by-one * Change the timer to single shot and restart it after the last git process ended to avoid overlapping runs Task-number: QTCREATORBUG-32002 Change-Id: I2731057625406bac66aa8d731e888704b8203328 Reviewed-by: Orgad Shaneh <orgads@gmail.com>