Commit Graph

1567 Commits

Author SHA1 Message Date
Robert Loehning
cf091e5c3e Git: Initialize members of StashInfo
Change-Id: I20e644d61163bb91addcfe16a58692cfacb988d3
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-02-16 14:59:46 +00:00
Orgad Shaneh
148e793dec Git: Prepend -e to the pattern on grep
This fixes searching for patterns that start with dash.

Change-Id: I824f64151842008a034757de6a00fd8a6cc46d72
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2017-02-07 19:57:58 +00: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
2def95374d Git: Fix crash on Commit + Push to Gerrit
Task-number: QTCREATORBUG-17634
Change-Id: I60d8067fe9cfc23acb688e06506363bca67ec0a5
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-01-30 08:41:04 +00: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
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
Christian Stenger
beb54e31d4 Git: Fix missing include
Change-Id: Id77828b24df73f6e28f1c2ae6fd7533e826a99c2
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-11-09 11:41:57 +00:00
Orgad Shaneh
4ed00a348b Git: Make mergetool parsing more robust
Symbolic link conflict is printed in 2 phases: First "  {remote}", and
then "a symbolic link -> 'foo.cpp'".

This happens because this message involves an additional cat process:

  elif is_symlink "$mode"
  then
      echo "a symbolic link -> '$(cat "$file")'"

For local/remote line, wait for a full line before parsing.

