aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/git/gitplugin.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Git: BranchView: Allow cherry-picking a list of commitsAndre Hartmann5 days1-3/+27
| | | | | | | | ... 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>
* VCS: Add diff for file/directory in Projects/File SystemAndre Hartmann2025-11-241-0/+3
| | | | | | Task-number: QTCREATORBUG-33687 Change-Id: I7c85ab761e43b6e0f1b545754477746e6b1b31ca Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* VCS: Properly rename log functions and parametersAndre Hartmann2025-11-241-2/+2
| | | | | | | | | The actions are now for files and directories. Amends fe67869f71e5752a807f4c3bd0a51cda77bceaaf Change-Id: Id8259afc02edbc6785d0465506c9ffe72e001b84 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Use QString::size() instead QString::length()hjk2025-11-131-1/+1
| | | | | | | Minor gain in debug builds and when stepping. Change-Id: I2540d309661e4babfd7331b068c17657ded2a098 Reviewed-by: David Schulz <david.schulz@qt.io>
* TaskTree: Switch to qt-ified QtTaskTreeJarek Kobus2025-10-311-2/+2
| | | | | | | Remove the old Tasking lib. Change-Id: Iacb4939cc873e25d6039efae7dd23510a7baa5f9 Reviewed-by: hjk <hjk@qt.io>
* Core: Allow passing top level dir modificationStateDavid Schulz2025-10-241-5/+8
| | | | | | | | | | | | | | | This avoids looking up the toplevel dir a second time inside the git plugin. Since the modification state is used inside the project tree this reduces the time to calculate the size hint in the project tree from ~250ms to ~100ms for showing the tree for the first time on windows. Api: IVersionControl::modificationState(...) -> IVersionControl::modificationState(..., const FilePath &topLevelDir = {}) Change-Id: Ice89a62265f35d5bd1f87c5c4f1b6c6971e2db8e Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: André Hartmann <aha_1980@gmx.de>
* Fix UI text 2Leena Miettinen2025-10-011-1/+1
| | | | | | | | | | | | - Fix capitalization - Fix punctuation - Replaced '%1' with \"%1\" - Fixed the path to Preferences > Extensions Change-Id: Ib202c9a65b7f8c37efa365ab8901e22709ed60ba Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: hjk <hjk@qt.io>
* Avoid including multiple Tr classesEike Ziller2025-09-261-61/+56
| | | | | | | | | | | | | | | | | | | | lupdate has issues finding the right translation context if there are both Tr::tr calls that should be resolved via a `namespace <name> {` scope, and another `using namespace <other>` with a namespace that has another Tr class. Many of the cases of this that we have were editor display names that were defined in the Core plugin for reasons unknown, and which would better be defined in the corresponding plugin anyway. For the other cases do not use Tr::tr from a different plugin, but instead introduce "msg<Something>" functions that do the Tr call plugin- internally. That is the "correct" way to do it anyway, since shared strings should be changeable centrally. Task-number: QTBUG-140548 Change-Id: Idacf62b400f50789b5e5957b690e16aa1ebe5a56 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Git: Make two unstage actions asynchronousAndre Hartmann2025-09-031-1/+1
| | | | | | | | | | | * Tools > Git > Current File > Unstage * Git Submit > File List > Right Click > Unstage Both are user activated and not in a command chain so this seems reasonable. Change-Id: Icb7464d1d1a54b3f932f91ad1d4d706a543af4b1 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: Make 'git mv' work on remote projectshjk2025-07-171-3/+1
| | | | | | Change-Id: I59edb6b5583e7939874ebd7027840f03a8997813 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Vcs: Use FilePaths in void IVersionControl::filesChanged()hjk2025-07-111-2/+2
| | | | | | | | Api: IVersionControl::filesChanged(const QStringList &) -> IVersionControl::filesChanged(const Utils::FilePaths &) Change-Id: I77b9718b5eac46aa0b5122d25f319002a1d5c044 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: Make subversion fetch asynchronousJarek Kobus2025-07-111-1/+1
| | | | | | | Rename it to subversionFetch(). Change-Id: If24f1cc7f455f81eb30f5333f554b22bc37750df Reviewed-by: André Hartmann <aha_1980@gmx.de>
* Vcs: Get rid of vcsExec()Jarek Kobus2025-07-091-1/+1
| | | | | | | Use enqueueCommand() instead. Change-Id: I8c06e3111514a49fc4c02bbbeef172f52203f466 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Vcs: Rename InitialCheckoutData into CloneTaskDataJarek Kobus2025-07-071-2/+2
| | | | | | Change-Id: I01dc735993c8ce9ac5432c44857af0292914d4d9 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: André Hartmann <aha_1980@gmx.de>
* Vcs: Get rid of createInitialCheckoutCommand()Jarek Kobus2025-07-071-11/+0
| | | | | | | The cloneTask() is used instead. Change-Id: I3d732f12c8604fbcc38f1835df75b088085d1577 Reviewed-by: André Hartmann <aha_1980@gmx.de>
* Vcs: Introduce cloneTask()Jarek Kobus2025-07-071-0/+13
| | | | | Change-Id: I06eb974e4ac510a059fbc2a653698deea22f99e2 Reviewed-by: André Hartmann <aha_1980@gmx.de>
* Vcs: Introduce InitialCheckoutDataJarek Kobus2025-07-021-12/+6
| | | | | | | And reuse it in createInitialCheckoutCommand(). Change-Id: I9eda0a5e95261b030e41af2e8cf5d8852c3e8a9a Reviewed-by: André Hartmann <aha_1980@gmx.de>
* Macros: Add better examples for "prefix" variablesEike Ziller2025-06-301-0/+1
| | | | | | | | | | | | | Variables registered with `registerPrefix` are shown in the variable chooser as `Prefix:<value>`, and that was used to show the "current value" as the example in the variable chooser. Add an explicit "example value" to the registerPrefix calls that is used instead of "<value>" for the expanded example in the variable chooser. Fixes: QTCREATORBUG-33120 Change-Id: I4cc522856bf9a7fefeea2ea498de5f67d503b86a Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* VcsOutputWindow: Add working directory to append functionsAndre Hartmann2025-06-261-7/+8
| | | | | | | | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/17.0'Eike Ziller2025-05-191-8/+10
|\ | | | | | | | | | | | | Conflicts: src/plugins/squish/objectsmapdocument.cpp Change-Id: I07c6806b2a08fa4c9b5ce688f867e08bd0ed9a2c
| * Remove some spaces and line breaks from translatable stringsEike Ziller2025-05-141-8/+10
| | | | | | | | | | | | | | ... and add them in code where necessary instead. Change-Id: I2e6a2a0318bad055766f3d6c92ae0ffe08cb138a Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* | LogChangeDialog: Replace bool parameter with enumAndre Hartmann2025-05-151-3/+3
| | | | | | | | | | Change-Id: Ifceed5213e6b2c3fb38900f89f62f238b77736f9 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* | Git: Add creating patches from existing commitsAndre Hartmann2025-05-121-0/+35
| | | | | | | | | | | | | | With a change selection dialog and `git format-patch`. Change-Id: Ia50b1bdfbe8c2db811473603952edf1a3e1368d1 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* | Git: Add applying patches from clipboardAndre Hartmann2025-05-111-0/+21
|/ | | | | | | | Create a temporary patch file with normalized line endings and provide that to git. Change-Id: Ic9eaf7970e5d27dab0fe7b436b03f1995ea5cc45 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: Return Result<CommitData> from GitClient::getCommitData()hjk2025-04-241-5/+5
| | | | | | | | ... and make the template part of CommitData to remove the need of "out" parameters. Change-Id: I1d28e71392bd08e13970fc6c1c8cefac0079b094 Reviewed-by: David Schulz <david.schulz@qt.io>
* Replace a few FileSaver::errorString() uses with Result<>::error()hjk2025-04-231-2/+2
| | | | | Change-Id: Iad11dcc7393386d3ecc243afd7b51cc93eeab426 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Replace most expected_str by Utils::Resulthjk2025-04-111-1/+1
| | | | | | | | Keep it in Axivion dto, which is generated. Change-Id: I83a12de6234ac7b0218b369875bdc72d25dbadfb Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* ExtensionSystem: Return Utils::Result from IPlugin::initialize()Jarek Kobus2025-04-111-5/+2
| | | | | | Change-Id: I3c41ddcbbb2b2eb7c4c69797aa90fa794b4b9141 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: hjk <hjk@qt.io>
* Git: Add gitignore on repo creation in existing projectAndre Hartmann2025-03-081-2/+4
| | | | | | | | | | | | | | | | When a git repository is created by the project wizard, the .gitignore is created from a QtCreator template and added to the "files to be committed" list. Now perform the same when creating the repository later in an already existing project directory. If the project already contains a .gitignore, then use this existing file and just mark it for committing to git. Fixes: QTCREATORBUG-29776 Change-Id: Ie153c8dfb09a5640cf79941dfe7cfb608648a4b9 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: Add actions to show staged changesAndre Hartmann2025-02-121-11/+35
| | | | | | | | | | For the current file, current project directory and for the whole repository. Fixes: QTCREATORBUG-32361 Change-Id: I199dfa0e2072ee6f32c184e5c6def4a9e4a31927 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Merge remote-tracking branch 'origin/16.0'Eike Ziller2025-01-281-26/+0
|\ | | | | | | Change-Id: Ibca9430f24571ff4b7adee66b9fe521a567a14ca
| * GitClient: Get rid of gitVersion()Jarek Kobus2025-01-241-26/+0
| | | | | | | | | | | | | | | | We assume the minimum required version is 2.13. Change-Id: I8ed8b199700243182d1b55b936631865fe7e462e Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: André Hartmann <aha_1980@gmx.de>
* | Provide git configuration entries as Qt creator variablesRalf Habacker2025-01-271-0/+8
|/ | | | | | | | | | | | | With this commit, variables from the Git repository configuration of the current project are provided as Qt Creator variables. Corresponding variable names must be specified in the form '%{Git:Config:<key>}'. The user name known to git can, for example, be queried with '%{Git:Config:user.name}' Change-Id: I5ecb2589a9f8662950493e62f64248f9d853699f Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: André Hartmann <aha_1980@gmx.de>
* Git: Fix actions translator commentsAndre Hartmann2025-01-201-26/+59
| | | | | Change-Id: I53a3d523d24ebbd572600e381f82069aac8b577d Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Git: Fix translation of "status with untracked" actionAndre Hartmann2025-01-201-1/+4
| | | | | | | | Amends 61d822e7f7b65a218abfd7422a51d56d702e812d Change-Id: If571215392aaa4929f78345b9e3430b2ac83882b Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Git: Add status limiting untracked changesAndre Hartmann2025-01-131-0/+3
| | | | | | | | | | | | | | | Sometimes `git status -u` can be too verbose. Often we simply want to show untracked files within tracked directories, but sometimes a full list might be benefical. Add a separate action to support both use cases. Fixes: QTCREATORBUG-32301 Change-Id: Ie23457d92145957c499b732b080632daeb43badc Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Robert Löhning <robert.loehning@qt.io>
* Utils: Rename FilePath::toString() into toUrlishString()hjk2025-01-101-4/+4
| | | | | | | | | | | | | | | | toString() is almost always the wrong conversion, but unfortunately too easy to find and often even working at least for local setup. This here raises the bar as the non-availability of the "obvious" toString() hopefully helps people to think about the semantics of the needed conversion and choose the right toXXX() function. The chosen new name is intentional ugly to reduce the likelihood that this (still almost always wrong) function is used out of convenience. Change-Id: I57f1618dd95ef2629d7d978688d130275e096c0f Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* VCS: Allow disabling reflection of file statusChristian Stenger2024-11-151-0/+5
| | | | | | | | | | | | | | | Displaying the file vcs status permanently may become quite expensive. Explicitly let the user decide whether to enable this feature or not, but disable it by default for now as there should be several ways to improve performance and limit running the vcs client to times when this is really necessary. Task-number: QTCREATORBUG-32002 Change-Id: I00d206d52b74b5daa5b5d0b0022b32f11d51faf5 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: Allow blame for real single line selectionAndre Hartmann2024-11-111-6/+15
| | | | | | | | | | | | | Before, the selection needed to span two lines, at least the cursor had to be in the next line. This was to not trigger a single line blame when a word was selection. But now allow a selection from line start to line end also. Amends 7a5b45bdc22ff10ba52fc1b31f2c4bb7819f19a0 Change-Id: I629a551a98156d372ac7265faad907a3185ab258 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: Fix "Log for selection" for single line selectionAndre Hartmann2024-11-101-1/+1
| | | | | | | | | | | | It was already possible to perform the action without selection (then the line with cursor was used) or for selections spanning at least two lines. This fix allows selections within a single line. Fixes: QTCREATORBUG-31981 Change-Id: Idccc2ee07e02c89b1286e7bcbb6d584e35b31309 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: show modification statesRenaud Guezennec2024-10-031-3/+3
| | | | | Change-Id: I94d91e34489e6bb2e23cabe8f0c93dfc01ca7812 Reviewed-by: André Hartmann <aha_1980@gmx.de>
* VcsBase: Fix a crash on shutdownJarek Kobus2024-09-121-1/+1
| | | | | | | | | | | | | | | | | | Since GitClient is a static object, it's being deleted after the git plugin is unloaded. We can't make it a parent of VcsCommand instances, as the process reaper may be already gone. Use ExtensionSystem::shutdownGuard() as a parent for VcsCommand instances instead. This commit reverts d5e8f70192494859b36b5539ab063e2cc0fdd896. Amends d5e8f70192494859b36b5539ab063e2cc0fdd896 Fixes: QTCREATORBUG-31549 Change-Id: I27e6abbfcac2746e8fa4c447010aab43c11444a9 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: André Hartmann <aha_1980@gmx.de>
* Git: Replace "SHA1" with "hash" in code and commentsAndre Hartmann2024-09-091-5/+5
| | | | | Change-Id: Iaa6712338b86a5a7fd4889734d5650c6751fcf95 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: Colorize modified files in projects viewRenaud Guezennec2024-09-091-0/+24
| | | | | | | | Fixes: QTCREATORBUG-8857 Change-Id: Ie52ef20d6559046eb709f34329250cecc33db3bc Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ProjectExplorer: Add VCS log for selected directoryAndre Hartmann2024-09-081-0/+3
| | | | | Change-Id: Ie4ad575eaa4cd1adea1e10a65dc04f1aa945b300 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* VCS: Unify displayName()Andre Hartmann2024-09-061-6/+1
| | | | | | | | | | | | * Uppercase first letter or whole name * Do not translate the name * Move implementation to declaration to immediately see all names in Find Usages Change-Id: I45f9b8bd8cfab46ab72548d22b140169880fe81f Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Git: Add file log for selected linesAndre Hartmann2024-08-291-8/+56
| | | | | | | | Limits the log to commits that touched the selection. Fixes: QTCREATORBUG-31146 Change-Id: I8e581ca113c9564e1484b0b7e17de7e95cdce0bc Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Revert "Git: Colorize modified files in projects view"Andre Hartmann2024-08-291-24/+0
| | | | | | | | | | | The code looks unsafe and leads to crashes. More investigation is needed. This reverts commit 64952cb511911afa4bbe2363cfa7e372aaa47e29. This reverts commit 3208cbf9ab4e4f9b46d6d4d0513a8a53c5fe0424. Change-Id: I3a96c98a35e14b23beae03484e623e7d09cc29b5 Reviewed-by: hjk <hjk@qt.io>
* Git: Colorize modified files in projects viewRenaud Guezennec2024-08-241-0/+24
| | | | | | | Fixes: QTCREATORBUG-8857 Change-Id: I9922f731cf3c7a7f25a72cbe6eab64391f4f8054 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: Clarify "Current Project" menu and locator entryAndre Hartmann2024-08-241-19/+25
| | | | | | | Fixes: QTCREATORBUG-10170 Change-Id: I064b68fdc8f69cacd33a5047d50e98abf4793d62 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Robert Löhning <robert.loehning@qt.io>