Commit Graph

512 Commits

Author SHA1 Message Date
Andre Hartmann
d5cbdde11f Git: No else after return
Change-Id: I1c054bbb3b7a7060775e8015a74ee396cf84cca1
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-05-09 18:09:13 +00:00
Andre Hartmann
f486ff7dab Git: Add git bash to tools menu
Can be useful to perform tasks that don't have
a dedicated UI in Creator.

In my setup, git bash was directly in the git
installation folder %ProgramFiles%\Git and
therefore one level above git.exe itself.

Change-Id: I1ca0d3439690170d7fb840bca17e2c412effe0a4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-05-05 14:23:03 +00:00
Orgad Shaneh
9e3bbf36f2 Git: Change some functions in GitClient to const
Change-Id: Iefd3e0345c7a507d1d5c225ea81677e7a93df295
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2020-04-10 14:18:56 +00:00
Leena Miettinen
ff8751c576 Git: Fix UI text according to the guidelines
https://doc.qt.io/qtcreator-extending/qtcreator-ui-text.html

Task-number: QTCREATORBUG-23683
Change-Id: I1843de5a9166760bf52632f75dab74507029bf8c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-03-11 10:23:37 +00:00
Orgad Shaneh
ba87fb2083 Git: Add actions for changes in output window context menu
Change-Id: I5aa46f87b82670286ac225d71a3a045133976e86
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-02-28 09:53:51 +00:00
Orgad Shaneh
7c4f0a9b1e Git: Store singleton instance in GitClient
On many cases, GitPlugin is not required at all, and is only used as
a proxy for GitClient.

Change-Id: I246012658ab3e8c7a12f1a459b1b1748ff358e0b
Reviewed-by: hjk <hjk@qt.io>
2020-02-26 10:29:27 +00:00
Orgad Shaneh
b2ceb7db79 Git: Open log for ranges in output window
Show doesn't make much sense.

Change-Id: I945910749fa99245469164c1a411ce39b9f4f3d4
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-02-24 07:13:25 +00:00
Orgad Shaneh
a83f0c5d74 VCS: Replace QRegExp with QRegularExpression in VcsBaseEditor
Change-Id: I8e8a6649e441597e29e88506d494ec69260bebd1
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-02-21 08:28:34 +00:00
Orgad Shaneh
2110be00ab Git: Move filter widget to GitEditor
and make it a QToolBar.

Change-Id: I6a16b1a828bfabaace8e14ef39344f7f2bac7e8a
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-02-20 19:05:16 +00:00
Orgad Shaneh
ee05e49f79 Git: Support entry list in reflog
Change-Id: Ic24eff465c6870f42c1964a8700cc6f0b2c0dce5
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-02-19 07:23:42 +00:00
Orgad Shaneh
857102748d Git: Refine editor names
Change-Id: I8302e1341e589b3c0e39c3d6c1d73b01e142e517
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-02-19 07:23:26 +00:00
Orgad Shaneh
c728d04b52 Git: Support reflog also for branches
Change-Id: I9321ba4964d086d90aaf540a2006f95b94de8375
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-02-19 07:23:11 +00:00
Orgad Shaneh
1b2aa56f15 Git: Add grep and pickaxe filters
Fixes: QTCREATORBUG-22512
Change-Id: I98eed9a7f9da15e163804a0fd81713149a06c5b0
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-02-17 13:11:52 +00:00
Andre Hartmann
4cbb24906f Git: Allow clicking references in VcsOutputWindow
Fixes: QTCREATORBUG-16477
Change-Id: If1f36bec0826a3116e5261a270cd63a1536e13f5
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-02-16 19:13:53 +00:00
hjk
9c96a1c4de Vcs: Make VcsBaseEditorWidget::test* operate on factories directly
Saves re-discovery by id.

Change-Id: I026c1388d02f125147a9b4f5367d7a1a266bff3c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-02-13 07:10:21 +00:00
hjk
6f2beafaf2 Git: Make a few objects proper plugin pimpl members
Change-Id: Ib996ed248cd6e10d49fa3ae1086189acfc04de34
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-02-07 13:01:35 +00:00
hjk
eb1226df68 Git: Partially move plugin pimpl to .cpp
Same procedure as for ClearCase.
Unfortuately, some deep accesses are not easy to get rid of. Make them
available by static functions in the plugin itself. Definitely not the
favorite setup, but allows to proceed with the QObject removals.

Change-Id: Id85ed07bc7a6c1c053431a14dd7f68892f7ebea0
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-02-07 12:56:10 +00:00
hjk
9c02a11039 Vcs: Separate plugin and QObject parent roles for VcsSubmitEditorFactory
These are different when the factories are used as real members,
as already done in Bazaar.

Change-Id: I3c187896dcbacb5156be1543424ccacb9140a493
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-02-06 15:02:04 +00:00
hjk
7f37c503db Vcs: Move responsibility to set editor parameters to editor factory
So it doesn't need to be named twice in the editor factory setup.

