Skip to content

Update new jgit release (4.8.0.201706111038-r) - #1252

Closed
jvanhercke wants to merge 1 commit into
gitblit-org:masterfrom
jvanhercke:jgit-update
Closed

Update new jgit release (4.8.0.201706111038-r)#1252
jvanhercke wants to merge 1 commit into
gitblit-org:masterfrom
jvanhercke:jgit-update

Conversation

@jvanhercke

Copy link
Copy Markdown

Current release of gitblit is based on version 4.1.1.201511131810-r
which fails to start throwing an UnsupportedCharsetException if a
commit contains an unknown character set encoding (e.g. System).

This new jgit version recovers from the exception.

See changes to class org.eclipse.jgit.util.RawParseUtils,

public static Charset parseEncoding(final byte[] b)

Current release of gitblit is based on version 4.1.1.201511131810-r
which fails to start throwing an UnsupportedCharsetException if a
commit contains an unknown character set encoding (e.g. System).

This new jgit version recovers from the exception.

See changes to class org.eclipse.jgit.util.RawParseUtils,

public static Charset parseEncoding(final byte[] b)
@gitblit

gitblit commented Jul 29, 2017

Copy link
Copy Markdown
Collaborator

The more recent releases of JGit are also the cause of performance regressions in Gerrit due to autogc. I haven't really investigated it myself, that is the scuttlebutt on the JGit mailing list.

As for the charset issue, I did run into that a long while ago. My solution at the time was to hack the fix into JGit using reflection. Perhaps you could determine the offending charset and map it here.

@jvanhercke

Copy link
Copy Markdown
Author

Ok, I understand. I will look into it. Nice hack b.t.w., but unfortunately it does not prevent the system from crashing.

davido added a commit to davido/gitblit that referenced this pull request Jul 8, 2018
@flaix flaix added this to the 1.10.0 milestone Nov 10, 2019
flaix added a commit to flaix/gitblit that referenced this pull request Nov 11, 2022
This branch mostly records the commit from PR gitblit-org#1253, so we have it in
the code base. The changes are immediately undone, because the update
to JGit version 4.8.0, as proposed in PR gitblit-org#1252, renders the whole
patching of JGit obsolete.

The update is done now, against reservations in that PR, because we
guess that potential issues have been found and fixed by now. JGit
is updated to the last version on the major version 4 line: 4.11.9.
Also, since upstream JGit is at v6 by now, more updates will have to
happen later on anyways.

To make the protection against illegal character sets complete, an
additional fix for Bugtraq is included, that protects against exceptions
from bugtraq should it encounter an `encoding` that cannot be handled.
@flaix

flaix commented Nov 14, 2022

Copy link
Copy Markdown
Member

This has been implemented in commit e8a7b2d. I even advanced the JGit version up to the latest 4.x version.
Going beyond that will need some adaptation to the breaking changes in the 5.x version.
Closing this as done.

@flaix flaix closed this Nov 14, 2022
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.

4 participants