Commit Graph

665 Commits

Author SHA1 Message Date
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
Orgad Shaneh
ec2d13641b Git: Suppress stderr output for fully synchronous executions
Broken by dcdcf54048.

Change-Id: I32f56bb432dfd3ce26397fd41908c6823cd4d7f1
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-04-15 12:48:54 +00:00
Tobias Hunger
5a2b5036ab Git: Get rid of findExistingVCSEditor
VcsBaseClientImpl::createVcsEditor does do the same check.

Change-Id: I89c8d954e8d104261d8ee51a098b97110b4538f4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-04-15 12:24:35 +00:00
Tobias Hunger
ee7a47681b Git: Use vcsExec in favor of plain VcsCommand
Change-Id: I9e422d3ef7749f37323edf1f85d1c65b8c60344a
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-04-15 12:24:29 +00:00
Tobias Hunger
be3e0438c6 Git: Rename asyncCommand to vcsExecAbortable
This name makes it more clear what the method does.

Refactor to use VcsBaseClientImpl::vcsExec.

Change-Id: I4cf742c2b172d2589bd7d6740461e4a4c8d470ed
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-04-15 12:24:24 +00:00
Tobias Hunger
d45dea6cf8 Git: Move executeGit into VcsBaseClientImpl
and rename it to vcsExec. Accept a QVariant to set as cookie on the
command instead of a int for the linenumber.

Change-Id: I8240b53e775ac3883f92bdbf7b111abeeeb39426
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-04-15 12:24:20 +00:00
Orgad Shaneh
5bf6cfb381 Git: Suppress double logging of commands
appendCommand() is already called by runVcs.

Change-Id: I215ac00d0efc36e5f62865d7d2cf9941533a160d
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-04-15 10:31:54 +00:00
Tobias Hunger
d7ecf7df4b Git: Add a static method to attach a GitProgressParser to a VcsCommand
Change-Id: Ia7e104665360a254d5f3867b69e11fb7c46ff93e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-04-15 10:12:46 +00:00
Tobias Hunger
9364f64f2a Git: Use default encoding for git-branch output
I see no reason why that should require source encoding.

Change-Id: Idd7103f09fd66f0363f8e58e04a8abdb183f74ca
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-04-15 10:12:38 +00:00
Tobias Hunger
b6608d0d37 Git: Simplify use of conflict handler a bit
Disentangle binding to an existing command from the actual task of
the conflict handler. This makes usage more clear.

Also rename "command" to "abortCommand" which is also more clear
as to what it is used for.

Change-Id: I862cfec97fbf512a3121f0a7d58ae12f148879a6
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-04-15 10:12:14 +00:00
Orgad Shaneh
d8ad33b54d Git: Fix retrieval of parent commit in blame
Broken by dcdcf54048.

Change-Id: I8e3015f710a8e7dd059b8419e66f58c76373b297
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2015-04-14 20:28:19 +00:00
Tobias Hunger
5954506d19 Vcs: Move vcsSynchronousExec into VcsBaseClientImpl
Use it in favor of git's synchronousGit method.

Change-Id: I1fc8031cb6d258073b64163aeeeaeac84443fb8c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-04-14 11:22:00 +00:00
Tobias Hunger
dcdcf54048 Vcs: Move vcsFullySynchronousExec into VcsBaseClientImpl
Use that in the gitplugin in favor of fullySynchronousGit.

Change-Id: Ifd981f3fc5e87e16ad52caf32c204f81acffe586
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-04-14 11:21:21 +00:00