Change-Id: I641cde12aa44dee2f7dff8fdae70da0c443e55d3
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-11-09 08:55:04 +00: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
b98f2a3059 Git: Simplify translations
Change-Id: I6b1af54d6cb5bc5569f5fffdec29f00b37a34436
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-09 08:53:47 +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
3eaddacf74 Git: Disambiguate revision from path on log
If you have a file with the same name as the current branch (in the
repo's root), Push to Gerrit opens with an empty list.

Change-Id: I607c67b1d00da83d4551d3f3f75e5a91478294d5
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-09 08:48:52 +00:00
Przemyslaw Gorszkowski
39d85833b5 GitGrep: fixed substitution of regexp
Task-number: QTCREATORBUG-17193
Change-Id: I7e11a5a55f373dce98a9e203bb3bcb5e929174fc
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-11-03 10:35:59 +00:00
Alessandro Portale
9c830a1619 Git: Use Utils::Icon for IconItemDelegate constructor
Use our icon abstraction instead of file names, because themed icons are
coming.

Change-Id: I0f4e44caf96aeab0c354d2166b111d59b7b29149
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-10-11 13:29:30 +00:00
Orgad Shaneh
7f0b371c11 Git: Fix initially disabled OK button in Push to Gerrit
Change-Id: I7223ef113781eb9adae59dba58036c19a96a11b0
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-10-05 16:04:14 +00:00
Tim Jenssen
d915b22db9 improve static initializers
Change-Id: I304fdd6627f01fc216c84930da607127c52409d9
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-09-23 14:27:01 +00:00
Orgad Shaneh
c01d7a7540 Merge remote-tracking branch 'origin/4.1'
Change-Id: Ieaddc6093d10c08a54acb9b57cbbfe022bc3c038
2016-09-22 11:01:16 +03:00
Orgad Shaneh
ff963bc184 Git: Avoid QProcess::waitForReadyRead in MergeTool
It's unreliable on Windows with Qt 5.7.

Change-Id: I0703ae825e9db80ac8063d9f6962863a68591ed6
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-09-20 13:23:35 +00:00
Orgad Shaneh
c64b3f9882 Git: Do not rely on QProcess::readData/writeData in MergeTool
readData always returns 0 in Qt 5.7 (unless the process is not
running)...

Instead, write to the VCS output pane when reading from/writing to the
process.

Change-Id: Ie832d813d5a859b4ff5841fd2888783833c97945
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-09-20 13:23:30 +00:00
Orgad Shaneh
8d14f76c10 Gerrit: Support pushing initial commit for review
Enable manual selection of target branch on this case.

Task-number: QTCREATORBUG-16780
Change-Id: I925ceef52ec56ebf77abcee58065c7b8afcc0854
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-09-12 14:21:07 +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
5bc8d10baa Remove uses of deprecated QProcess::error signal
This overload of error is deprecated in 5.6.

Replace with errorOccurred, which was introduced in 5.6.

Change-Id: Iccfba7e7103b7ce377471696f1f2ec217e52c840
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2016-08-09 16:02:43 +00:00
Orgad Shaneh
670e54345c Remove use of deprecated Qt algorithms
Change-Id: Ib35cffa2d5762874feea9b1d4df7f569c0e5f496
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-08-09 13:41:25 +00:00
Ulf Hermann
15fbfaf2e9 Move icons to Utils
This way we can use them from libraries, not only from plugins.

Change-Id: Ic35cfd5f04d638d87606bf272b2c00ded1267c1b
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2016-08-05 10:52:53 +00:00
Nazar Gerasymchuk
90629108fc UI files: Fix tab order in lots of UI forms
For unknown reasons tab order in listed UI files was set incorrectly and
behave unexpectedly. Now tab order behave naturally.

Changes made for listed objects and touches only UI.

Change-Id: I057b95eb21943ddb29b108682618382661db7be9
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-08-02 14:29:27 +00:00
Orgad Shaneh
9c72b5bec2 Merge remote-tracking branch 'origin/4.1'
Change-Id: If3b6ebdb2aeb6fabadea1d06a1fe1c9211adcb8e
2016-07-25 07:27:22 +03:00
Orgad Shaneh
a3bdafcbc8 Git: Fix MSVC compilation
Change-Id: Iaf9c168ec2b62abd945a800d3e99a5af9af2b864
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-07-24 06:44:26 +00:00
Orgad Shaneh
1b34f2a4b8 Merge remote-tracking branch 'origin/4.1'
Change-Id: Ia90424d479936a898705c433e5810c77ae088b2c
2016-07-22 15:18:00 +03:00
Orgad Shaneh
53cbc9d30c Git: Save silently on undo actions
If the user wants to undo, first save the file silently. Then the user is
still able to cancel the undo operation.

Task-number: QTCREATORBUG-16647
Change-Id: I61ac42ff41f3f7758d662692bc92850766beab8e
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-07-22 10:30:10 +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
Nikita Baryshnikov
66142d94d2 Git BranchAddDialog: small fixes
Change-Id: I99910fdb3a646ad818ad58103beb5f63de57ec18
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-07-20 19:48:25 +00:00
Nikita Baryshnikov
9750a82445 Git BranchAddDialog: fix branch renaming
replace invalid characters with '_'. To allow pasting of text with
invalid chars inside

Change-Id: Ibc0d3dde2252235a931b51ad73ae2eef527be547
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2016-07-20 19:48:11 +00:00
Orgad Shaneh
b55e06716b Git: Suppress stderr output (for the output pane) on clone
It already appears in the wizard. No need to duplicate.

Change-Id: I74b1f7d9d5be44e95965bf2af3fee9727372995a
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-07-20 09:22:24 +00:00
Thiago Macieira
cdf1c924a3 Git: make git grep not duplicate leading path names
Make sure we pass --no-full-name to counter the grep.fullname=true
option that the user may have set. Otherwise, Creator will complain that
it can't find the files that matched the search terms if the search
directory was not the root of the Git repository.

Change-Id: I149e0540c00745fe8119fffd14628a3d7887e55e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-07-19 05:23:08 +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
Orgad Shaneh
c125fbbe97 Git: Refix filtering of obsolete branches when adding a branch
It was fixed in 62c60c6d1c but broke again
by 04eb012267.

Task-number: QTCREATORBUG-16264
Change-Id: I1130d5c2eda3320714913570441499be0d55c8fe
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2016-07-17 18:12:21 +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
573958e79f Git: Prompt for unchanged file after custom mergetool fails
To reproduce, create a conflict and configure a custom mergetool that does
nothing:

git config mergetool.my.cmd true
git config merge.tool my

Then execute merge tool from Qt Creator. The merge tool process hangs
while asking how to handle the unchanged file, and can only be killed
externally.

Change-Id: I4d2a91061bd7549e308f6a25f106e6a7afc5cadb
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2016-06-24 03:00:43 +00:00
Orgad Shaneh
53c4b36e4a Git: Resize columns in branches dialog when data is changed
When setting a tracking branch, creating or deleting a branch.

Change-Id: I58dd06912fbf23900674a8714224ee414f1da4b7
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-06-23 13:05:27 +00:00
Orgad Shaneh
3d63136836 Git: Show date and time for newly created branches
Task-number: QTCREATORBUG-16484
Change-Id: I18b262d2d03f6a793123cc655f415a1d46d1a4e3
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-06-23 13:05:23 +00:00
Orgad Shaneh
7a5b45bdc2 Git: Limit blame range only for multiple lines selection
Selecting a word should not result in a single line blame...

Change-Id: I03e8b75c519eb555b77985e7c68b3429bfff9446
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-06-17 14:37:17 +00:00
Orgad Shaneh
3f879c0c79 Git: Use correct line numbers in limited range blame
Change-Id: I12f6fc77b532e5b01f2da6c1c1ff847445447c70
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-06-14 07:57:03 +00:00