Commit Graph

698 Commits

Author SHA1 Message Date
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
Tasuku Suzuki
ac83af4ef0 Git: Add Sign off feature in git commit view
Change-Id: Icb0a8818f707d6a874a9b97318fc6a93205b4ce9
Signed-off-by: Tasuku Suzuki <tasuku.suzuki@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-01-05 08:17:33 +00:00
Eike Ziller
e487b3bd55 Merge remote-tracking branch 'origin/4.2'
Change-Id: I575f1cf98f2a4740577cdd94da21687d3392cdb7
2016-11-30 15:09:11 +01:00
Orgad Shaneh
329c24ce3a Git: Replace msysGit with Git for Windows in comments
msysGit is obsolete

Change-Id: Iaa2aee0de2e8280dcc060cdd26b41962fb38a112
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-29 16:34:44 +00:00
Orgad Shaneh
7b3642cce4 Merge remote-tracking branch 'origin/4.2'
Change-Id: I259a402bc896fc2e359cc96b7510453ac9a9a552
2016-11-28 15:27:51 +02:00
Jarek Kobus
c1b6685d50 Reuse existing controller when requesting existing diff editor
Change-Id: I01d54f0bd131b8ae7daee74533375920fa544adf
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-11-22 13:36:36 +00:00
Orgad Shaneh
9c09ca9e42 Merge remote-tracking branch 'origin/4.2'
Change-Id: Ia98031eb87f1859c3736faa0cdd8b655e8a50689
2016-11-14 11:17:13 +02:00
Orgad Shaneh
877a10c8ef Git: Support typechange
Replacing a normal file with a symbolic link.

Change-Id: Id07ab339e8fcdf039b61d6e459b8d751d499f4f6
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-09 08:53:51 +00:00
Orgad Shaneh
0bcfc977e9 Git: Show success message on abort
Change-Id: Ie0ec1a9c00673a6cd50c2a7c54b83303c80cf55c
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-09 08:50:16 +00:00
Orgad Shaneh
fd6b3cd484 Git: Enable "First Parent" display in log editor
Shows merge commits instead of recursing into them.

When Diff is enabled, it will be done against the merge commit's parent,
rather than showing conflict resolution.

Change-Id: Iaa3ac622ffde34e58763a968d387041e0ef99b21
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-10-25 08:47:52 +00:00
Orgad Shaneh
c844071627 Rename VcsBaseEditorParameterWidget -> VcsBaseEditorConfig
Change-Id: I5626e66ba2b7a760ce55263edce9e716067ea6a4
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2016-10-24 16:23:59 +00:00
Jarek Kobus
2c6adc1e74 VCS: Replace QToolButtons in VCS toolbar with QActions
Change VcsBaseEditorParameterWidget to add actions/widgets to an
existing toolbar, instead of being a widget itself.

The class is renamed in a follow-up commit.

Task-number: QTCREATORBUG-14934
Change-Id: I473a439d12a096f4cbb64f06faa0598ee72000de
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2016-10-24 16:23:33 +00:00
Orgad Shaneh
5b49ed506b Git: Return empty list for remote branches when there are none
The function currently returns "<Detached HEAD>"

Change-Id: I68786d5521549aacc29807632a5054593db24b3b
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-09-12 14:21:02 +00:00
Eike Ziller
841778ed69 Merge remote-tracking branch 'origin/4.1'
Change-Id: I80f96f100046625f24b6ab5d13fdb05660365abc
2016-08-22 16:30:56 +02:00
Orgad Shaneh
5fcfe97e23 Git: Detect rebase even if rebase-apply does not contain "rebasing"
It might contains only autostash.

Change-Id: Ie95c63bde2314aac1b6d37f01301822e41df177c
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-08-18 11:55:30 +00:00
Orgad Shaneh
cfc8ed41c7 Git: Some more QStringList cleanup
Change-Id: I0c6e8f768ee46985dab8ae14f88f2bc8d34fed26
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2016-08-15 07:30:06 +00:00
Orgad Shaneh
516161c875 Git: De-noise
* Remove QLatin1{String|Char} where possible
* Use initializer lists for QStringList

