115 Commits

Author SHA1 Message Date
Seth Hillbrand
d8903534b7 Remove TreeControl call from thread
On Windows, this may use SendMessageW, forcing a wait for UI in the
thread

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20572

(cherry picked from commit 3d29fae7a92be91bddda92f776bc59a1a5014526)
2025-04-07 17:06:22 -07:00
Seth Hillbrand
579c08155f Update tree based on elements not map
Rather than updating the tree with all elements in the map (some of
which may have changed), we iterate over the tree and set those elements
that we find in the map.  This ensures that all elements updated in the
tree exist there
2025-03-26 13:10:10 -07:00
Seth Hillbrand
151d745922 Enable/disable git tracking in user prefs
Don't require advanced config for people who want to disable

(cherry picked from commit f83e607e6e5a83cb487ab51155d2d38445b50bb5)
2025-03-24 11:58:57 -07:00
Seth Hillbrand
bf0bd05c75 Fix some regressions in git handling
Set default to rebase for pull
Update error string on auth failure
Improve trace logging

(cherry picked from commit b8225ba2d62e01dd94837d6ddd9570486e7d93b5)
2025-03-23 10:53:44 -07:00
Seth Hillbrand
e1436d3597 Fix inheritance for git_common
Avoids repo type pointer issues when casting from void

(cherry picked from commit 676dd4ceec4dc3d3e0c921c93147561f03915683)
2025-03-16 18:04:47 -07:00
Seth Hillbrand
6104651613 Adjust git handling
- Utilize scoped deletion for individual git_*_free() calls
- Protect against multiple usage when updating icons
- Reduce frequency of git update calls

(cherry picked from commit 26c331a83704bcc1f221e67fe6757a07dc9e920b)
2025-03-16 18:03:16 -07:00
Graham Keeth
38dcfdc350 capitalize Git in display strings
(cherry picked from commit 68869f6439b6e600db18cf13d0a464f9567e541e)
2025-03-14 16:54:45 -07:00
Seth Hillbrand
3f984704be Prevent fetch without repo
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20152

(cherry picked from commit 18ac99d838136735b69e12ad21b1f1333a4eafe3)
2025-02-28 08:35:58 -08:00
Seth Hillbrand
c7afa8ce87 Fix windows build
(cherry picked from commit 9211136953289f09c0caf98fb59780d473036ae8)
2025-02-26 18:15:44 -08:00
Seth Hillbrand
cc2ca441fa Adjust git timing parameters
Move most of the update firing to the file system watcher (except for
windows network shares that still need timed updated).  Gate the repo
status for sync

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20133

(cherry picked from commit 5027a562e4d2845fa0b0c3d7d78b3925a406965a)
2025-02-26 16:17:49 -08:00
Seth Hillbrand
8d1f1fd4f5 Fix git flicker on Windows
(cherry picked from commit aa1baec06230ba066c3a548dd6dcdb6c25ac6c5c)
2025-02-26 16:17:43 -08:00
Seth Hillbrand
038b927cfa Thread git checks
Push the git checks from the main thread into child threads to prevent
resource contention in some cases where Windows machines might have many
files in git that are _also_ being managed by Google Drive

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20078

(cherry picked from commit 2c54ab277b0081f2fa41ac2925c5d37106c8f611)
2025-02-25 16:09:56 -08:00
Seth Hillbrand
f6c507bff9 Fix git issue with file separators
In some cases, GetPath will not return the trailing `/` leading to
inability to commit any files in git
2025-02-18 10:00:54 -08:00
Seth Hillbrand
ba208fd5c9 Suppress git remove if not at head
Don't offer to remove the .git directory if we are not looking at the
base of the git repository for safety

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19889
2025-02-12 14:43:08 -08:00
Seth Hillbrand
088a90cf68 Prevent committing bad files
Avoid backup, lock, autosave files
Avoid files that are not visible to KiCad (outside of the project
directory/sub-directories)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19891
2025-02-12 13:44:08 -08:00
Jon Evans
8af6defafe Git: allow making the first commit in a branch 2025-02-08 17:30:55 -05:00
Jon Evans
c6b9ab174d Git: suppress error message when loading brand new repo 2025-02-08 17:09:48 -05:00
Jon Evans
f59c5a9a26 Git: handle new-but-already-staged files
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19893
2025-02-08 17:03:42 -05:00
Jon Evans
172b77039f Git: fix error message formatting 2025-02-08 16:49:56 -05:00
Jon Evans
df70ce72b4 Git: do not try to get branch info if there isn't a repo 2025-02-08 16:34:08 -05:00
Ian McInerney
4cf8274b2b Silence errors from file watchers when adding files
The file watcher can throw errors on Linux that are very cryptic and
actually not very useful to users, so let's hide them since there isn't
really any problem that comes from this.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15717
2025-01-29 19:34:00 +00:00
Seth Hillbrand
3f90cfb0ca Fix up git warning 2025-01-28 12:22:39 -08:00
Seth Hillbrand
f34f962455 Fix switch branch for rapid change
Was missing a handler for the rapid switch IDs
2025-01-28 12:22:39 -08:00
Seth Hillbrand
1641878af7 Don't create a repository before the dialog
The user might cancel a dialog, leaving a broken repo.  We use a temp
repo to test the connection

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16263
2025-01-28 12:22:39 -08:00
Seth Hillbrand
5a57e5cfd4 Handle SSH keys better
OpenSSH will iterate through a series of keys.  Additionally, there may
be a key specified in the ssh/config file that we need to account for.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18864
2025-01-21 15:59:07 -08:00
Seth Hillbrand
427d7d2dad Move git password management to local password control
Don't keep passwords in plain text config files that may be checked into
version control.  Passwords stored in system-specific password managers

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18053
2025-01-20 17:33:55 -08:00
Jeff Young
af38f76f01 Don't double-create new folders in project tree. 2025-01-16 16:47:58 +00:00
Seth Hillbrand
0b2d4d4879 Revise Copyright statement to align with TLF
Recommendation is to avoid using the year nomenclature as this
information is already encoded in the git repo.  Avoids needing to
repeatly update.

