Commit e13c0a13 authored by Felix Dietrich's avatar Felix Dietrich Committed by Felix Dietrich

Initial commit: Vadere master

parent 540e4f17
#builds, log/preferences files
target/
*.out
*.preferences.xml
#IntelliJ
.idea/
*.iml
#Eclipse
.settings/
.metadata/
.classpath
.project
#package specific
VadereGui/*.png
VadereGui/*.svg
VadereGui/*.mov
VadereUtils/testreports/*.txt
VadereSimulator/resources/current_commit_hash.txt
  • I fixed the problem. The application will no longer crash if there is no current_commit_hash.txt, instead an error will be logged. I also updated the paths used in the hook files. The user has to copy the hook files into the .git directory. Note that all hooks and the scrip file contained in Documentation/version_control have to be executable. I additionally add a JUnit test that fails if there is no current_commit_hash.txt. All these changes are currently in the develop-branch.

Please register or sign in to reply
#model test output
VadereModelTests/TestOSM/output/*
VadereModelTests/TestSFM/output/*
VadereModelTests/TestGNM/output/*
VadereModelTests/TestOVM/output/*
VadereModelTests/TestOSM/processed output/*
VadereModelTests/TestSFM/processed output/*
VadereModelTests/TestGNM/processed output/*
VadereModelTests/TestOVM/processed output/*
#deprecated: can potentially be removed
bin/
VadereGui/output/
Contribution guidelines
=======================
Coding style guide
------------------
Basic rules:
- No warnings
- No unused imports
- Use the formatting tool!
- Eclipse: select text (optional) and press <kbd>ctrl</kbd> + <kbd>shift</kbd> + <kbd>f</kbd>
- IntelliJ: select text (optional) and <kbd>ctrl</kbd> + <kbd>alt</kbd> + <kbd>l</kbd>
For source code formatting, we use an adapted version of
[Google's Coding style guide](https://google.github.io/styleguide/javaguide.html).
Please check the [README in this repository](/vadere/styleguide)
for the style guide and for how to import the style settings into your IDE.
Commit style guide
------------------
These are examples for a good commit messages:
```
Fix typo in introduction to user guide
```
```
Refactor model initialization
Extracting a new class ModelBuilder because this functionality might be
used in multiple places.
```
Rules:
1. Separate subject from body with a blank line
2. Limit the subject line to 50 characters
3. Capitalize the subject line
4. Do not end the subject line with a period
5. Use the imperative mood in the subject line
6. Wrap the body at 72 characters
7. Use the body to explain what and why vs. how
Source: http://chris.beams.io/posts/git-commit/
This article lists good reasons for each rule!
Reasons include:
- Clean and consistent git-log that also fits in the GitLab user interface
- Stick to Git standards, e.g. "Merge branch ..." and "Revert ..."
Rules 1, 3, and 4 never hurt and should always be applied.
VADERE & Git
============
This document describes our workflows with Git.
## Excursus: Fundamentals of Git remotes
Like we can have multiple branches, we can also have multiple remotes.
Remotes are other repositories we are synchronizing with.
You are probably already familiar with remotes:
When you clone a repository, you have this repository as a remote.
By convention, it is called `origin`.
We use remotes to work with the public and the private VADERE repositories from
only *one* local repository.
Source: Scott Chacon and Ben Straub: [Pro Git](https://git-scm.com/book/en/v2),
specifically [Working with
Remotes in chapter 2](https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes)
## Repository setup
Our repositories are set up as follows:
1. A public repository `vadere`.
2. A private repository `vadere-private`.
The public repository contains these branches:
1. `master` for the current stable release.
2. `develop` for current development.
3. `dev/*` or `lastname/*` branches.
For new releases, `develop` is merged into `master`.
The private repository contains only branches that must be private, e.g. a new
simulation model under development. It does not contain copies of any branches
of the public repository because this leads to a synchronization overhead.
Important: Both remote repositories are managed from one single local
repository using remotes. For details, see the workflows below.
The URLs for public and private repositories are:
* git@gitlab.lrz.de:vadere/vadere.git
* git@gitlab.lrz.de:vadere/vadere-private.git
## Workflows
### Getting started & public contribution
For standard development and bugfixes, you can follow this workflow.
```
git clone <url-of-public-repo>
cd vadere
git checkout develop
git checkout -b dev/my-feature
```
With this commands, you
1. make your initial clone of the public repository.
2. checkout the development branch on which we are working.
(The `master` branch is reserved for stable releases.)
3. checkout a new branch (based on `develop`) to work on a new feature.
(Note that the feature branch should start with `dev/` but cannot start with `develop/`.)
After you finished the new feature, go to GitLab, view your feature branch and create a pull/merge request.
The target branch must be `develop`, not `master`.
![Screenshout of GitLab merge request creation (1)](gitlab-merge-request.png)
![Screenshout of GitLab merge request creation (2)](gitlab-merge-request-create.png)
### Working on a private branch
To work on a private project, you can follow this workflow.
If not already done,
1. clone the public repository (see above).
2. add the private repository as a remote: `git remote add private <url-of-private-repo>`
Now proceed with:
```
git checkout master
git checkout -b my-model
git push -u private my-model
```
With this commands, you
1. checkout the current release.
2. checkout a new branch (based on `master`) to work on e.g. a new model.
3. push your new branch to the private repository.
From now, you can synchronize your private branch with `git pull` and `git
push` with the private repository.
### Working together on a private branch
To work together on a private branch, you can follow this workflow.
Precondition: One person has set up a private branch (see previous section).
First, the co-worker has to do this steps (described in the previous section):
1. Clone the public repository.
2. Add the private repository as a remote.
Now, the co-worker proceeds with:
```
git fetch --all
git checkout private/my-model
git checkout -b my-model
git push -u private my-model
```
With this commands, you
1. fetch the latest state of all repositories.
2. checkout the existing private branch of the remote `private`.
3. checkout your "working branch" with the same name but without the `private/` prefix.
4. initially push and register the branch.
From now, you can commit changes into this branch and synchronize with the
private repository using `git pull` and `git push`.
### Rebasing to avoid unnecessary merge commits
You may want to update your local branch you are currently working on and get
the latest changes of `master` or `develop`.
To avoid unnecessary merge commits you should prefer
[rebasing](https://git-scm.com/book/de/v1/Git-Branching-Rebasing) over merging.
Automatic merging happens when you do `git pull` and there are new commits
locally *and* remotely.
In this case it is usually better to do `git pull --rebase`. This applies your
local commits on top of the remote's commits.
Please configure Git to avoid merges on `git pull`:
```
# cd into your vadere repository, then
git config pull.ff only
```
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs