This way it's clear how you should get to the commit.
Change-Id: I6131ffab1855d686828137fb608d3edc57846cf5
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Add various trace points to the code, including the plugin
initialization methods (centrally in plugin manager), code that is
scheduled on the event loop with QTimer::singleShot or
QMetaObject::invokeMethod during initialization, and code that is
triggered from ICore::coreOpened
Can be turned on by configuring with `BUILD_LIBRARY_NANOTRACE=ON`
Run with `-trace <file>` to write trace file. If Nanotrace is not built,
the added code expands to nothing.
Changes in Nanotrace:
- turned generated data to microseconds instead of nanoseconds, because
that is what Chrome tracing expects
- fixed serialization of duration (needs to be an item of the event, not
in a "arg" subitem)
- fixed shutdown() to reset the initEvent
Change-Id: I994de82023b820d771e1be0a859ebd8da0b73d4d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Optionally ignore whitespace changes or line
moves to only show the last real code changes.
Feature is disabled by default.
Fixes: QTCREATORBUG-29378
Change-Id: Ia2d5ad926f4098554b1ed3365bffadd4e2063e8e
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
This does not change the current timing of construction a lot as
the GerritPlugin may need it immediately in some cases, in any
case the gitGrep instance will need it.
There's nothing big going on at destruction time, so the prolonged
lifetime until really close to the end does not hurt.
The reason here is that this way we will avoid cases like in change
5e5b90a9a1.
Change-Id: I326d83c1a3d21114322ac6cce8d9e9b782faacdc
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
The GerritPlugin constructor calls GerritParameters::fromSettings()
which then calls calls detectApp() if there is no curl (or no ssh/GIT_SSH).
On Windows this ends up calling GitClient::instance()->gitBinDirectory()
which crashes as the GitClent instance does not exist at this time.
Work around by switching the construction order.
Change-Id: I0b1172d6b7ec96502a51684578b78042a42a95ca
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
When the current line is modified, refresh the
blame after saving. Before, the cursor had to
be moved to another line to restart the blame.
Change-Id: I61012f1c8583545b9bc34a71ff63ade2f9cc5b13
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Drop some Utils:: and rely on some aspects' operator()()
Change-Id: I40d2c2973c1c9eff443bb74b8da44e0824d8d5c6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This avoids some repetition and could be a step towards
having type storage in (or rather accessible from) the base,
so we can have aspects for more complex data (treemodels...)
that are not easily converted to QVariant.
Change-Id: I9797b3d5646195705212db1830d2b415291ac651
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Query the author and encoding information asynchronous
after the current repository is changed.
Set the default codec to UTF-8, which should cover most
configurations (i.e. almost never be different).
In case requesting the information takes longer, the blame
mark is already created with the cached information.
In case the author or encoding changed, the blame mark
has to be recreated.
The call to refreshWorkingDirectory() is moved after the
widget checks in setupInstantBlame() to avoid requesting
these information in VCS editors.
Fixes: QTCREATORBUG-29151
Change-Id: I6feccbbed67c877f1015295f630dd63cf3ccf4a0
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Querying both may be expensive and is only
necessary when the repository is changed.
Fixes: QTCREATORBUG-29151
Change-Id: I1d37f8b8708c02a8c3dc2d89fe7e331f0f416818
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
When lines are folded (e.g. the license header),
the editors lineCount() is smaller than its
blockCount(). That resulted in missing blame marks
for the last document lines. E.g. if 10 lines were
folded, the last 10 lines did not have blame marks.
Change-Id: I502afb09697fd3d6a062d3ae2321357a3e565a0e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Hopefully the last structural change for a while.
Settings lifetime is again tied to the plugin private.
Change-Id: I221e8b8baa69422306191b48a9f034ef5b1a0dc2
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
The indirection is not needed. It's not really stand-alone, and not
touched before GitPlugin::initialize().
Change-Id: If8552dc69ff9efa18a3f1d6d998a8f28ab65e501
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Current Project is misleading. Current Repository refers to the
repository of the current file, which is much more expected for
"everything around" actions (Diff, Log).
Task-number: QTCREATORBUG-10170
Change-Id: I252f40cd3dfd9de184a889355b59f91bb64983dd
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
When git blame returns no output, silently avoid creating
annotations instead flooding soft asserts.
This situation can easily happen when navigating to a
header file that is not under version control.
Fixes: QTCREATORBUG-28768
Change-Id: I8d2f443dec98575221995a9016bd2f8442c682cf
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Therefore, merge the code of codecFor() and encoding()
to avoid further mis-usage.
Change-Id: I086e4ace6c791d16f43f14c423b6529ad199c456
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
The hiding is not persistent, so on the next Qt Creator start all
annotations are visible again. This is meant to quickly get rid of
annotations if there are to many irrelevant of a specific kind.
Change-Id: I4862e56e0f5624f30aadda26efc9dea672ab1f57
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...
While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only
Change was done by running
find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;
Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Take int firstLine as last arg instead. Switch the order of
3rd and 4th args as most callers provide lineNumber
and don't provide revision.
Change-Id: Iab60c1068a4d9829d10219af39bf3dcbf51e37bb
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Simplify createCommand() implementation. All callers
passed either non-null editor (in this case the
bindMode was always NoBind) or passed a null editor and one
of two values for bindMode (in this case the only
effect was to add (or not) a RunFlags::ShowStdOut flag).
Drop CommandOutputBindMode enum completely and pass
directly RunFlags::ShowStdOut when needed (i.e. in cases
we were passing CommandOutputBindMode::ToVcsWindow).
Change-Id: Ic3af05818933a03f615ba02267403b9f0bd326ba
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Before, vcsExec() returned already started VcsCommand.
Later, callers of vcsExec() were establishing connections
to the retured VcsCommand::done() signal. However, when
process fails to start (e.g. because of non-existing
executable), the done() signal may be emitted synchonously
from inside VcsCommand::start(). In this scenario
callers of VcsCommand could miss the emission of done()
signal and connect to already finished command.
Instead, provide a vcsExecWithHandler() function which
takes a handler to be called when command finished.
In addition it takes the context object, too.
Don't return VcsCommand from vcsExec() anymore.
Change-Id: I2fb5fbe5d27632ea039c650d37e5d7d1b60cebc0
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
If the current project is Git managed, but the user opens a header from an
unmanaged directory, don't try to run blame.
Change-Id: I563f7a687b2ea03f4c03bf97c8f5c27c1f8411ec
Reviewed-by: André Hartmann <aha_1980@gmx.de>
A file that is in the repository directory, but not managed by Git should
not attempt to run instant blame on every cursor change.
Change-Id: Ia7daa2ae9980cea4363e010a98fb1e2f2a3ec05f
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Also simplifies the code.
Change-Id: I5da0aeb86ba5a28c9016cde11aab9dcee922d908
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Inspired by the Visual Studio Code plugin GitLens.
Add an annotation to the editor line the cursor
is currently in. A tooltip contains the commit
data and allows to invoke git show for the commit.
When the automatic annotation is turned off, it can
still be forced for the current line with an action.
The default shortcut for this action is: Alt+G,Alt+I
Task-number: QTCREATORBUG-23299
Change-Id: I58eef9efcf531afb11470e5f5456e19f282b18d0
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Replace message box with an error on the output pane.
* Separate logic for accept and close.
Change-Id: Ib9fa201a1a67ee195086f7a22bc6678a9642452a
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
+ fix regression for Git, which allowed to commit invalid commits.
Amends commit 9b61e484be.
Change-Id: I7571863bb982bfae1aa040e08f8c68010b14b147
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Instead of using FileSystemWatcher, emit repositoryChanged when
refreshTopic is called.
This reverts commit 2a8c48cb15.
Fixes: QTCREATORBUG-21089
Change-Id: Iaee8a895f3bc087583cbdea11c6dc2c263694a86
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>