Commit Graph

1035 Commits

Author SHA1 Message Date
Viktor Egorov
c8ef99cf07 Add option to hide whitepace changes in diffs
Co-authored-by: Florian Scholdei<florian.scholdei@cloudogu.com>
Co-authored-by: René Pfeuffer<rene.pfeuffer@cloudogu.com>


Reviewed-by: Florian Scholdei <florian.scholdei@cloudogu.com>
2024-05-14 11:33:48 +02:00
Laura Gorzitze
8d12862ff8 Display all tags for changeset
Display of all tags (as links to the  overview of the specific tag) of a given changeset in the changeset detail view.
2024-03-11 17:09:59 +01:00
Rene Pfeuffer
658ccdf006 Improve import of LFS files for pull and mirror
Pushed-by: Rene Pfeuffer<rene.pfeuffer@cloudogu.com>
Co-authored-by: René Pfeuffer<rene.pfeuffer@cloudogu.com>
Committed-by: René Pfeuffer<rene.pfeuffer@cloudogu.com>
2024-03-11 11:13:42 +01:00
Laura Gorzitze
d8e1f2d739 Cleanup Code
Pushed-by: Rene Pfeuffer<rene.pfeuffer@cloudogu.com>
Co-authored-by: René Pfeuffer<rene.pfeuffer@cloudogu.com>
2024-02-06 14:54:00 +01:00
Eduard Heimbuch
cf4d9cf20f 3.x
Committed-by: Eduard Heimbuch<eduard.heimbuch@cloudogu.com>
Pushed-by: Rene Pfeuffer<rene.pfeuffer@cloudogu.com>
Co-authored-by: René Pfeuffer<rene.pfeuffer@cloudogu.com>
Pushed-by: Eduard Heimbuch<eduard.heimbuch@cloudogu.com>
Committed-by: René Pfeuffer<rene.pfeuffer@cloudogu.com>
2023-11-30 17:02:44 +01:00
Rene Pfeuffer
571e6ad92f Add a modifications provider for hooks
This new modifications provider consistently computes the modifications caused by a push to a branch. In contrast to the changeset provider that often has been used before to check what has changed, this also works for forced updates, rebased branches and fast-forwards.&#10;&#10;Because these types of changes are normally only used with git, this provider (for now) has only been implemented for git.

Pushed-by: Rene Pfeuffer<rene.pfeuffer@cloudogu.com>
Pushed-by: Alexander Dammeier<alexander.dammeier@cloudogu.com>
Co-authored-by: René Pfeuffer<rene.pfeuffer@cloudogu.com>
Committed-by: René Pfeuffer<rene.pfeuffer@cloudogu.com>
2023-11-16 13:18:40 +01:00
Florian Scholdei
a8c32b10de Preferred checkout variant
Add ability to prioritize the repository checkout variants. These are displayed sorted.

Co-authored-by: Eduard Heimbuch<eduard.heimbuch@cloudogu.com>
Pushed-by: Florian Scholdei<florian.scholdei@cloudogu.com>
Co-authored-by: Florian Scholdei<florian.scholdei@cloudogu.com>
Pushed-by: Eduard Heimbuch<eduard.heimbuch@cloudogu.com>
2023-11-15 13:27:48 +01:00
Laura Gorzitze
f641c1ef08 Assisted Injection for commands
Co-authored-by: Eduard Heimbuch<eduard.heimbuch@cloudogu.com>
Co-authored-by: Laura Gorzitze<laura.gorzitze@cloudogu.com>
Pushed-by: Eduard Heimbuch<eduard.heimbuch@cloudogu.com>
Pushed-by: Laura Gorzitze<laura.gorzitze@cloudogu.com>
2023-11-02 12:41:54 +01:00
Eduard Heimbuch
69c165749a Show correct image diff if compare across multiple commits
Pass the ancestor commit as the old revision if it is set in the GitDiffResult. This fixes the image diff renderer if the pull requests consists of multiple commits to show the full diff instead of the changes between the latest two commits.
2023-11-01 14:05:54 +01:00
Thomas Zerr
b2472d85d0 Added force to push command for git and hg repos
Committed-by: Rene Pfeuffer <rene.pfeuffer@cloudogu.com>
2023-09-14 20:28:37 +02:00
Rene Pfeuffer
8352cf349c Do not try to init non-git repos for git
The initialization to set the default branch in
git repositories should not be executed for
non-git repositories. Otherwise, this throws
exceptions in SVN repositories all the time
because the branch command is not supported.