This intentially includes a de-optimiztion: storing the parameters
by value, not by pointer. That's more natural, does not need to
keep the parameters alive on the caller side, and it's uncritical
in this context.

Change-Id: I92867d3f2f75c38911ae82d3eeb4759cba71b723
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-02-06 07:03:44 +00:00
hjk
d506a005ac Vcs: Remove some unneded indirections
Change-Id: Ie9d976c06ff424fb106cb344bedb789c9b99e657
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-01-31 12:43:06 +00:00
hjk
b8fe25db25 Vcs: Merge IVersionControl and VcsBasePlugin hierarchies
They were 1:1 in parallel, with quite a bit of function call
ping-pong inbetween, for code-sharing-by-inheritance. Merge
them by making VcsBasePlugin inherit IVersionControl and
merge the derived classes below.

Size of this patch is hard to avoid as all seven systems have to
move simultaneously. Non-necessary potential follow-up cleanup
have been left out on purpose.

Change-Id: Icb71e4182af3db21069cc637e7ae87ffa3829791
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-01-31 12:36:23 +00:00
hjk
b093941435 Vcs: Drop VcsBaseOptionsPage hierarchy level
Adapt the remaining users: Cvs,Git,Svn.

Change-Id: Idd730a33e5c64d18002b1a21b5f5c715b7fa5ffb
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-01-27 06:44:55 +00:00
hjk
866f3aeb4a Vcs: Pass settings handles to settings pages more directly
Change-Id: I5fdec80de5678dd544713fc18335cbd805d7b9f4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-01-24 11:40:49 +00:00
hjk
1cd936c531 Vcs: Pimpl plugins
Essentially rename all *Plugin into *PluginPrivate, and pull out
the actual IPlugin related pieces into new *Plugin classes.

Shift the construction of the PluginPrivate to initialize(),
following the general pattern.

I tried to keep the patch as mechanical as possible, giving
room to some obvious but less mechanical cleanup needs,
that are intentionally left out of this here.

Change-Id: Iac662bf73338f9f7669064ed67b960246875c23c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-01-24 09:47:28 +00:00
Christian Kandeler
56cd4ad28f Git: Fix memory leak
Change-Id: If9dbc29f0b58a81319b3490821edf5f7afce90ab
Reviewed-by: hjk <hjk@qt.io>
2020-01-23 11:28:21 +00:00
hjk
823c44de18 Vcs: Move static functions out of VcsPlugin "namespace"
Plan is to split VcsPlugin in the pure IPlugin and a new class
the remaining non-IPlugin bits of VcsPlugin, call it VcsPluginPrivate
and use that d-ptr for VcsPlugin. VcsPlugin-derived classes can
then use VcsPluginPrivate derived private, later pointer members
of the *Privates can be made proper members, moving towards the
otherwise predominant plugin setup pattern.

Change-Id: I62db9269e8ca50633c24b6d1d735d59c8fa8e5a5
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-01-23 08:20:36 +00:00
hjk
f5d4b65931 Vcs: Dissolve VcsManager::registerVersionControl
It's a somewhat unusual pattern, spelling it out will help
to move the vcs plugins setup closer to the now-usual pattern.

Change-Id: Ie7b70e52d75e34cd36b6a1d55ca868e3edab44a7
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-01-22 11:32:04 +00:00
Christian Stenger
4fe2d9a43d Git: Fix missing include
Fixes the build on macOS.

Change-Id: I22046de5d2ea27a649742dcc19cf1254747bf318
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-01-16 07:00:45 +00:00
Andre Hartmann
d2d05c584e Git: Start interactive rebase from log window
Useful if local changes are already pushed to a
remote and therefore Creator refuses interactive
rebase due to missing local commits.

Task-number: QTCREATORBUG-11200
Change-Id: I2e9b9fd35b75fcb232c1358c553fe1092ce97161
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-12-30 09:28:32 +00:00
Andre Hartmann
da6972e0a9 Git: Update current branch after some operations
... to refresh the branch view upstream status.

No need for a full model update here, only the current
branch is influenced.

Change-Id: I6bd17a841988b36221e5015a5858071d33a7b5e5
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-12-27 11:51:45 +00:00
Andre Hartmann
b292c30a13 Core: Make InfoBar::GlobalSuppressionMode an enum class
Change-Id: I859a727196a887f7699a667fbe07e1bfead4cb2b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-09-12 06:45:06 +00:00
Tasuku Suzuki
578cdf7c5a Git: Archive support
This allows users to create archive files from local repository.

Tools > Git > Local Repository > Archive will create <reponame>-
HEAD.tar.gz

Tools > Git > Actions on Commits... you can choose a commit to archive

