Commit Graph

355 Commits

Author SHA1 Message Date
hjk
aa69415ac7 Git: Aspectify settings
Change-Id: I87dfeba360967cc77cc230811bcd9f67b3ea6e38
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-03-19 13:39:33 +00:00
Orgad Shaneh
48c56416f5 Git: Do not prompt to add files in a submodule
Fixes: QTCREATORBUG-23845
Change-Id: Ibf20eed26469b5a8599927e5ac2d458bbff9a156
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-10-04 17:06:23 +00:00
Orgad Shaneh
eb6a2f2b89 Git: Enable Show for file in a specified revision
Fixes: QTCREATORBUG-24689
Change-Id: Ic4ceb1c59f39009c28be7f34ee62f65fd41506c1
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-09-29 07:09:18 +00:00
Eike Ziller
3944162039 Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/cmakeprojectmanager/cmakebuildstep.cpp
	src/plugins/cmakeprojectmanager/cmakebuildstep.h
	tests/auto/debugger/tst_namedemangler.cpp
	tests/auto/qml/codemodel/check/tst_check.cpp

Change-Id: Iefd5f71c03c0078513b76a92af764a4fb22ee4c2
2020-08-10 15:56:54 +02:00
Orgad Shaneh
14e3a379c1 Git: Suggest branch name based on the commit subject
... when the checked out commit is not a remote branch.

Fixes: QTCREATORBUG-24006
Change-Id: I175a3aedba88bd9e3b5cf298c5c161c56e9d0acd
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-08-04 20:23:45 +00:00
Orgad Shaneh
a48cde86f3 Git: Show full description on tooltip in commit chooser dialogs
Like Push to Gerrit, Rebase, Reset, Fixup Commit.

Fixes: QTCREATORBUG-24366
Change-Id: I0f596f84661a1a4f37fe971683cc0d985a6c9b1f
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-08-02 05:00:50 +00:00
Orgad Shaneh
c0c5773345 Git: Add new files with --intent-to-add
Sometimes the file is modified after adding it, either by Qt Creator itself
or by the user.

Running Diff on such a file may look strange. Instead of showing the entire
file, it shows the diff since it was added with its initial content.

Fixes: QTCREATORBUG-23441
Change-Id: I712cc574053f39753250685aec148d2b6d7db192
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-07-19 03:59:45 +00:00
Orgad Shaneh
bfcd1149eb Git: Do not read working directory before it is set
This amends commit c17767c78e.

Change-Id: Ide6f9de2420dd1262b27aed83351b76404cdba30
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: hjk <hjk@qt.io>
2020-06-08 13:18:28 +00:00
Andre Hartmann
f486ff7dab Git: Add git bash to tools menu
Can be useful to perform tasks that don't have
a dedicated UI in Creator.

In my setup, git bash was directly in the git
installation folder %ProgramFiles%\Git and
therefore one level above git.exe itself.

Change-Id: I1ca0d3439690170d7fb840bca17e2c412effe0a4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-05-05 14:23:03 +00:00
Orgad Shaneh
4e66cd0770 Git: Support diff against a selected commit
Change-Id: Ibb4287bf00f1d0c3212630d60e59ab80b600a879
Reviewed-by: hjk <hjk@qt.io>
2020-04-21 10:06:44 +00:00
Orgad Shaneh
9e3bbf36f2 Git: Change some functions in GitClient to const
Change-Id: Iefd3e0345c7a507d1d5c225ea81677e7a93df295
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2020-04-10 14:18:56 +00:00
Andre Hartmann
a59420a9c3 Git: Improve the Checkout > Create Branch > Add dialog
Suggest a local branch name here also.

Fixes: QTCREATORBUG-23797
Change-Id: I16228507858380bc2ff6dc8590279155624d3d28
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-04-04 19:26:52 +00:00
Orgad Shaneh
b52ffa2501 Git: Move addChangeActions from GitEditor to GitClient
Change-Id: Id901994ac2909b00ca58a0a8a91d2d3a273c39b3
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: hjk <hjk@qt.io>
2020-02-26 10:40:21 +00:00
Orgad Shaneh
7c4f0a9b1e Git: Store singleton instance in GitClient
On many cases, GitPlugin is not required at all, and is only used as
a proxy for GitClient.

