Skip to content

Commit 760a5ac

Browse files
author
yuangli
committed
Merge branch 'main' into fix-invalid-branch-name
2 parents 1912f14 + 92ffdd2 commit 760a5ac

File tree

1,083 files changed

+27472
-15740
lines changed

Some content is hidden

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

1,083 files changed

+27472
-15740
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

.github/release.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
changelog:
2+
categories:
3+
- title: New features
4+
labels:
5+
- feature
6+
- title: Bug fixes
7+
labels:
8+
- bug
9+
- title: Code cleanups
10+
labels:
11+
- cleanup
12+
- title: CI improvements
13+
labels:
14+
- build
15+
- title: Documentation improvements
16+
labels:
17+
- documentation
18+
- title: Other changes
19+
labels:
20+
- '*'

.github/workflows/benchmark.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Benchmark libgit2 against the git reference implementation.
2+
name: Benchmark
3+
4+
on:
5+
workflow_dispatch:
6+
schedule:
7+
- cron: '15 4 * * *'
8+
9+
jobs:
10+
# Run our nightly builds. We build a matrix with the various build
11+
# targets and their details. Then we build either in a docker container
12+
# (Linux) or on the actual hosts (macOS, Windows).
13+
build:
14+
# Only run scheduled workflows on the main repository; prevents people
15+
# from using build minutes on their forks.
16+
if: github.repository == 'libgit2/libgit2'
17+
18+
strategy:
19+
matrix:
20+
platform:
21+
- name: "Linux (clang, OpenSSL)"
22+
env:
23+
CC: clang
24+
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DREGEX_BACKEND=builtin -DDEPRECATE_HARD=ON -DUSE_GSSAPI=ON -DBUILD_TESTS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_CLI=ON -DCMAKE_BUILD_TYPE=Release
25+
CMAKE_BUILD_OPTIONS: --config Release
26+
id: linux
27+
os: ubuntu-latest
28+
setup-script: ubuntu
29+
- name: "macOS"
30+
os: macos-10.15
31+
env:
32+
CC: clang
33+
CMAKE_OPTIONS: -DREGEX_BACKEND=regcomp_l -DDEPRECATE_HARD=ON -DUSE_GSSAPI=ON -DBUILD_TESTS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_CLI=ON -DCMAKE_BUILD_TYPE=Release
34+
CMAKE_BUILD_OPTIONS: --config Release
35+
PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig
36+
id: macos
37+
setup-script: osx
38+
- name: "Windows (amd64, Visual Studio)"
39+
os: windows-2019
40+
env:
41+
ARCH: amd64
42+
CMAKE_GENERATOR: Visual Studio 16 2019
43+
CMAKE_OPTIONS: -A x64 -DDEPRECATE_HARD=ON -DBUILD_TESTS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_CLI=ON -DCMAKE_BUILD_TYPE=Release
44+
CMAKE_BUILD_OPTIONS: --config Release
45+
id: windows
46+
setup-script: win32
47+
fail-fast: false
48+
name: "Build ${{ matrix.platform.name }}"
49+
env: ${{ matrix.platform.env }}
50+
runs-on: ${{ matrix.platform.os }}
51+
steps:
52+
- name: Check out repository
53+
uses: actions/checkout@v2
54+
with:
55+
path: source
56+
fetch-depth: 0
57+
- name: Set up benchmark environment
58+
run: source/ci/setup-${{ matrix.platform.setup-script }}-benchmark.sh
59+
shell: bash
60+
if: matrix.platform.setup-script != ''
61+
- name: Build
62+
run: |
63+
mkdir build && cd build
64+
../source/ci/build.sh
65+
shell: bash
66+
- name: Benchmark
67+
run: |
68+
if [[ "$(uname -s)" == MINGW* ]]; then
69+
GIT2_CLI="$(cygpath -w $(pwd))\\build\\Release\\git2_cli"
70+
else
71+
GIT2_CLI="$(pwd)/build/git2_cli"
72+
fi
73+
74+
mkdir benchmark && cd benchmark
75+
../source/tests/benchmarks/benchmark.sh --baseline-cli "git" --cli "${GIT2_CLI}" --json benchmarks.json --zip benchmarks.zip
76+
shell: bash
77+
- name: Upload results
78+
uses: actions/upload-artifact@v2
79+
with:
80+
name: benchmark-${{ matrix.platform.id }}
81+
path: benchmark
82+
if: always()

.github/workflows/codeql.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)