Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Git CLI connector with JGit #432

Merged
merged 36 commits into from
Jul 15, 2024
Merged

Replace Git CLI connector with JGit #432

merged 36 commits into from
Jul 15, 2024

Conversation

dabico
Copy link
Member

@dabico dabico commented Jul 9, 2024

Should provide more stability, while also removing external dependency on the git executable.

dabico added 30 commits July 3, 2024 13:46
Will only be created if the necessary username and password properties
are specified.
Constructs a partially complete `ls-remote` command. The bean definition
only sets the used credentials and default timeout duration, if and only
if they are specified. It is up to the dependents to further set the
remote URL, or override the previously set defaults.
Constructs a partially complete `clone` command, similarly to the
`ls-remote` command. Does not set the URL, depth or filesystem location.
This new bean implementation is completely decoupled from the
`GitConnector`, which I plan to remove in the future anyway. As for the
actual implementation, it has been changed so that the logic no longer
relies on `ExternalProcess`.
Still not 100% ready, should have more robust exception handling to
detect exact failures. `TransportException` is too broad, and may even
encapsulate cases where the check should be undefined as opposed to a
failure. Then again, this should not be too big of an issue, since we
check with HTTP in the event of Git failures.
This will probably only be used to override configuration properties at
runtime.
The goal of this class is to allow a custom configuration for JGit that
does not depend on the system or user settings. At the same time, this
class acts as a decorator, calling all other underlying methods of the
delegate.
Support was added through the `ghs.git.config` application property.
The properties are specified within a `Map`, and a `InitializingBean`
is put in charge of translating these `application.properties` entries
into corresponding Git configurations. The documentation has also been
updated to reflect these changes.
No longer needed since we do things programmatically.
Corresponding README.md section has also been removed.
Was used in the now-deleted `GitConnector`, no longer needed as Git
exceptions are now all mapped by JGit.
@dabico dabico merged commit 74e585c into master Jul 15, 2024
5 checks passed
@dabico dabico deleted the enhancement/git branch July 15, 2024 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant