Commit Graph

742 Commits

Author SHA1 Message Date
Orgad Shaneh
4c27b0e6e7 Git: Disable merge tool execution for vimdiff
vimdiff requires a terminal, which is not supported in Qt Creator.

Fixes: QTCREATORBUG-21147
Change-Id: I6168ac9c4a03061a64a1699fca6f39c90df5168b
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-10-11 10:42:19 +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
e79d68dab6 Git: Improve local file detection in GitRemote
* Make sure url has a proper size before accessing
  its elements
* Also check for valid drive letter before ':'

Change-Id: I958cbd492caa8a6ad4a5bf424277d8287f8cf0d4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-10-02 19:42:18 +00:00
Orgad Shaneh
754fd66a0b Git: Suppress error messages for newly initialized repository
Change-Id: Ib7161e165fdf9cc2b1167b683e8e3dac17e0f1d6
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2018-09-29 16:51:45 +00:00
Orgad Shaneh
c415a03cea Git: Support move/copy detection for blame
Fixes: QTCREATORBUG-20462
Change-Id: Ib2ea14de6a60691a1ed27cd07aac282557d69015
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2018-09-19 20:16:23 +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
Orgad Shaneh
760e6a9b13 Git: Fix launching of gitk when not in PATH
Tries the following:
* <git binary path>/gitk
* If git path ends with bin [or usr/bin, or mingw*/bin], try ../[../]cmd
* Search gitk in the PATH

Task-number: QTCREATORBUG-1577
Change-Id: I7f5e3d490bfeb527e2a5c1720126f1345e07eee0
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-09-04 09:33:25 +00:00
Andre Hartmann
495356ce9d Git: Fix remote detection for local remotes starting with "file://"
Task-number: QTCREATORBUG-20618
Change-Id: I21cddf88b64fa7a6acdc92228142976284ef8942
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-07-30 13:23:38 +00:00
Orgad Shaneh
943f499fe4 Git: Silence managesFile
When adding existing untracked files to a project, and choosing to add them
to Git, error messages appeared in the output pane.

Change-Id: Iba639a678d2ca424fb32b34b218fca1c4b99971d
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-07-09 09:33:20 +00:00
Nikolai Kosjar
b2f8ffdb20 Git: Fix handling Esc in "Create Local Branch" dialog
Change-Id: I8415e7ffcdbeb648b28273aa5791144e95f63de9
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-05-31 12:14:01 +00:00
Eike Ziller
428fcb476b Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/libs/utils/settingsaccessor.cpp
	src/plugins/autotest/autotestplugin.cpp
	src/plugins/git/gitclient.cpp
	src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp
	src/plugins/qbsprojectmanager/qbsrunconfiguration.h

Change-Id: I65f143cad18af509a2621d6c5925abbd038ea70f
2018-04-13 10:54:42 +02:00
Jarek Kobus
e806ea40cc Pass this context object to the connect()
Otherwise when "this" instance
gets deleted and the sender still exists, the lambda
expression is still invoked for the deleted object.

Task-number: QTCREATORBUG-20223
Change-Id: Ifd5c9e6ce1fe7fde71698c6683cdfcd7566e8d35
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-04-09 09:31:40 +00:00
Orgad Shaneh
7d3a79c696 Utils: Purge asConst
Replace by qAsConst.

Change-Id: I3301366f73c066c86f08df7188d70dc3b613c55c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-04-09 09:04:00 +00:00
Eike Ziller
cb84ae1a21 Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/plugins/android/androiddeployqtstep.cpp
	src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp
	src/plugins/qmakeprojectmanager/wizards/testwizard.cpp
	src/plugins/qtsupport/exampleslistmodel.cpp
	src/plugins/qtsupport/gettingstartedwelcomepage.cpp

Change-Id: I126823f5f60613509520c07f52be7bc9d4f4367c
2018-03-16 09:28:08 +01:00
Jarek Kobus
da2c66b1d0 Move git specific stuff out of diff editor plugin
Move it to the git plugin.