Change-Id: I8479f87f4fc909b5d74d854956885564209538e4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-07-22 10:12:59 +00:00
Orgad Shaneh
6567db9c5b Git: Delete unused cloneRepository function
It is now implemented by the wizard, using
GitVersionControl::createInitialCheckoutCommand.

Change-Id: Ie847402cf1bc22444d2142baa57bfac6a136fb8f
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-07-18 07:37:46 +00:00
Tobias Hunger
7c910e8b16 Git: Some more cleanup
* Remove some more QLatin1String/QStringLiteral
* Use algorithms

Change-Id: Iaa1042684c58be5ff0a42b9126b63ec681053fdc
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-07-15 14:27:22 +00:00
Tobias Hunger
ca7a924a06 VCS: VcsBaseClient::vcsFullySynchronousExec returns a SynchronousProcessResponse
Change-Id: Ic155da2ed1fd36f1f91327ac90f34a5cad3c210e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-07-15 14:16:29 +00:00
Tobias Hunger
5efd82468b SynchronousProcess: Store raw bytes from stdout/stderr of the process
Only convert the raw output later in a stdOut() and stdErr() method of
the SynchronousProcessResponse.

This is necessary since we have processes that use different encodings
for different sections of the file (I am looking at you, git).

Also remove the signals for raw data on stdout/stderr, leaving only the
signals returning buffered QString lines. This should be safe, even
with UTF-16 output.

Change-Id: Ida613fa86d1468cbd33bc6b3a1506a849c2d1c0a
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-07-15 14:16:03 +00:00
Tobias Hunger
bdff47afd5 Git: Sprinkle C++11 goodness over the code
Just initializer lists for QStringLists (mostly arguments) and nullptr.

Remove lots of QLatin1* while at it.

Change-Id: I0d8354bcbdb759db65da6153bb356fb4b8ed0e8d
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-07-11 07:49:00 +00:00
Nikita Baryshnikov
ac5d84372a Git: fix compilation
comparison between QDialogButtonBox and QMessageBox enum values.
Introduced here: 34f75be322

Change-Id: I19b50e5a4da643e7917346af19170022ffe61f34
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-06-30 08:59:23 +00:00
David Schulz
34f75be322 Git: Add a do not ask again checkbox to the pre checkout message box.
Makes it possible to not query the user on every checkout if he wants to
create a local branch.

Change-Id: I22d8ef03fb98648cafb3f11a008bb24c291cb807
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-06-24 11:50:17 +00:00
Orgad Shaneh
3845c833fc VCS: Return the editor in VcsBaseClient::annotate
Will be used in a follow-up commit for setting base line number
for limited range blame.

Change-Id: Ibae90f3ac982ebe9f53aa282f70c2c703e9eeb9d
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-06-14 07:56:55 +00:00
Andre Hartmann
9efdfde088 Git: Adapt argument append style
All surrounding lines use operator<<(), so be consistent.

Change-Id: I9b301d0d00a17f0281142dd2c67c43bd7f2a680d
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-05-20 08:07:26 +00:00
Orgad Shaneh
82903ba124 Git: Do not append extraOptions twice in blame
Change-Id: I4e3bb13b597ee4a84848e70269d5618e0a41835a
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-05-19 13:58:04 +00:00
Orgad Shaneh
61d94c5ccd Git: Fetch completion refs asynchronously
For repositories with many refs the dialog takes a few seconds to open.

Change-Id: I82154ad8a77cc304db941f9d41e36e32aa7043cd
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-05-09 07:40:30 +00:00
Orgad Shaneh
dbdc3ab400 Git: Fix error message on run failure
The working directory appears twice.

Change-Id: I485f53420c58f677b864d7be7078c4871027831f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-05-02 08:53:38 +00:00
hjk
9a4700aae6 Git: some cleanup in gitclient.{h,cpp}
Unneeded declarations, s/static const/const/, #include order, ...

