Commit Graph

25 Commits

Author SHA1 Message Date
René Pfeuffer
77b62be68a Fix messages for post commit hooks in git (#1647)
Fixes the transmission of messages from post commit hooks in Git repositories. We therefore use a new method patched in jGit for SCM-Manager. This simplifies the trigger logic a lot.
2021-05-04 16:53:43 +02:00
René Pfeuffer
7a7ac9a3f2 Bugfix: Conflict in pack parser (#1518)
The change tackles a sporadic error in integration tests, where during or after a change in a git repository a pack file could not be read correctly due to a "short compressed stream". The exception could look like this:

ERROR org.eclipse.jgit.internal.storage.file.ObjectDirectory - Exception caught while accessing pack file scm-home/repositories/8gSNr4ogc5X/data/objects/pack/pack-51a3500283ece83ab8efa7edfb9370e6f97311b5.pack, the pack file might be corrupt. Caught 1 consecutive errors while trying to read this pack.
java.io.EOFException: Short compressed stream at 197
	at org.eclipse.jgit.internal.storage.file.PackFile.decompress(PackFile.java:381)
	at org.eclipse.jgit.internal.storage.file.PackFile.load(PackFile.java:815)
	at org.eclipse.jgit.internal.storage.file.PackFile.get(PackFile.java:284)
	at org.eclipse.jgit.internal.storage.file.ObjectDirectory.openPackedObject(ObjectDirectory.java:455)
	at org.eclipse.jgit.internal.storage.file.ObjectDirectory.openPackedFromSelfOrAlternate(ObjectDirectory.java:413)
	at org.eclipse.jgit.internal.storage.file.ObjectDirectory.openObject(ObjectDirectory.java:404)
	at org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:132)
	at org.eclipse.jgit.treewalk.CanonicalTreeParser.reset(CanonicalTreeParser.java:191)
	at org.eclipse.jgit.treewalk.TreeWalk.parserFor(TreeWalk.java:1344)
	at org.eclipse.jgit.treewalk.TreeWalk.addTree(TreeWalk.java:732)
	at sonia.scm.repository.spi.Differ.create(Differ.java:102)
	at sonia.scm.repository.spi.Differ.diff(Differ.java:63)
We found out that this seems to be linked to the asynchronous execution of post commit hooks, that originally are triggered in the midst of the processing of a receive pack.

With this change the fireing of these triggers is delayed until the end of the internal git processing. The central class for this is the GitHookEventFacade, where hook events are either

- put into a ThreadLocal, so that they can be triggered later, or
- triggered in a thread that is joined with an internal JGit thread for internal pushes (eg. for modify command or merge command)
2021-02-03 11:08:13 +01:00
Florian Scholdei
f1b34eb502 Changeover to MIT license (#1066)
* prepare license-maven-plugin for license migration
* added license mapping for tsx files and added some more excludes
* Changeover to MIT license
* Fix build problems
* Delete old remaining licenses
* Add more exclude path for license checker
* Rename included netbeans license, add exclude .m2/repository/
* Specify .m2 exclude because not only repository/, also wrapper/ must match
* Add .cache/ exclude for license check
* Modify formatting of license in java classes to comply with convention and IDE
* Add IntelliJ documentation for license configuration
* Update CHANGELOG.md
* Exclude tmp/workspace/ dir for license check
* Edit README.md

Co-authored-by: Sebastian Sdorra <sebastian.sdorra@cloudogu.com>
2020-03-23 15:35:58 +01:00
René Pfeuffer
e90dc11bc7 Cleanup for http protocol servlet changes 2018-09-11 10:50:53 +02:00
René Pfeuffer
bf9de8ea8e Reduce dependency to RepositoryProvider in provider servlets 2018-09-11 07:40:24 +02:00
René Pfeuffer
4eb75bc621 Initialize servlet and fix paths 2018-09-06 15:33:24 +02:00
René Pfeuffer
c4b34752b4 Fix integration tests by delegating to existing servlets 2018-09-04 20:29:17 +02:00
René Pfeuffer
a0f74e3329 Replace model object exception with generic ones and migrate guice 2018-08-21 07:53:33 +02:00
René Pfeuffer
3838406ee8 Adapt git repository paths for LFS handling to namespaces 2018-08-02 15:14:40 +02:00
Sebastian Sdorra
1effc9c29b remove all items from lfs blob store, if the corresponding repository was removed 2017-06-01 17:28:59 +02:00
Sebastian Sdorra
2a8cfc00d8 use pattern and matcher instead of string matches, to improve performance 2017-06-01 16:27:20 +02:00
Sebastian Sdorra
ee4a19365e fix possible stackoverflow in git request handling 2017-06-01 16:07:18 +02:00
Sebastian Sdorra
880b0499e8 use uri to decide type of request instead of user-agent 2017-05-30 14:10:43 +02:00
Oliver Milke
33ea2273b0 Add git-lfs support 2017-05-19 17:27:18 +02:00
Sebastian Sdorra
d707f0ee47 servlet fields should be final 2015-01-23 21:44:04 +01:00
Sebastian Sdorra
030eadda3f added links commit and source view links to git repository quick view 2013-07-27 18:51:40 +02:00
Sebastian Sdorra
3dbd79207b use template engine and repository service for git repository page 2013-02-27 15:41:31 +01:00
Sebastian Sdorra
c832cb332a fix nullpointerexception in git servlet 2011-12-26 15:23:13 +01:00
Sebastian Sdorra
7d05188b0f fix stackoverflow exception 2011-11-28 13:10:25 +01:00
Sebastian Sdorra
c6b8e108e6 improve logging of git servlet 2011-11-28 11:27:49 +01:00
Sebastian Sdorra
b8dcc55884 call repository request listeners before the git servlet is executed 2011-11-28 11:22:20 +01:00
Sebastian Sdorra
76c5c4ce40 git support for directory structures 2011-10-23 16:49:44 +02:00
Sebastian Sdorra
0811b7590a fix nullpointerexception 2011-07-24 13:14:27 +02:00
Sebastian Sdorra
ed0e7b2cb1 implement git post receive hooks 2011-07-17 18:45:55 +02:00
Sebastian Sdorra
fa1d433a36 move core plugins back to main repository, because of a broken release management 2011-07-01 18:43:26 +02:00