Change-Id: I8151573ed50df70776f7ebf0475dd41fb84fae83
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-03-15 11:21:01 +00:00
Tobias Hunger
0f53b35757 Git: Fix warning about unused lambda captures
Change-Id: I9535dccfe0af169efaa6dc09898d34c4c9e17efd
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-03-06 14:18:44 +00:00
Jarek Kobus
64233a4fae Fix repeting Stage/Unstage actions in unified diff editor
Don't store diff file index, chunk index and diff editor
controller anymore. Pass needed indices by value,
retrieve them when needed as lambda copy.

Change-Id: I3a81f1ab6d131c0b1d9899ac4b061b6e25582f51
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-02-16 06:48:27 +00:00
Andre Hartmann
6bc12ff446 DiffEditor: Replace bool arguments with flags enum
Change-Id: I70262476d015ba5b73069b149093dac66f7c6008
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-01-17 09:13:40 +00:00
Orgad Shaneh
d1baa80a98 Git: Do not pop the VCS pane on every [Un]Stage
Task-number: QTCREATORBUG-19051
Change-Id: I8dcf95238dcbc396b2dfe6a7d6048bbbb8551921
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2018-01-13 17:05:02 +00:00
Przemyslaw Gorszkowski
e25edc5020 Git: add reload button for 'git blame' and 'git log' windows
Change-Id: I64685e779bed91d41e38bdc1454571dbbcd7f177
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-01-09 12:28:26 +00:00
Orgad Shaneh
a8ddaafca4 Git: Introduce Recover Deleted Files action
Change-Id: I913c07522a8ca82366fd142597430c02e53faa27
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-01-09 11:33:21 +00:00
Eike Ziller
a2739f55ed Merge remote-tracking branch 'origin/4.5'
Change-Id: Ic7c16091268083c0426cf29f0691a7ee458f2bd9
2017-12-07 09:16:01 +01:00
Orgad Shaneh
2559ad48a8 Git: Show success message on push
Change-Id: I78433d7c7aec65fbafcba49fabf0562571dfbeff
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-12-05 10:12:09 +00:00
Robert Loehning
93c616b23f Git: Remove unused variable
Change-Id: If7656e0938380714bff655c80e6d0082a427ef71
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-10-23 09:08:24 +00:00
Orgad Shaneh
5d5d0497e5 Git: Use C locale when parsing the command output
Task-number: QTCREATORBUG-19017
Change-Id: Ib77d66e22d227d43245d352905f9b095f7d0f42b
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2017-10-12 18:52:58 +00:00
Orgad Shaneh
84b57027c8 Git: Fix progress during rebase
Broke by c4b5048836.

Change-Id: I35b22b6ab5fd8767ef729906b8344a0d6aa1f0cf
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-10-04 07:51:12 +00:00
Ulf Hermann
47886969cc Drop unused variables and lambda captures
Also, add context to connect() expressions where we are or were
capturing "this".

Change-Id: I6e006ba6f83d532478018550d148ee93eca59605
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2017-09-08 09:06:53 +00:00
Leena Miettinen
b29ea4527a Git: Do not use the (s) plural in UI text
The UI text guidelines advice against this.

Change-Id: Ib8f9cb291f0217de10853412b133173f1d11e7b7
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-07-28 08:06:56 +00:00
Jarek Kobus
4bea049c45 VcsBase: Create common base diff editor controller
Reuse it in subversion and git plugins.
It makes subversion diff more asynchronous than before.
Make VcsBase plugin dependand on DiffEditor plugin.

Change-Id: Iafea2941b890a95a269362e022af2dc03cdea550
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-07-05 14:20:07 +00:00
Jarek Kobus
0a2590e7be DiffEditor: process git diffs asynchronously
It won't freeze GUI in case of huge diffs.

Change-Id: Ida6bdcb1ef6867969cd86d4bc9652c64bc74e6ec
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-07-05 14:19:42 +00:00
Orgad Shaneh
a36536813f VCS: Set user choices on editor reload
Broke by 2c6adc1e74.

Change-Id: Iba435899c7b0da4b270f4ef8ece84c1839bf6b72
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-06-19 08:08:02 +00:00
Orgad Shaneh
89057b552b Merge remote-tracking branch 'origin/4.3'
Change-Id: I56004e3ec9dc9d92d33bdae438c4f7e069eccc45
2017-06-02 15:13:51 +03:00
Orgad Shaneh
2584c4e180 Git: Improve branch listing in Show
* Separate local and remote branches
* List branches for each remote in a separate line
* List up to 12 branches per group
* Elide in the middle, list first and last branches in each group