Change-Id: I246012658ab3e8c7a12f1a459b1b1748ff358e0b
Reviewed-by: hjk <hjk@qt.io>
2020-02-26 10:29:27 +00:00
Orgad Shaneh
c728d04b52 Git: Support reflog also for branches
Change-Id: I9321ba4964d086d90aaf540a2006f95b94de8375
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-02-19 07:23:11 +00:00
Andre Hartmann
b3cf553e1a Git: Ignore unknown push failures
Pushing to Gerrit can fail with due to missing
Change-Id. In that case, none of the existing
warnings should appear.

Change-Id: I4bf55d35a792b680e3ae524e116ce5db9fdd405a
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Miklós Márton <martonmiklosqdev@gmail.com>
2020-02-16 16:18:35 +00:00
hjk
c17767c78e Vcs: Use setters to set up DiffController parameters
Plan is to avoid client use down there, so extract the actually
used data first and pass it down.

Change-Id: I088fc9cc3086e8f6e1e0c3c9d3a35445f752e6f0
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-02-06 07:03:14 +00:00
hjk
b8fe25db25 Vcs: Merge IVersionControl and VcsBasePlugin hierarchies
They were 1:1 in parallel, with quite a bit of function call
ping-pong inbetween, for code-sharing-by-inheritance. Merge
them by making VcsBasePlugin inherit IVersionControl and
merge the derived classes below.

Size of this patch is hard to avoid as all seven systems have to
move simultaneously. Non-necessary potential follow-up cleanup
have been left out on purpose.

Change-Id: Icb71e4182af3db21069cc637e7ae87ffa3829791
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-01-31 12:36:23 +00:00
hjk
866f3aeb4a Vcs: Pass settings handles to settings pages more directly
Change-Id: I5fdec80de5678dd544713fc18335cbd805d7b9f4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-01-24 11:40:49 +00:00
Andre Hartmann
acd1d6c438 Git: Always use commit hash in archive
Storing the archive as "Project-HEAD" or even
"Project-master" is ambiguous.

Better resolve the reference to to have unique
archive identifiers.

Change-Id: I1233c20e5975028d084d6587b4a0f47390d1fd17
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-12-24 08:50:42 +00:00
Andre Hartmann
31e9c93b6b Git: Show upstream status for tracked branches
The Branch View now shows how many commmits
a branch is ahead and behind its tracking
branch.

Example:

  master ↑1 ↓15 [origin/master]

Change-Id: I9564efdfe82154cd98b9856313170aacad036f0c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2019-12-24 08:12:03 +00:00
Miklós Márton
5ef320d9fc Git: Offer creating remote branch if push fails due to the lack of it
If git push fails because the remote branch does not exists a dialog
will be shown which will allow the creation of the remote branch without
leaving the IDE (by executing the git push --set-upstream .. command
suggested by the git itself).

Fixes: QTCREATORBUG-21154
Change-Id: Id785fdc64e27865fba2255eafd2043367a5835ea
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2019-12-19 22:38:20 +00:00
Andre Hartmann
00e04d5022 Git: Allow removing stale remote branches
... from the Branch View context menu on a
specific remote.

Change-Id: Ic7772abe32795a5d11bd4cae989f8d66cc4322e0
Reviewed-by: Miklós Márton <martonmiklosqdev@gmail.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-12-19 07:43:49 +00:00
Andre Hartmann
1766832918 DiffEditor: Stage and unstage selected lines for Git
Fixes: QTCREATORBUG-19071
Change-Id: I560ba208e68e477ea865e499847d819cfdfeb6f3
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2019-11-19 11:19:43 +00:00
Christian Kandeler
b7395e97f3 Git: Speed up the unmanagedFiles() function
Given a list of files, we should not call git for every single one of
them to figure out which ones are part of the repository, because this
job can be done with a single call.
As a test case, I added my whole ~/dev directory with ca 600,000 source
files to a generic project. With this patch, the time spent on
retrieving the list of unmanaged files went down from nine hours to
seven seconds.

