Commit Graph

677 Commits

Author SHA1 Message Date
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
Orgad Shaneh
0780c1d763 Git: Fix compilation with GCC 4.8
Change-Id: I47e2ac73a7afdd5c44c054bab54bc454973a1fa7
Reviewed-by: Robert Loehning <robert.loehning@theqtcompany.com>
2015-09-10 18:49:37 +00:00
Orgad Shaneh
a2bd8e11f6 Git: Fix crash
An asynchronous command deletes itself when it ends.
Raw pointer is a bad idea.

Task-number: QTCREATORBUG-15051
Change-Id: Ie2b3a90e308a4bb1e414f924a836d816abf1dfd1
Reviewed-by: Robert Loehning <robert.loehning@theqtcompany.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-09-10 10:35:15 +00:00
Orgad Shaneh
786aa4a441 Git: Fix source repository resolution in Stashes dialog
Remove workaround done in Branches and store copies where they're needed.

Task-number: QTCREATORBUG-14850
Change-Id: I6a81fc5ac02fb11d444906af6cfbe768695c9965
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-08-12 11:32:20 +00:00
Orgad Shaneh
14419e3d1b Git: Fix typo in comment
Change-Id: I07a7905bed3a46f7fbd60fd0844e9c46d61fbc1f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-08-09 19:09:16 +00:00
Orgad Shaneh
23b89f1e85 Git: Include committer details in Show
Task-number: QTCREATORBUG-12834
Change-Id: I3a38f9bd7e98b9ef982ea51c2ffccbdaf3595a9c
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-07-06 15:20:47 +00:00
Orgad Shaneh
b643f33ee4 Git: Limit size of conflicted files list
Change-Id: I98996eee080ca25b812b53d02a89f45fdcdf3c52
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-07-06 12:40:15 +00:00
Thiago Macieira
d6da30d77a Fix the getting of the Git author name when user.name isn't set
The config variable is not required, as Git will get the user's name
from other system settings, like the gecos field in /etc/passwd. So
adapt Qt Creator to use the same mechanism that Git does.

Change-Id: I255870833a024a36adf6ffff13ecb43cc0c45bbf
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-07-01 16:02:25 +00:00
Orgad Shaneh
995e3d9802 Git: Suppress output for submodule status
It is internal, no reason to expose it.

Change-Id: I7612cfa58cefa22b63635cab66498186b390da8b
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-06-23 15:15:13 +00:00
Tobias Hunger
e0c5ff03ec Vcs: Do not crash when stopping running commands
Drop the connect once the editor gets killed. Remove the QSignalMapper
and replace it with a lambda to facilitate that change.

Task-number: QTCREATORBUG-14613
Change-Id: I1a5990bf37af88092933143ebb78dd5ceb9c1222
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-06-23 09:17:45 +00:00
Orgad Shaneh
2a11548703 Git: Fix Stash & Pop for synchronous actions
After a successful Cherry-Pick or Revert, a ConflictHandler needs be
instantiated in order to call endStashScope.

This was broken in b6608d0d3.

Change-Id: I2e828fa87695b9ac9972fca569e473b5f63abfec
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-06-22 09:20:19 +00:00
Orgad Shaneh
c621768b29 Git: Show original branch name while rebasing
Change-Id: I104afed7d2d5f37d391b7690f81fbad07363907c
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-06-15 08:41:22 +00:00
Orgad Shaneh
a4890d838d Git: Always warn on hard reset when there are modified files
A warning is currently only displayed for reset via context-menu.

Change-Id: If01c6c58dfe8ad0d066f4c6fe02ea3d7bb2c8a55
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-06-11 09:02:52 +00:00
Tobias Hunger
ea476ffc39 ShellCommand: Store workingdirectory in the jobs
Not all jobs of one command can run in the same directory, so
prepare for having individual working directories per job.

Change-Id: Ice43361fe54f2b7153ccd38435f6108d83570082
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-06-10 12:05:31 +00:00
Orgad Shaneh
4aa5116694 Git: Re-disable timeout for interactive rebase
Broken by be3e0438c6.

Change-Id: I2d22a47b764940e9c36847f2c6ea6c8e29cb29de
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-05-27 09:55:05 +00:00
Tobias Hunger
a44c403b5f ShellCommand: Rename some signals
Rename the signals used to report stdout/stderr to make it clearer
what they actually do. Remove some unimplemented private member
functions while at it.

Change-Id: I7e856f906ccb45964f3b1b64336d4d8ebca7b9ee
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-05-07 13:07:14 +00:00
Tobias Hunger
eec0a03212 Vcs: Split up VcsCommand
Move the biggest chunk into Utils::ShellCommand, add some Qt Creator
specific magic in Core::ShellCommand and leave the rest in
VcsBase::VcsCommand.

Change-Id: I5fe6f7076e96023ad2164bcfaacfb3b65a7ff8a8
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-05-04 15:27:25 +00:00
Tobias Hunger
c7c785ace3 Vcs: Push the binary into the Jobs of VcsCommand
This is the first step to generalizing the class for wider use.

Change-Id: I40ccb5bec4fdcb9d0a67388160c867799331007b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-04-29 08:40:46 +00:00
Tobias Hunger
94af581dd8 Git: Make git show a bit more robust
Change-Id: I5d0dc3bb43753f7b2ac9c308944f327537547d76
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-04-23 15:52:00 +00:00
Tobias Hunger
bd1ee39991 Git: Remove duplicate arguments
BaseController already adds -M and -C for us.

Change-Id: Ifb64e78a4eba5f43b6fbe2a701f087ebf38db45a
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-04-23 15:51:46 +00:00
Orgad Shaneh
9e1e11db60 Git: Detect renames and copies on diff
Change-Id: I96e822df7eb5a0fc85108163a7ecf7b5e2a98d58
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
2015-04-20 14:36:47 +00:00
Eike Ziller
50fe3585a8 Merge remote-tracking branch 'origin/3.4'
Conflicts:
	src/libs/timeline/qml/MainView.qml
	src/plugins/git/gitclient.cpp

Change-Id: I0b6ec7b9a592014deb0dd2e1145b19dd6753b1c3
2015-04-15 17:45:47 +02:00