Skip to content

Commit 438f68e

Browse files
committed
Merge tag 'v1.8.1'
2 parents 2ecf339 + 36f7e21 commit 438f68e

File tree

702 files changed

+74789
-27077
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

702 files changed

+74789
-27077
lines changed

.clang-format

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# This file is an example configuration for clang-format 5.0.
2+
#
3+
# Note that this style definition should only be understood as a hint
4+
# for writing new code. The rules are still work-in-progress and does
5+
# not yet exactly match the style we have in the existing code.
6+
7+
# C Language specifics
8+
Language: Cpp
9+
10+
# Use tabs whenever we need to fill whitespace that spans at least from one tab
11+
# stop to the next one.
12+
#
13+
# These settings are mirrored in .editorconfig. Keep them in sync.
14+
UseTab: ForIndentation
15+
TabWidth: 8
16+
IndentWidth: 8
17+
ContinuationIndentWidth: 8
18+
ColumnLimit: 80
19+
20+
AlignAfterOpenBracket: AlwaysBreak
21+
AlignEscapedNewlines: Left
22+
AlignTrailingComments: false
23+
24+
# Allow putting parameters onto the next line
25+
AllowAllArgumentsOnNextLine: false
26+
AllowAllParametersOfDeclarationOnNextLine: false
27+
28+
# Don't allow short braced statements to be on a single line
29+
# if (a) not if (a) return;
30+
# return;
31+
AllowShortBlocksOnASingleLine: false
32+
AllowShortFunctionsOnASingleLine: None
33+
AllowShortLoopsOnASingleLine: false
34+
AllowShortLambdasOnASingleLine: None
35+
36+
# Pack as many parameters or arguments onto the same line as possible
37+
# int myFunction(int aaaaaaaaaaaa, int bbbbbbbb,
38+
# int cccc);
39+
BinPackArguments: true
40+
BinPackParameters: false
41+
42+
BreakBeforeBraces: Linux
43+
BreakBeforeBinaryOperators: None
44+
BreakBeforeTernaryOperators: false
45+
BreakStringLiterals: false
46+
47+
# The number of spaces before trailing line comments (// - comments).
48+
# This does not affect trailing block comments (/* - comments).
49+
SpacesBeforeTrailingComments: 1
50+
51+
# Don't insert spaces in casts
52+
# x = (int32) y; not x = ( int32 ) y;
53+
SpacesInCStyleCastParentheses: false
54+
55+
# Don't insert spaces inside container literals
56+
# var arr = [1, 2, 3]; not var arr = [ 1, 2, 3 ];
57+
SpacesInContainerLiterals: false
58+
59+
# Don't insert spaces after '(' or before ')'
60+
# f(arg); not f( arg );
61+
SpacesInParentheses: false
62+
63+
# Don't insert spaces after '[' or before ']'
64+
# int a[5]; not int a[ 5 ];
65+
SpacesInSquareBrackets: false
66+
67+
# Insert a space after '{' and before '}' in struct initializers
68+
Cpp11BracedListStyle: false
69+
70+
# A list of macros that should be interpreted as foreach loops instead of as
71+
# function calls.
72+
ForEachMacros:
73+
- 'git_array_foreach'
74+
- 'git_vector_foreach'
75+
76+
# The maximum number of consecutive empty lines to keep.
77+
MaxEmptyLinesToKeep: 1
78+
79+
# No empty line at the start of a block.
80+
KeepEmptyLinesAtTheStartOfBlocks: false
81+
82+
# Penalties
83+
# This decides what order things should be done if a line is too long
84+
PenaltyBreakAssignment: 10
85+
PenaltyBreakBeforeFirstCallParameter: 30
86+
PenaltyBreakComment: 10
87+
PenaltyBreakFirstLessLess: 0
88+
PenaltyBreakString: 10
89+
PenaltyExcessCharacter: 100
90+
PenaltyReturnTypeOnItsOwnLine: 60
91+
92+
SortIncludes: false

.devcontainer/devcontainer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"postCreateCommand": "bash .devcontainer/setup.sh"
3+
}