Task-number: QTCREATORBUG-16949
Change-Id: If293cbd2536921261d9f420c71c2b68c8cb5bfe2
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-05-29 10:38:59 +00:00
Orgad Shaneh
232442bc2d Git: Include decorations in Show
They got lost in 23b89f1e85.

Change-Id: I3ecbabf0886fdc66e6d7f097d48a02cff9df6cb3
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-05-24 08:57:20 +00:00
Orgad Shaneh
a4a146b3cb Move Git-specific logic from DiffEditor to Git
Change-Id: I29466c26a51844bb975ac3ecb68adf708021aa67
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2017-05-19 04:48:23 +00:00
Montel Laurent
5d27bc747b Use QFileInfo::exists(...) which is faster that QFileInfo(..).exists
Change-Id: I0d2e61d84c74e60ef4f54074a4ca00f2d0835562
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-04-14 13:18:28 +00:00
Andre Hartmann
b0ac6435b3 Git: Add new class GitRemote
Allows to split a remote URL and performs
some validation checks on the elements.

Change-Id: I048373076b1a1553fdd7bed2986a41cc087138b0
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-03-09 22:02:30 +00:00
Eike Ziller
cec29f34ea Merge remote-tracking branch 'origin/4.2' into 4.3
Conflicts:
	doc/src/qtcreator.qdoc
	tests/system/suite_general/suite.conf

Change-Id: Ia298b177d6920a1d853e342b62cf98f7c48a278a
2017-03-09 12:14:55 +01:00
Orgad Shaneh
e575a60508 Git: Do not re-use diff controller
When the controller is re-used, the file list is not refreshed.

This doesn't cause a leak, since DiffEditorDocument::setController
deletes the previous controller if already set.

Task-number: QTCREATORBUG-17815
Change-Id: Ic30ef15f9df4fa1cc196dcd175e2df44a88b2f89
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-03 11:48:39 +00:00
Orgad Shaneh
151ae22bb9 Git: Fix "additional tools" path with "Git for Windows"
They're in usr/bin now.

Change-Id: I5efe5f7fcaf1f74393624b9bb8dd0ab3f0075d3e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-02-23 13:07:08 +00:00
Tim Jenssen
2631ffabd5 Remove spaces in initializer lists
Format initializer lists code style like.

Change-Id: Ib82c235e4ba7dc75ee96a7abc0c47eff7b0a9013
Reviewed-by: hjk <hjk@qt.io>
2017-02-22 16:25:09 +00:00
Orgad Shaneh
e366e135b7 Git: Eradicate Q_FOREACH loops
Change-Id: I29b6071ea244d1b3ae0701d36c90b1e93cf21fbb
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: hjk <hjk@qt.io>
2017-02-06 09:37:44 +00:00
Eike Ziller
55400d5bec Merge remote-tracking branch 'origin/4.2'
Change-Id: I8896af66cf8af7436cf3946ddb013742260d50a9
2017-02-01 14:07:43 +01:00
Orgad Shaneh
3ceb4c5c7a Git: Fix result check on reset
Choosing Discard on Pull, when there are uncommitted changes, fails
when it tries to execute git reset --hard.

This broke in ca7a924a06:
if (!rc) was replaced by if (resp.result == Finished).

Change-Id: I19e080ee08eb52bf2156da7c27ade4b77cf2ece0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-01-31 10:41:10 +00:00
Orgad Shaneh
7cfbcb41b9 Git: Persist topic per branch on Push to Gerrit
Change-Id: I5a4056f562bb3264a8bd35d73fb16860eb0984e7
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-01-23 11:53:12 +00:00
Tobias Hunger
c6f90e575e Utils: Introduce a TemporaryDirectory and TemporaryFile class
Both wrap the corresponding Qt class, but make sure all temporary files
or directories are created inside a "master temporary directory".

Change-Id: I55461be507c828c965224c02863ea5ed9bbf9498
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-20 12:17:10 +00:00
Jarek Kobus
8b67458a95 Prefix editor's uniqueId with plugin name
In this way we minimize the chance of
generating non-unique id.

Change-Id: Idd177c5a4b44b17a58c2a944ec77b9517e91964e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-01-10 15:14:19 +00:00