Also updates AUTHORS.txt from current repo with contributor names
2025-01-01 14:12:04 -08:00
Marek Roszko
0396719308 PDF also isn't really text editable 2024-12-20 23:52:19 -05:00
Marek Roszko
8854ba6fcf Remove the edit file option for zip archives in the project tree 2024-12-20 23:46:02 -05:00
John Beard
9f579f787b Libgit2: the const git_commit* saga continues
The change wasn't re-reverted in 1.8.3, it was just not
included. It was than _also_ reverted in 1.8.4, as it was for
1.8.2 (those two tags are on different branches - main and maint/v1.8).

Hopefully, this means that we're done here, and v1.8.5 will also be
const-y, whether it is based on main or maint/v1.8.

The current state of play:

* 1.7.0 and older: const
* 1.8.0, 1.8.1:    no const
* 1.8.2:           const
* 1.8.3:           no const
* 1.8.4:           const
Future:
* 1.8.5/1.9.0:     presumably/hopefully, const

This is currently breaking at least Arch and Fedora Rawhide

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/19062
2024-11-05 20:56:16 +08:00
JamesJCode
75c2f17b42 Fix libgit integration for version >= 1.8.3
The API continues to change...
2024-10-28 20:25:32 +00:00
Jon Evans
a802ba1199 Make Git push/pull errors visible 2024-10-19 12:34:06 -04:00
Alex Shvartzkop
4c196e1486 Improve libgit2 check formatting. 2024-10-07 17:22:28 +03:00
Alex Shvartzkop
74e15a3fc2 Support libgit 1.8.2+
In v1.8.2-rc1, the type change introduced in v1.8.0 was reverted.

See 49d3fadfca
2024-10-07 17:11:41 +03:00
Marek Roszko
d74caace0a Initial jobset creation and running within the CLI and GUI.
Incomplete, just pushing this before feature freeze, much fixing left
2024-09-30 20:04:53 -04:00
Mark Roszko
d783e0d4c0 unbind/disconnect in PROJECT_TREE_PANE destructor 2024-08-16 01:44:45 +00:00
Alex Shvartzkop
10b8580657 Reduce freezing every 2 seconds due to git status updates.
With pathspec specified, only the project dir is queried now.

Still bad if you're in the root of a big repository.
2024-06-30 19:44:31 +03:00
Wayne Stambaugh
795a9eea60 Coding policy fixes.
This is primarily to change all instances of wxLogDebug with wxLogTrace
so developers do not have to sift through debugging output that is always
dumped.  The only exception is for code blocks built in debug builds and
called on demand for dumping object states.
2024-05-23 07:59:45 -04:00
Seth Hillbrand
7aa3892ba3 Move log into UNIX ifdef 2024-05-09 19:29:01 -07:00
Seth Hillbrand
42ebf0eca5 Limit FSWatcher
Library watches only need a single directory or immediate children.  The
project watcher should have a sensible limit to the total number of
files it tries to track.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15717
2024-05-09 15:42:25 -07:00
jean-pierre charras
59e34dcbec Fix a compil issue on Windows (missing closing brace) 2024-05-07 12:48:41 +02:00
Seth Hillbrand
b9b19cb5fb Quiet the warnings when overloaded on file watches 2024-05-06 17:36:50 -07:00
Seth Hillbrand
8a306eecb6 Cleanup libgit init calls 2024-05-06 10:18:38 -07:00
aris-kimi
66bb49e2da Silence some GCC warnings 2024-04-16 11:11:50 +00:00
Marek Roszko
0ce227fa92 Can't use forward declare with std::vector
Not allowed per C++ standard

See https://github.com/llvm/llvm-project/issues/57700
2024-04-13 08:22:20 -04:00
Huang Rui
1cbf6a1872 libgit2-1.8.0 compatibility: adjusted parent pointer type
- Adjusted parent pointer type in git_commit_create call for compatibility
  with libgit2 1.8.0 and above.
- Included preprocessor checks to maintain support for versions older than
  1.8.0.
- Ensures consistent function behavior across different libgit2 versions.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17536
Signed-off-by: Huang Rui <vowstar@gmail.com>
2024-04-07 15:43:52 +00:00
Ian McInerney
9456f35491 Properly cleanup git repos and memory on project/frame deletion
* Ensure the git backend is deleted when the project tree is deleted.
* Unload the git repo for a project when the project is unloaded from
  the tree.
2024-04-01 21:59:50 +01:00
Jan Wichmann
5cdf9fe8a0 Don't show hidden directories and files in the project tree browser
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16207
2024-03-03 16:43:43 +00:00
aris-kimi
24529e5242 ADDED: library tree context menu option to open sym/fp library files from the defined text editor.
Short description:

Works for Symbol and Footprint Editor behind an advanced config option.
For Symbol Editor it is shown for a single item selection (library or symbol).
For Footprint Editor it is shown for a footprint selection.
(fp editor allows a single tree item selection only).
Option stays hidden if current frame has been modified.

Also small fix(?) for similar action to the project manager.
(Call for the Execution has moved inside the file loop.)

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/15736
2024-02-29 19:01:59 +00:00