6.1.4.6. Git¶
Integration with Git
Support for Git.
VCSIntegration Git supports line-by-line blame information.
Information like remote URL (including authentication information), branch, submodules, etc. should be reflected automatically from the analysis worktree, so that you do not have to manually set it.
Typically, the worktree should be already cloned using the same
remote URL (e.g. HTTPS with token authentication or SSH) that can also be used from the
dashboard.
In case this is not possible, you can overwrite username (or username and password)
using the environment variables AXIVION_SOURCESERVER_GIT_USERNAME and
AXIVION_SOURCESERVER_GIT_PASSWORD.
However, as this should be considered an exceptional case and not the normal case, do
use with extreme care and only if you understand the implications.
Options¶
The following places define options that affect this rule: VCSIntegration, Project-GlobalOptions
binary¶
binary : str = 'git'
blame_mode¶
blame_mode : BlameMode = 'all_authors'
last_author_only, issues for code regions are only
attributed to the author of the latest changes in that region. Otherwise, all
authors of that code region are considered responsible.
branch¶
branch : str | None = None
Automatically detected from workspace when no value is entered.
If the workspace is in detached HEAD state, the branch cannot be
reflected and you have to specify it, preferably by using some environment
variable here (like e.g. AXIVION_BRANCH_NAME) which you can set in the
calling environment of axivion_ci.
encoding¶
encoding : str = 'utf-8'
gitdir¶
gitdir : bauhaus.analysis.config.PlainPath | None = None
.git directory of the working repository. Either specified as
absolute path, relative to rootpath or
/Project/directory (if rootpath
is empty).
Automatically detected from workspace when no value is entered.
remote¶
remote : str | None = None
origin.
Automatically detected from workspace when no value is entered.
rootpath¶
rootpath : bauhaus.analysis.config.ProjectRelativePath = '.'
rootpath options have to be set differently. The value of
rootpath must not be outside of
/Project/directory for source code to be visible
in the dashboard and for local_mode to work
correctly.
skip_blame¶
skip_blame : bool = False
sourceserver_gitdir¶
sourceserver_gitdir : str | None = None
Path of the git mirror repository of the project on the dashboard server. Can be reflected from workspace.
If this option is unset, then the basename of the (explicitly configured or reflected) option sourceserver_remote_url is being used.
Any relative path (which is recommended over using an absolute path) will be
interpreted relative to the dashboard's configuration subfolder
repositories.
Any absolute path will stay absolute unless you set
ForceRelativeRepositoryPath to true inside
dashboard2.config in which case absolute paths are also forced to
be interpreted relative to the dashboard's configuration subfolder
repositories.
The mirror clone can be created manually from within the dashboard or automatically from a subsequent successful analysis run if the project is registered in the dashboard and the git credentials are known in the context of the user running the dashboard on the dashboard server.
For testing setups: If analysis and dashboard are running on the same machine,
the gitdir of the analysis (i.e. the .git directory or file) may be
used instead (do not use for production). Note however that sourcecode in
submodules cannot be displayed in the dashboard in this case.
sourceserver_remote_url¶
sourceserver_remote_url : str | None = None
unshallow_worktree¶
unshallow_worktree : bool = True
git fetch --unshallow first to have access to all commits for proper
operation of connecting issues and dashboard sourcecode display.
Option Types¶
These types are used by options listed above:
BlameMode¶
Enumeration of possible blame approaches for code regions.all_authors
All authors of a code region are considered responsible.last_author_only
Attribute issues only to the author of the latest change in the code region.