Change-Id: Ie7970f1a0ec1989d79bac56e9bad87852dd036ea
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-04-15 08:35:40 +00:00
Orgad Shaneh
4cf86a4f85 Git: Inline a signal connection
Change-Id: I973ad0dad22df95fccfaa0ed5190bed696233e8c
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-15 10:20:53 +00:00
Orgad Shaneh
ca108a84b9 Git: Show message on fetch success
Change-Id: Ibe9f020d21a0c5eee0ba044b99c62fb181fc173f
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2016-02-11 20:47:24 +00:00
Tobias Hunger
b4195d5174 Git: Modernize
* pragma once
* member initialization
* s/struct/class/
* Introduce a static GitPlugin::client() method and use it

Change-Id: Ifdcac86dd16f3cdba11d564d03e9a15f00a6afdb
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-02-10 15:01:57 +00:00
Orgad Shaneh
b5987a6d49 Git: Require 1.8.0
Remove some workarounds for older versions

Git version in debian stable is 2.1.4, and in Ubuntu 14.04LTS is 1.9.1.

Change-Id: I8d558857a429149222b817401b98e90df10447b6
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-09 13:01:47 +00:00
Orgad Shaneh
d4816850f0 Git: Return QByteArray in synchronousShow
Will be used by Grep

Change-Id: I9346707eef2fe55085b0edf090e117fe45afe8bf
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-08 14:49:06 +00:00
Orgad Shaneh
1b9b1541d3 Git: Un-slot private slots
Change-Id: If88d7e1b501daf6f0dfc696cb20e5f1eb4aa83fe
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-04 11:29:05 +00:00
Eike Ziller
a6f5548331 Git/Clean: Fix issues with submodules
- If the git config contained old entries for submodules that were
  removed (they are not cleaned from the config automatically),
  it would add submodules with empty "dir", which lead to infinite
  recursion

- When recursing into submodules, we need to prepend the paths from the
  git output with the relative path from the main repository

Change-Id: I0bc6a1973f4cdeb1c3f09c05cd7736c25471f72e
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-25 12:20:31 +00:00
Tobias Hunger
397e7f4843 Update License according to agreement with Free Qt Foundation
* Update files in src/plugins

Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:57:01 +00:00
Orgad Shaneh
eb375d734d Git: Do not suggest to continue command when commit editor is active
When executing mergetool from the commit editor it is unlikely that the user
wants to do anything but to commit.

Change-Id: I1302951c4afee554b35a261d60f402b56c077681
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-06 10:06:53 +00:00
Tobias Hunger
dda9380052 Git: Simplify createRepositoryAction usages
Change-Id: I53047333e2591b9e2aca7931a1e809f99baf6f31
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-11-23 13:42:10 +00:00
Eike Ziller
d13b22e6bc Merge remote-tracking branch 'origin/3.6'
Conflicts:
	src/plugins/coreplugin/editormanager/editormanager.cpp

Change-Id: Ibdf433b54e36e58182b7094f78d47ed3e8c81684
2015-11-12 13:43:17 +01:00
Orgad Shaneh
1fd8760789 Git: Do not use file name when retrieving parent commit
Right-clicking a commit on blame shows the parent commit relevant for this file.

In case the file was renamed, fetching the parent can fail (since the file with
this name did not exist before the requested commit).

Using the direct parent is good enough, and should work for all cases.

What the user is really interested in is "how did the file look before this
commit", and the exact "previous" commit is not really interesting.

Change-Id: I7d74efce5f2b065f62e978ba5f14d3010a5f2c7f
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-11-11 13:24:06 +00:00
Orgad Shaneh
bd858d9753 Git: Mute commit description fetching on right-click
Change-Id: I7f7b1b1cdc4e557748b4c9781c96be65f57156e3
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-11-11 13:22:56 +00:00
Orgad Shaneh
d8d7acbe75 Git: Scroll to active file on Show invoked from file log
Change-Id: I0935bf8b8b30ee78716a14ee0a88c21b9caf62dc
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
2015-11-03 08:45:41 +00:00
Orgad Shaneh
9a27b73d44 Git: Show success message on rebase --continue
Change-Id: Id9f3bc7fc04831d47e17948891e34bdba768a170
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2015-10-30 06:57:25 +00:00