Committed-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
2023-09-08 13:22:57 +02:00
tzerr
d835c6f0ca Merge tag '2.44.3'
Release version 2.44.3
2023-09-01 10:44:33 +02:00
Rene Pfeuffer
545a2061ae Fix check for lfs files
This fixes the check for LFS files used in git imports
and mirror command.

First this checks for LFS files recursively in the tree
(in other words, before LFS files were found only in
the root directory).

Second, this fixes a bug in the used JGit lfs filter by
checking, whether the checked tree entry is a normal
file. This prevents missing object exceptions during
the check when the repository contains a submodule.

Committed-by: Thomas Zerr <thomas.zerr@cloudogu.com>
Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2023-08-31 15:45:13 +02:00
Eduard Heimbuch
7a352295ab Set git default branch on first push to not-initialized repository
Committed-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
2023-08-15 12:06:11 +02:00
Eduard Heimbuch
0e7a3ec53b Improve general performance
- Adjust logging
- Optimize cache speed
- Cleanup classes

Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>

Reviewed-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
2023-06-28 14:18:18 +02:00
Eduard Heimbuch
e4d846b0d4 Improve repo exception logging 2023-06-15 12:43:06 +02:00
Rene Pfeuffer
92390ce0d2 Fix default branch in git mirror command
The git mirror command did not set the default branch correctly in all cases. If the source repository contained a 'master' branch, no default branch was set. This led to an error in the refresh process, when globally another branch has been configured as dafault (when not changed, this is 'main'), because the working copy should be created with the main branch checked out. Because no default was specified, the globally configured default (by default 'main') had been taken and that branch does not exist in the mirror.

So all subsequent mirror updates failed with a message like this one:

could not find branch with id main in repository with id ...

With this fix, the default branch is always set in the SCM-Manager configuration for the repository and therefore cannot be missing in subsequent updates.

Committed-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2023-05-12 13:12:40 +02:00
Eduard Heimbuch
c6df84557b Refactor general configuration
Use standard configuration store api for general configuration. This is best practice and also required for the audit log to work properly.

Besides that we still need to load the general configuration manually for the instance injection binding in ScmServletModules. Since the instance injection does not resolve the bindings regularly we need also still need to update the injectable scm config using the "load" hack in the resource.

Committed-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
2023-04-12 12:37:52 +02:00
Konstantin Schaper
7e83d34fc0 Improve committer accuracy
Changes made by the SCM-Manager, like those through the editor and pull requests, now more accurately define the committer on the underlying changeset.

Committed-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
2023-04-06 10:16:41 +02:00
Rene Pfeuffer
8eb2687e10 Fix branch and tag name validation
The validation for branch and tag names has been
too limited. This led to errors in the frontend for
branches, that had been created using the
cli tools for git or hg but have not been seen as
valid by SCM-Manager.