Task-number: QTCREATORBUG-20652
Change-Id: Ic04a2b973e14eff549a2642bde7bc269df069fd1
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-11-14 13:18:16 +00:00
Christian Kandeler
df8ef72aec Wizards: Do some input validation on repository URLs
Fixes: QTCREATORBUG-18935
Change-Id: Ie2103cbe2899ea23caaedd4a6350c78b5f380ab9
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2019-07-26 10:41:03 +00:00
Tim Jenssen
1df6443d4a Merge remote-tracking branch 'origin/4.10'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/libs/utils/synchronousprocess.cpp
	src/plugins/baremetal/iarewtoolchain.cpp
	src/plugins/cmakeprojectmanager/cmakeproject.cpp
	tests/unit/unittest/CMakeLists.txt

Change-Id: I124ad492df403286751e175d27fe36487ddf6d07
2019-07-04 15:17:55 +02:00
Andre Hartmann
b950936d45 Git: Correctly handle aborting pull commands
For example, aborting a "git pull --rebase" command
did not work, because the old code tried to run
"git pull --abort" instead of "git rebase --abort".

As side effect, this patch also enables the Skip commit
button in handleMergeConflicts(), that was not shown
before.

Change-Id: Ifa43a4ba0199c97fdf8a361eb9e0207704d93e26
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-07-02 11:04:54 +00:00
Orgad Shaneh
a1ba347fa5 Git: Fix popping of branch-stash after checkout
Checking out a branch that has a saved stash, when
Pop branch stash is checked, is broken since checkout
became asynchronous.

We must wait for checkout to complete before popping
the branch stash.

Change-Id: Ia4d43649e742ced0121ffe106986b4d6ed1e7b38
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2019-07-01 19:57:02 +00:00
Tasuku Suzuki
578cdf7c5a Git: Archive support
This allows users to create archive files from local repository.

Tools > Git > Local Repository > Archive will create <reponame>-
HEAD.tar.gz

Tools > Git > Actions on Commits... you can choose a commit to archive

Change-Id: I09bbbdefe532237e9065d1ca3c21910a036ea149
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Tasuku Suzuki <tasuku.suzuki@qbc.io>
2019-06-10 18:19:57 +00:00
hjk
473a741c9f Utils: Rename FileName to FilePath
More in line with QFileInfo terminonlogy which appears to be
best-of-breed within Qt.

Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 12:23:26 +00:00
Andre Hartmann
e65131ac11 Git: add svn dcommit
It's the counterpart to git push when working with
SVN remotes and git-svn.

Change-Id: I02257ea921fdcdedec294b28e8756ed88fb764b3
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-11-25 14:19:30 +00:00
Orgad Shaneh
92431932e3 Git: Show detached HEAD in branches view when applicable
Fixes: QTCREATORBUG-21311
Change-Id: Ia4297d23a965d83ea2814bd1e41f35a3017b8e9b
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-11-12 09:48:25 +00:00
Alessandro Portale
3b6f45a7a3 Git: Modernize
modernize-use-using
modernize-use-default-member-init
modernize-use-equals-default

Change-Id: Iaccd5611cfc2056d357a0545f8522f02d6f8f0ed
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-11-10 21:03:01 +00:00
Orgad Shaneh
fe87339888 Git: Fix resolving top level for non-existent sub-sub-directory
When a directory is renamed, and it has sub{sub-}*directories, executing
git blame on a file in the subdirectory -> Blame Revision (or parent) for
the file in the previous name -> Show failed because it couldn't determine
the top level directory.

You can test by opening qmakeprojectmanager/wizards/filespage.cpp and
blaming one of the lines that had it as qt4projectmanager/...

Change-Id: I7ac964c12f1f368c5ce92e9bedd972a2bc824935
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-10-25 17:52:28 +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
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
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
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
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
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
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
Laurent Montel
ac6055eeb0 Git: clean forward declaration
Change-Id: Ic8e988d9fa27f9e92fdcfe111220a5c929998afb
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-09-28 07:05:19 +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
dbb2288f1a Merge remote-tracking branch 'origin/4.2'
Conflicts:
	src/shared/qbs

Change-Id: I05c4945d238b7724ca73477fc3b21554564951c0
2017-02-20 15:20:14 +01:00
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
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
Orgad Shaneh
5832f52cee VCS: Replace describe slots with lambdas
Change-Id: I05ca25aad8be43fdfa15d3fb5eaaa9bf753ee79f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-28 09:38:12 +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
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