Change-Id: I09bbbdefe532237e9065d1ca3c21910a036ea149
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Tasuku Suzuki <tasuku.suzuki@qbc.io>
2019-06-10 18:19:57 +00:00
Orgad Shaneh
7096649fc2 Merge remote-tracking branch 'origin/4.8'
Change-Id: I5b18233936e3b2cd674df92a694ba73b5a3ed752
2018-12-03 09:56:07 +02:00
Orgad Shaneh
f5203796e4 Git: Use ICore::dialogParent as dialog parent
Change-Id: Idc3f2f4d27d3279f76b688fac635e8d38b2705f5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-11-29 14:56:43 +00:00
Andre Hartmann
e65131ac11 Git: add svn dcommit
It's the counterpart to git push when working with
SVN remotes and git-svn.

Change-Id: I02257ea921fdcdedec294b28e8756ed88fb764b3
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-11-25 14:19:30 +00:00
Orgad Shaneh
15b176e30c VCS: Improve dialog on submit prompt
The dialog appears when closing the commit dialog without committing,
or when "prompt to submit" setting is enabled.

Fixes: QTCREATORBUG-18799
Change-Id: I8eb20becbcee7281b9f673a35ec698c6f8e04a40
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2018-11-12 18:35:44 +00:00
Orgad Shaneh
644110f6e0 Git: Block [*_]HEAD for branch name
Can have false positives, but I think it's better than tracking all of
git's internal names.

See https://stackoverflow.com/a/17596689/764870

Change-Id: Ifa3d942c4f791e5f8542e0cc174b934f2a95cbcd
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2018-11-12 09:48:52 +00:00
Orgad Shaneh
762fb5c353 Git: Make checkout asynchronous
It can be slow when many files are replaced.

Change-Id: I308698ef36973374f4526107fbda0d9ad907e707
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-10-10 08:30:16 +00:00
Andre Hartmann
3177e53804 Git: Add support for github remotes
Github and gitlab uses a different syntax when cloning with ssh:

 git@github.com:qt-creator/qt-creator.git

Support this pattern for remote validatation also.

Change-Id: Ic67f2238b9cdd526e76715c86846542cdb73f503
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-10-07 15:44:01 +00:00
Andre Hartmann
96f982a016 Git: Check remote port for isValid in GitRemote
Change-Id: Iab922abcde0ac055417467f3c63a31dffa721986
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-10-07 15:43:39 +00:00
Andre Hartmann
0dfb2938ed Git: Add tests for GitRemote
Change-Id: Ia5e0c482afa7847f5ae8dae1b15d1dabfc908e32
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-10-07 15:01:10 +00:00
Andre Hartmann
546956a302 Git: Allow creating a new repository from branch view
... when clicking "Add Branch" in a project that is not
under git version control.

The "Add Branch" serves no purpose here, so re-use it
to call this (already existing) function.

Done-with: Orgad Shaneh <orgad.shaneh@audiocodes.com>
Change-Id: Ib23d2cbeec0598e0b6f00cbde265793cc25e6142
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-09-30 05:37:09 +00:00
Andre Hartmann
017f4d7c4d Git: Add shortcut to "manage remotes" to branch view
Change-Id: I36d9196a41869176f8ad602f1ba406402fc5b77c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-09-30 05:36:53 +00:00
Orgad Shaneh
202d40f256 Git: Modernize
* Use auto
* Use override
* Use some member initializers

Change-Id: I3ca000d1c8e4d02331d58b85e68e4d771c636b29
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2018-09-19 19:47:07 +00:00
Orgad Shaneh
296ae92853 Git: Change pull to run asynchronously
Fixes: QTCREATORBUG-13279
Change-Id: Idee6e64e5eebe729e7c1d0e0135a1d8b464187b7
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2018-09-19 17:02:24 +00:00
Andre Hartmann
62072903b0 Git: Remove unneded qualification to Core
Change-Id: Ide8e7010410fe8184d9ef4dd37ddbf77ff5f1edf
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-09-15 17:55:05 +00:00
Andre Hartmann
fc36a0b5bd Git: Switch to edit mode when branch view is requested
The branch view is shown in the right side bar, which is
not visible in debug mode, for example.

Task-number: QTCREATORBUG-21088
Change-Id: If8fcab7a0b21d82534935bc555b79d1571d37633
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-09-15 17:54:52 +00:00
Andre Hartmann
e543ef5eb1 Git: Replace branch dialog with branches side panel
This allows all kind of typical Git workflow (rebasing,
merging, cherry-picking) without having the branches dialog
on top of all windows.

Task-number: QTCREATORBUG-19618
Change-Id: Iab078d79a589ff60fa8385c98ec2a23b352c084c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-09-12 18:24:52 +00:00
Orgad Shaneh
767137157e VCS: Consolidate submit editor actions setup
Change-Id: I36754779b6a9aa35de705b368daf8c2a1de058c6
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-08-28 07:26:14 +00:00
Orgad Shaneh
a39516aef1 Git: Update file model after unsuccessful commit
The commit operation itself [un]stages files before actually committing.
The model has to be refreshed after that.

Change-Id: I4b765005640b62812687d4f003d94af3717c379e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-06-19 09:37:14 +00:00