.devcontainer/setup.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
set -e
3+
4+
sudo apt-get update
5+
sudo apt-get -y --no-install-recommends install cmake
6+
7+
mkdir build
8+
cd build
9+
cmake ..

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
* text=auto
2+
ci/**/*.sh text eol=lf
3+
script/**/*.sh text eol=lf
4+
tests/resources/** linguist-vendored
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# Run a build step in a container or directly on the Actions runner
2+
name: Download or Build Container
3+
description: Download a container from the package registry, or build it if it's not found
4+
5+
inputs:
6+
container:
7+
description: Container name
8+
type: string
9+
required: true
10+
dockerfile:
11+
description: Dockerfile
12+
type: string
13+
base:
14+
description: Container base
15+
type: string
16+
registry:
17+
description: Docker registry to read and publish to
18+
type: string
19+
default: ghcr.io
20+
config-path:
21+
description: Path to Dockerfiles
22+
type: string
23+
github_token:
24+
description: GitHub Token
25+
type: string
26+
27+
runs:
28+
using: 'composite'
29+
steps:
30+
- name: Download container
31+
run: |
32+
IMAGE_NAME="${{ inputs.container }}"
33+
DOCKERFILE_PATH="${{ inputs.dockerfile }}"
34+
DOCKER_REGISTRY="${{ inputs.registry }}"
35+
DOCKERFILE_ROOT="${{ inputs.config-path }}"
36+
37+
if [ "${DOCKERFILE_PATH}" = "" ]; then
38+
DOCKERFILE_PATH="${DOCKERFILE_ROOT}/${IMAGE_NAME}"
39+
else
40+
DOCKERFILE_PATH="${DOCKERFILE_ROOT}/${DOCKERFILE_PATH}"
41+
fi
42+
43+
GIT_WORKTREE=$(cd "${GITHUB_ACTION_PATH}" && git rev-parse --show-toplevel)
44+
echo "::: git worktree is ${GIT_WORKTREE}"
45+
cd "${GIT_WORKTREE}"
46+
47+
DOCKER_CONTAINER="${GITHUB_REPOSITORY}/${IMAGE_NAME}"
48+
DOCKER_REGISTRY_CONTAINER="${DOCKER_REGISTRY}/${DOCKER_CONTAINER}"
49+
50+
echo "dockerfile=${DOCKERFILE_PATH}" >> $GITHUB_ENV
51+
echo "docker-container=${DOCKER_CONTAINER}" >> $GITHUB_ENV
52+
echo "docker-registry-container=${DOCKER_REGISTRY_CONTAINER}" >> $GITHUB_ENV
53+
54+
# Identify the last git commit that touched the Dockerfiles
55+
# Use this as a hash to identify the resulting docker containers
56+
echo "::: dockerfile path is ${DOCKERFILE_PATH}"
57+
58+
DOCKER_SHA=$(git log -1 --pretty=format:"%h" -- "${DOCKERFILE_PATH}")
59+
echo "docker-sha=${DOCKER_SHA}" >> $GITHUB_ENV
60+
61+
echo "::: docker sha is ${DOCKER_SHA}"
62+
63+
DOCKER_REGISTRY_CONTAINER_SHA="${DOCKER_REGISTRY_CONTAINER}:${DOCKER_SHA}"
64+
65+
echo "docker-registry-container-sha=${DOCKER_REGISTRY_CONTAINER_SHA}" >> $GITHUB_ENV
66+
echo "docker-registry-container-latest=${DOCKER_REGISTRY_CONTAINER}:latest" >> $GITHUB_ENV
67+
68+
echo "::: logging in to ${DOCKER_REGISTRY} as ${GITHUB_ACTOR}"
69+
70+
exists="true"
71+
docker login https://${DOCKER_REGISTRY} -u ${GITHUB_ACTOR} -p ${GITHUB_TOKEN} || exists="false"
72+
73+
echo "::: pulling ${DOCKER_REGISTRY_CONTAINER_SHA}"
74+
75+
if [ "${exists}" != "false" ]; then
76+
docker pull ${DOCKER_REGISTRY_CONTAINER_SHA} || exists="false"
77+
fi
78+
79+
if [ "${exists}" = "true" ]; then
80+
echo "::: docker container exists in registry"
81+
echo "docker-container-exists=true" >> $GITHUB_ENV
82+
else
83+
echo "::: docker container does not exist in registry"
84+
echo "docker-container-exists=false" >> $GITHUB_ENV
85+
fi
86+
shell: bash
87+
env:
88+
GITHUB_TOKEN: ${{ inputs.github_token }}
89+
- name: Create container
90+
run: |
91+
if [ "${{ inputs.base }}" != "" ]; then
92+
BASE_ARG="--build-arg BASE=${{ inputs.base }}"
93+
fi
94+
95+
GIT_WORKTREE=$(cd "${GITHUB_ACTION_PATH}" && git rev-parse --show-toplevel)
96+
echo "::: git worktree is ${GIT_WORKTREE}"
97+
cd "${GIT_WORKTREE}"
98+
99+
docker build -t ${{ env.docker-registry-container-sha }} --build-arg UID=$(id -u) --build-arg GID=$(id -g) ${BASE_ARG} -f ${{ env.dockerfile }} .
100+
docker tag ${{ env.docker-registry-container-sha }} ${{ env.docker-registry-container-latest }}
101+
shell: bash
102+
working-directory: source/${{ inputs.config-path }}
103+
if: env.docker-container-exists != 'true'
104+
- name: Publish container
105+
run: |
106+
docker push ${{ env.docker-registry-container-sha }}
107+
docker push ${{ env.docker-registry-container-latest }}
108+
shell: bash
109+
if: env.docker-container-exists != 'true' && github.event_name != 'pull_request'

.github/actions/run-build/action.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Run a build step in a container or directly on the Actions runner
2+
name: Run Build Step
3+
description: Run a build step in a container or directly on the Actions runner
4+
5+
inputs:
6+
command:
7+
description: Command to run
8+
type: string
9+
required: true
10+
container:
11+
description: Optional container to run in
12+
type: string
13+
container-version:
14+
description: Version of the container to run
15+
type: string
16+
shell:
17+
description: Shell to use
18+
type: string
19+
required: true
20+
default: 'bash'
21+
22+
runs:
23+
using: 'composite'
24+
steps:
25+
- run: |
26+
if [ -n "${{ inputs.container }}" ]; then
27+
docker run \
28+
--rm \
29+
--user "$(id -u):$(id -g)" \
30+
-v "$(pwd)/source:/home/libgit2/source" \
31+
-v "$(pwd)/build:/home/libgit2/build" \
32+
-w /home/libgit2 \
33+
-e ASAN_SYMBOLIZER_PATH \
34+
-e CC \
35+
-e CFLAGS \
36+
-e CMAKE_GENERATOR \
37+
-e CMAKE_OPTIONS \
38+
-e GITTEST_NEGOTIATE_PASSWORD \
39+
-e GITTEST_FLAKY_STAT \
40+
-e PKG_CONFIG_PATH \
41+
-e SKIP_NEGOTIATE_TESTS \
42+
-e SKIP_SSH_TESTS \
43+
-e SKIP_PUSHOPTIONS_TESTS \
44+
-e TSAN_OPTIONS \
45+
-e UBSAN_OPTIONS \
46+
${{ inputs.container-version }} \
47+
/bin/bash -c "${{ inputs.command }}"
48+
else
49+
${{ inputs.command }}
50+
fi
51+
shell: ${{ inputs.shell != '' && inputs.shell || 'bash' }}

.github/release.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
changelog:
2+
categories:
3+
- title: New features
4+
labels:
5+
- feature
6+
- title: Performance improvements
7+
labels:
8+
- performance
9+
- title: Bug fixes
10+
labels:
11+
- bug
12+
- title: Security fixes
13+
labels:
14+
- security
15+
- title: Code cleanups
16+
labels:
17+
- cleanup
18+
- title: Build and CI improvements
19+
labels:
20+
- build
21+
- title: Documentation improvements
22+
labels:
23+
- documentation
24+
- title: Platform compatibility fixes
25+
labels:
26+
- compatibility
27+
- title: Git compatibility fixes
28+
labels:
29+
- git compatibility
30+
- title: Dependency updates
31+
labels:
32+
- dependency
33+
- title: Other changes
34+
labels:
35+
- '*'

0 commit comments

Comments
 (0)