To fix this, the patterns to validate branch and
tag names are relaxed and relate to the git
rules (https://git-scm.com/docs/git-check-ref-format).
Because these rules could not be expressed
using regular expressions alone, in addition
possible exceptions will be handled in the
git branch and tag commands.

Committed-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
Co-authored-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
2023-04-05 11:45:15 +02:00
Konstantin Schaper
d257c8616c Display images in diffs
Committed-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2023-03-22 11:17:22 +01:00
Rene Pfeuffer
68110ee6b3 Retry failing integration tests
This uses 'RetryingTest' from junit jupiter to retry integration tests that are known to fail from time to time. We explicitly mark single tests in contrast to set a global retry to be able to trace those, whenever this is intended.

To do so, we have to update to the latest version of JUnit. Unfortunately, this brought a new behaviour for the @TempDir annotation: In contrast to the former behaviour where for one test all annotated parameters got the same directory, in the new version the parameters get different directories assigned. This led to the need of some consolidation between @BeforeEach methods and the related tests.

Committed-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2023-03-22 06:24:33 +01:00
Eduard Heimbuch
56265be9a2 Add initial audit log API
Introduce audit log API which logs all creations,
modifications and deletions of annotated entities
and everything which is stored inside a
ConfigurationStore. Without the related Audit
Log Plugin installed this API does nothing.
2023-03-09 11:25:33 +01:00
Rene Pfeuffer
cb8c951cb8 Set the HEAD in Git pull command
Committed-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2023-02-23 12:38:26 +01:00
Eduard Heimbuch
f28eaeca15 Fix repository resolution for ssh urls with context path
Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2023-02-23 10:57:43 +01:00
Rene Pfeuffer
0361ae3c6c Sets the default branch for a new git repository from an import to the HEAD reference of the imported repository.
Committed-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
2023-02-23 10:10:33 +01:00
René Pfeuffer
29a26791eb Merge tag '2.41.1'
Release version 2.41.1
2023-02-16 18:50:31 +01:00
Rene Pfeuffer
90dcb713b3 Remove unconditional force push
This removes the unconditional force mode used while pushing changes made by the modify or the merge command in git repositories. The force mode led to the "deletion" of other changes on the same branch made between the creation of the working copy and the push to the core repository inside SCM-Manager.

Committed-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
2023-02-16 16:12:55 +01:00
Eduard Heimbuch
dc60c924ed Add copy button to codeblocks 2023-01-25 15:55:00 +01:00
Eduard Heimbuch
ac419daa3f Add ConfigurationAdapterBase and extension points for trash bin
Adds the new abstract class ConfigurationAdapterBase to simplify the creation of global configuration views. In addition there is some cleanup, interfaces and extension points for the repository trash bin plugin.

Committed-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
Co-authored-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
2023-01-13 13:08:51 +01:00
Rene Pfeuffer
f2f2f29791 Render images from repository correctly
This adds a markdown renderer for images, so that images
that are referenced by their repository path are resolved
correctly. In this case, the content rest endpoint is
rendered as source url. For this, two new contexts
(RepositoryContext and RepositoryRevisionContext)
have been added, that make the repository and the
current revision available, so that the content url can
be resolved properly. These new contexts may be used
by plugins like the scm-readme-plugin.

Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>

Reviewed-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
2022-12-19 10:12:01 +01:00
René Pfeuffer
54081ccdc6 Git import with lfs support (#2133)
This adds the possibility to load files managed by lfs to the repository import of git repositories.

Co-authored-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
2022-10-25 09:14:40 +02:00
Konstantin Schaper
96ce4cb8e6 Git diff request correctly throws NotFoundException if target revision is non-existent (#2141)
Sometimes it happens that a git diff command request is performed with a non-existent target branch. This is usually fine but the underlying system might have already garbage-collected the revisions associated with that branch. In this case, the revision for that deleted branch might turn up null which currently causes a 500 error. We catch this specific corner-case and throw the correct NotFoundException instead.
2022-10-24 19:49:28 +02:00
Eduard Heimbuch
976f71b33c Add logging for git browse command (#2140)
Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2022-10-20 11:38:32 +02:00
René Pfeuffer
17cfbf2821 Upgrade jgit to 6.2.0.202206071550-r-scm1 (#2131)
Co-authored-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
2022-10-12 13:20:20 +02:00
René Pfeuffer
168d708906 Fix handling of old commits as new ones in new branches
If a new branch is pushed in Git without new commits (the branch
is created on a commit that already exists in the SCM-Manager repository
and pushed without any further commit), all ancestors of the commit
the branch points to have been treated as if they were new by the
hook changeset provider. This led to severe errors like wrong
push logs (by the pushlog plugin) or re-evaluated commit messages
by the commit message checker plugin.

This fixes this wrong behaviour. If new commits are not provided by
the pack parser, no commit will be treated as a new one.
2022-10-12 09:31:55 +02:00
René Pfeuffer
e0a56a1369 Implement commit search features for git (#2111)
Implements the required features for the commit search plugin for git.
2022-09-01 15:31:33 +02:00
Eduard Heimbuch
67c083ee54 Reduce code smells (#2089)
Reduce code smells found by deepsource.io. We focused on the low-hanging fruits and not breaking any api.
2022-07-15 15:33:37 +02:00
René Pfeuffer
b0b2375f78 Mirror LFS files for git (#2075)
If a mirrored git repository uses LFS, SCM-Manager will now also load the binaries, so that the mirrored repository can be used without missing LFS files.
2022-06-24 11:55:36 +02:00
Eduard Heimbuch
8b5347b251 Prevent corrupt lfs files during transfer (#2068)
Validate lfs file checksum to ensure that the file was transferred successfully. If an error occurs, the blob will be deleted to prevent corrupt files inside the storage.
2022-06-21 16:31:34 +02:00
René Pfeuffer
c5b4dcb19e Fix character encoding in diffs (#2046)
Fixes encodings in diff results. The is especially necessary for Windows systems.

Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
2022-06-01 09:32:12 +02:00
Eduard Heimbuch
bd68c301ea Add missing css class to ensure correct margin 2022-05-24 13:47:58 +02:00
Eduard Heimbuch
8f0facf394 Order repo info extensions (#2041)
Set order priority for repository information extensions.
Also add new annotation to set custom resource bundles for cli commands.
2022-05-23 15:06:08 +02:00
Matthias Thieroff
fae952ff09 Fix open file handle prevent deleting a repository on Windows (#2008)
Fixes the problem of unclosed file handles which occur when a repository or pack file is accessed (e.g. asynchronously in a post receive hook) after the file had already been closed. Such open file handle prevents deleting a repositories on Windows.
2022-04-21 07:45:44 +02:00
René Pfeuffer
edd972b1a8 Fix handling of illegal lfs pointers (#1994)
When using lfs, it could happen that there are files
committed before the `.gitattributes` file was updated.
In these cases, it could occure that we find files, that
are no lfs pointers, although they are marked as lfs files
in the attributes. In these cases we just want to handle
such files just as normal blobs and ignore the fact and
do not fail.
Before, a null pointer exception was thrown, because the
LfsPointer class from jgit returned null, which did raise
the exception in the Optional#of method.
2022-04-08 14:34:22 +02:00
Konstantin Schaper
4d203ff36f codify extension points docs (#1947)
This pull request converts the current incomplete textual documentation of the available frontend extension points to in-code definitions that act both as documentation and as type helpers for improving overall code quality. All extension points available in the SCM-Manager core are now available, but no plugin was updated and only those parts of the core codebase had the new types added that did not require runtime changes. The only exception to this is the breadcrumbs, which was a simple change that is fully backwards-compatible.
2022-03-29 15:04:14 +02:00
Eduard Heimbuch
b7f44315b2 Not unique revisions on compare (#1974)
* Throw more specific exception if compared revisions are ambiguous.
* Add changelog entry
* Move changelog entry in intended folder
* Small typo

Co-authored-by: Florian Scholdei <florian.scholdei@cloudogu.com>
2022-03-14 10:34:17 +01:00
Matthias Thieroff
44f0046f25 Collapse folders with only one child folder (#1951)
Collapses a folder in code view which only has another folder as its only child. This lets you access a sub-folder which has content directly instead of navigating down the folder tree by clicking every folder separately.

Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2022-02-15 10:59:32 +01:00
Eduard Heimbuch
49844d1595 Compare branches, tags and revisions (#1920)
Add branch/tag/revision compare to see diffs and changesets between the source and target revisions. This feature is reachable from the branch/tag detail page and also the source code view.

Co-authored-by: Florian Scholdei <florian.scholdei@cloudogu.com>
Co-authored-by: Sebastian Sdorra <sebastian.sdorra@cloudogu.com>
2022-01-20 11:00:49 +01:00
René Pfeuffer
6e555a855a Set HEAD to correct default branch (#1929)
Sets the HEAD for new Git repositories to the default branch (this is 'main' for the default configuration).
This change led to errors in unit tests, that depended on the 'master' branch.

Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
2022-01-20 10:19:27 +01:00