Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
2543 commits
Select commit Hold shift + click to select a range
29f141d
attr_cache: move from strmap to hashset_str
ethomson Sep 30, 2024
ee29ac7
checkout: use a hashset_str instead of a strmap
ethomson Sep 30, 2024
1f0c38f
config_list: use a hashset_str instead of a strmap
ethomson Sep 30, 2024
8dc52d0
sortedcache: use a hashset_str instead of a strmap
ethomson Sep 30, 2024
be8e75a
diff_driver: use a hashmap_str instead of a strmap
ethomson Sep 30, 2024
c9c5eba
submodule: use a hashmap for submodule map
ethomson Sep 30, 2024
e39a4f7
mwindow: use hashmaps
ethomson Sep 30, 2024
58c1558
transaction: use hashmap
ethomson Sep 30, 2024
74c4233
tree: use hashmap
ethomson Sep 30, 2024
c1ecf56
hashmap: update index to use new hashmap
ethomson Sep 28, 2024
b4be7d0
oid: introduce oid hash functions
ethomson Sep 29, 2024
7fb641b
cache: use a well-typed hashmap for oid mapped cache
ethomson Sep 29, 2024
f9ad579
commit_graph: use a well-typed oid hashmap
ethomson Sep 29, 2024
90f1785
describe: use a typed oid hashmap
ethomson Sep 29, 2024
9a7d920
grafts: use a typed oid hashmap
ethomson Sep 29, 2024
c729431
merge: use type safe oid-keyed hashmaps
ethomson Sep 29, 2024
79290ba
odb_mempack: use a typed hashmap
ethomson Sep 29, 2024
5d2c56d
revwalk: hashmap
ethomson Sep 29, 2024
77e359e
indexer: use typed hashmap
ethomson Oct 1, 2024
9daf45a
pack: use typed hashmap for index cache
ethomson Oct 1, 2024
597a671
pack: typed hashmap for offsets instead of offmap
ethomson Oct 1, 2024
4e2ce7e
packbuilder: use hashmap for pobject map
ethomson Oct 1, 2024
8c55bbe
packbuilder: use hashmap for walk_objects
ethomson Oct 1, 2024
8d81bb5
hashmap: remove now-unused offmap and strmap
ethomson Oct 1, 2024
9c1f4b4
oidmap: remove now-unused oidmap
ethomson Oct 1, 2024
7ca51a8
util: remove now-used khash.h
ethomson Oct 1, 2024
9d57a7a
hashmap_oid: introduce hashmap_oid
ethomson Oct 1, 2024
751c68f
Merge pull request #6877 from yerseg/ability_to_add_custom_x509_certs
ethomson Oct 2, 2024
5ead0bd
Merge pull request #6897 from libgit2/ethomson/hashmap
ethomson Oct 2, 2024
a9ba029
hashmap: add some asserts
ethomson Oct 4, 2024
e7db282
openssl: dynamic loading fixes
ethomson Oct 4, 2024
1db158e
Merge pull request #6901 from libgit2/ethomson/openssl_dynamic
ethomson Oct 5, 2024
6c547af
hashmap: asserts
ethomson Oct 5, 2024
f71f154
Merge pull request #6902 from libgit2/ethomson/hashmap
ethomson Oct 5, 2024
6d8d5de
hashmap: further asserts
ethomson Oct 7, 2024
b72dfb0
zlib: update bundled zlib to v1.3.1
ethomson Oct 5, 2024
7435419
Merge pull request #6905 from libgit2/ethomson/zlib
ethomson Oct 7, 2024
0da8e72
Merge pull request #6904 from libgit2/ethomson/hashmap
ethomson Oct 7, 2024
7f7dfe7
Add OpenSSL-FIPS CMake flag
mdabrowskin Oct 9, 2024
3d26828
sha: support FIPS-compliant OpenSSL for SHA1
ethomson Oct 9, 2024
41c8c46
README updates
ethomson Oct 11, 2024
a9aa214
Merge pull request #6908 from libgit2/ethomson/readme
ethomson Oct 11, 2024
c2d697e
s/size on bytes/size in bytes/
John-Colvin Oct 16, 2024
215aafb
Merge pull request #6909 from John-Colvin/patch-1
ethomson Oct 17, 2024
9cea29d
blame: update API
ethomson Jun 22, 2024
5378b80
blame: add final committer information
ethomson Jul 9, 2024
49402cc
blame: add commit summary information
ethomson Jul 9, 2024
1474c89
cli: introduce `cli_resolve_path`
ethomson Jul 9, 2024
1ee2c33
blame: provide line accessor
ethomson Jul 9, 2024
b02a858
fips: clear context after finalization
ethomson Oct 18, 2024
637ab37
commitgraph: don't update finalized hash
ethomson Oct 18, 2024
a7ca589
midx: don't update finalized hash
ethomson Oct 18, 2024
8cf4cc2
ci: test FIPS on Linux only
ethomson Oct 10, 2024
1925889
cli: add a blame command
ethomson Jul 9, 2024
2cfb83b
blame: don't try to create a blame on error
ethomson Jul 13, 2024
99e0d2a
Merge pull request #6907 from libgit2/ethomson/blame_cmd
ethomson Oct 18, 2024
f1cac06
Mandate C90 conformance
GravisZro Mar 18, 2024
41a41b4
cmake: make C_STANDARD and C_EXTENSIONS configurable
ethomson Oct 18, 2024
4768d8a
ci: don't use extensions on msan build
ethomson Oct 18, 2024
d6a1107
cmake: document C standard options
ethomson Oct 18, 2024
3594a54
Merge pull request #6911 from libgit2/ethomson/c90-2
ethomson Oct 18, 2024
6c70f24
Update ntlmclient dependency
ethomson Oct 18, 2024
6ea625c
Merge pull request #6912 from libgit2/ethomson/ntlm
ethomson Oct 18, 2024
d090433
cmake: use CMAKE_C_STANDARD and CMAKE_C_EXTENSIONS
ethomson Oct 19, 2024
821d41a
ci: set CMAKE_C_EXTENSIONS for msan builds
ethomson Oct 19, 2024
9c3fb6f
tests: init clone options the proper way
ethomson Sep 6, 2021
7db3320
llhttp: use c-style comments
ethomson Oct 19, 2024
0013a6f
cmake: default to c99 on android
ethomson Oct 19, 2024
933b62e
checkout: make safe checkout the default
ethomson Sep 6, 2021
6955504
clone: refactor to pass clone options around
ethomson Mar 1, 2022
c1b2b25
remote: add update_refs callback
ethomson Oct 19, 2024
68bffe4
Merge pull request #6037 from libgit2/ethomson/checkout_safety
ethomson Oct 19, 2024
1692d30
Merge pull request #6559 from libgit2/ethomson/update_tips_spec
ethomson Oct 19, 2024
9773432
cmake: set Python policy to avoid warning
ethomson Oct 19, 2024
5caa454
Merge pull request #6915 from libgit2/ethomson/cmake-python
ethomson Oct 20, 2024
500796a
ci: don't run Windows SHA256 gitdaemon tests
ethomson Oct 20, 2024
0455346
Merge pull request #6916 from libgit2/ethomson/ci
ethomson Oct 20, 2024
cd9f463
Merge pull request #6914 from libgit2/ethomson/cmake
ethomson Oct 20, 2024
7e3535c
Merge pull request #6906 from marcind-dot/add-OpenSSL-FIPS-cmake-flag
ethomson Oct 21, 2024
0e08b58
ci: don't run Windows SHA256 gitdaemon tests
ethomson Oct 21, 2024
e1d44d9
cli: optionally show hidden options in usage
ethomson Oct 21, 2024
fe66d93
cli: reorder arguments for help invocation
ethomson Oct 21, 2024
da6b76d
cli: refactor common options
ethomson Oct 21, 2024
3ba218c
cli: add a --no-pager option (currently a noop)
ethomson Oct 21, 2024
fddb0bb
benchmarks: pass options on beyond --
ethomson Jun 29, 2024
0dfcb29
benchmarks: clone git or kernel repositories
ethomson Jun 29, 2024
42bd9df
benchmarks: pre-clone git and linux in ci
ethomson Jun 29, 2024
03d61cf
benchmarks: add blame benchmarks
ethomson Jun 29, 2024
d564cc1
benchmark: don't require a default
ethomson Jul 4, 2024
4f40bd9
benchmark: show helpful errors w/o local repo
ethomson Jul 4, 2024
90e659d
ci: only publish benchmarks nightly
ethomson Oct 21, 2024
229181b
Merge pull request #6919 from libgit2/ethomson/sha256_ci
ethomson Oct 21, 2024
df3d8a6
ci: allow inputs to benchmark
ethomson Oct 21, 2024
d4222f8
ci: don't run blame on torvalds/linux (yet)
ethomson Oct 21, 2024
e68d0b4
benchmark: skip (don't fail) needs_repo tests
ethomson Oct 21, 2024
d1be60b
Add the ability to check if a mempack is empty
nightelf3 Oct 21, 2024
533ec83
Merge pull request #6920 from libgit2/ethomson/blame_benchmarks
ethomson Oct 21, 2024
0c675b8
cmake: enforce USE_HTTP_PARSER validity
ethomson Oct 22, 2024
2125e3c
cmake: enforce USE_SSH validity
ethomson Oct 22, 2024
d1d6578
cmake: enforce USE_HTTPS validity
ethomson Oct 22, 2024
e536b2c
cmake: enforce USE_SHA1 and USE_SHA256 validity
ethomson Oct 22, 2024
d37d6a9
cmake: better document dependency options
ethomson Oct 22, 2024
22ee5a5
docs: update README for dependency selection
ethomson Oct 22, 2024
13a326f
ci: build and test with system http-parser
ethomson Oct 22, 2024
95f47a3
ci: update noble build
ethomson Oct 22, 2024
b190162
Add the ability to get the number of objects in mempack
nightelf3 Oct 22, 2024
e3467dd
Merge pull request #6924 from libgit2/ethomson/cmake_deps
ethomson Oct 22, 2024
95149d2
readme: add OpenSSF best practices badge
ethomson Oct 23, 2024
8691f1e
Merge pull request #6925 from libgit2/ethomson/ossf_best_practices
ethomson Oct 23, 2024
73ac58f
ci: port latest fixes to nightlies
ethomson Oct 23, 2024
a6ee48d
Merge pull request #6926 from libgit2/ethomson/ci
ethomson Oct 23, 2024
d2f5ce2
Update documentation of merge_base_many
Caleb-T-Owens Oct 23, 2024
57ae4b1
util/win32: Continue if access is denied when deleting a folder.
lrm29 Oct 25, 2024
d1f1e17
realpath: unbreak build on OpenBSD
ajacoutot Oct 27, 2024
b363ea4
Merge pull request #6932 from ajacoutot/openbsd-realpath
ethomson Oct 27, 2024
c6111ec
Merge pull request #6929 from lrm29/util_win32_rmdir_access_denied
ethomson Oct 29, 2024
17a9aae
Merge branch 'libgit2:main' into main
bmarques1995 Nov 6, 2024
728e63f
ssh: Include rsa-sha2-256 and rsa-sha2-512 in the list of preferred h…
lrm29 Nov 15, 2024
27549bd
object: core.abbrev accepts string values
lrm29 Nov 20, 2024
6ee06ca
Remove unnecessary comment.
lrm29 Nov 20, 2024
98fee52
Cast size_t to int
lrm29 Nov 20, 2024
0a6051c
Merge pull request #6927 from Caleb-T-Owens/merge-base-many-docs
ethomson Nov 24, 2024
eb84531
Clear data after negotiation
lrm29 Nov 25, 2024
89cc5ef
Include documentation generator
ethomson Nov 25, 2024
07c77d4
Merge pull request #6945 from libgit2/ethomson/docs-ci
ethomson Nov 25, 2024
9321800
Update documentation generation workflow
ethomson Nov 26, 2024
e74b9c6
Merge pull request #6948 from libgit2/ethomson/docs-ci
ethomson Nov 26, 2024
0bd5e47
Introduce a "validate only" mode for docs generation
ethomson Nov 26, 2024
8e51677
Add CI step to validate documentation changes
ethomson Nov 26, 2024
5353a2c
reflog: remove unused sys functions
ethomson May 1, 2024
338ceb9
Improve documentation
ethomson Nov 25, 2024
b8ad17f
Merge pull request #6949 from libgit2/ethomson/docs
ethomson Nov 26, 2024
c86842f
Merge pull request #6938 from mathworks/lrm29-ssh-hostkey-check
ethomson Nov 26, 2024
2adb7bc
refs: Handle normalizing negative refspecs
ryan-ph Nov 28, 2024
1da67ef
Allow documentation (re)generation in CI build
ethomson Dec 9, 2024
6297b61
Add search capabilities to docs
ethomson Dec 9, 2024
5efc006
Generate search page in documentation generation
ethomson Dec 9, 2024
cd8f273
Merge pull request #6953 from libgit2/ethomson/docs-search
ethomson Dec 9, 2024
8ae0a22
Documentation: don't resort versions
ethomson Dec 9, 2024
ce01bb3
Merge pull request #6954 from libgit2/ethomson/docs
ethomson Dec 9, 2024
88fee7a
Documentation: update refdb_backend docs
ethomson Dec 9, 2024
2b74d4b
Merge pull request #6955 from libgit2/ethomson/docs
ethomson Dec 9, 2024
4bb69b0
odb_mempack: use an out param
ethomson Dec 9, 2024
4282cbd
Merge remote-tracking branch 'main' into mempack_empty
ethomson Dec 9, 2024
f54d460
odb: fix mempack cast
ethomson Dec 9, 2024
455ce40
Make `GIT_WIN32` an internal declaration
ethomson Nov 16, 2024
6821bde
Merge pull request #6940 from libgit2/ethomson/win32
ethomson Dec 10, 2024
4fef2bd
Move abbrev_length from object to repository.
lrm29 Dec 10, 2024
0f1cb81
Documentation: clean up old documentation
ethomson Dec 10, 2024
03e0bf3
Documentation generation: verbose generation
ethomson Dec 10, 2024
27d82f1
Merge pull request #6957 from libgit2/ethomson/docs-ci
ethomson Dec 10, 2024
7668c13
refs: remove obsolete validity test with carat prefix
ethomson Dec 11, 2024
1738f89
Merge pull request #6951 from ryan-ph/ryanpham/negative-refspec/parse
ethomson Dec 11, 2024
f675ea3
docs: remind people about `git_libgit2_init`
ethomson Dec 11, 2024
48820e6
pathspec: additional pathspec wildcard tests
ethomson Dec 11, 2024
8ad1eb9
Merge pull request #6958 from libgit2/ethomson/init-docs
ethomson Dec 11, 2024
d363cc8
Apply PR feedback.
lrm29 Dec 11, 2024
0bb7d45
Merge pull request #6944 from mathworks/pr_6724
ethomson Dec 12, 2024
c642ef9
Merge pull request #6959 from libgit2/ethomson/pathspec_tests
ethomson Dec 13, 2024
bef4b73
transport: only clear data when not in rpc mode
ethomson Dec 13, 2024
8049f00
Merge remote-tracking branch 'origin/main' into ssh
ethomson Dec 13, 2024
8332249
security: require TLSv1.2 or higher
ethomson Mar 16, 2024
e014b10
security: improve the default TLS ciphers
ethomson Dec 16, 2024
0c48276
Merge pull request #6960 from libgit2/ethomson/tls
ethomson Dec 16, 2024
ab0e160
docs: include v1.8.4 changelog
ethomson Dec 16, 2024
5576e8f
docs: add "benchmarks" section to changelog
ethomson Dec 16, 2024
3251d1b
Merge pull request #6961 from libgit2/ethomson/changelog
ethomson Dec 16, 2024
009677e
oid: provide private type_is_valid functionality
ethomson Dec 16, 2024
3d9f406
refspec: Add func to distinguish negative refspecs
ryan-ph Nov 28, 2024
f7f30ec
remote: Handle fetching negative refspecs
ryan-ph Nov 28, 2024
708d64f
index: provide a index_options structure when opening
ethomson Dec 16, 2024
9aa5faa
indexer: move oid_type into the opts structure
ethomson Dec 16, 2024
cefcabf
repo: specify odb options to odb_wrap
ethomson Dec 16, 2024
43c31ec
repo: don't require oid_type to wrap_odb
ethomson Dec 16, 2024
622035e
repo: take an options structure for repository_new
ethomson Dec 17, 2024
54d666e
commit_graph: move opts to `new` function
ethomson Dec 18, 2024
0738b05
commit_graph: add opts to `open` function
ethomson Dec 18, 2024
6aa9bc4
midx: add options to writer function
ethomson Dec 18, 2024
dc95ee2
ssl: restore tls v1.0 support temporarily
ethomson Dec 18, 2024
12f1706
Merge pull request #6964 from libgit2/ethomson/tls
ethomson Dec 18, 2024
4dcdb64
Merge pull request #6965 from libgit2/ethomson/sha256
ethomson Dec 18, 2024
f866bb9
features: move version tests out of features test
ethomson Dec 22, 2024
e0c255d
zlib: add zlib backend status to git2_features.h
ethomson Dec 22, 2024
19a031d
Introduce `git_libgit2_feature_backend` API
ethomson Dec 22, 2024
bed00cd
smart: ignore shallow/unshallow packets during ACK processing
kempniu Dec 22, 2024
95dfb83
Merge pull request #6971 from libgit2/ethomson/features
ethomson Dec 23, 2024
67900a0
options: update X509 cert constant
ethomson Dec 23, 2024
430fe23
Merge pull request #6974 from libgit2/ethomson/abi
ethomson Dec 23, 2024
53c1495
docs: properly parse enum values
ethomson Dec 23, 2024
416a8d4
Merge pull request #6978 from libgit2/ethomson/docs
ethomson Dec 23, 2024
536f868
Merge pull request #6973 from kempniu/ignore-shallow-packets-during-a…
ethomson Dec 23, 2024
3951f96
Merge branch 'libgit2:main' into main
bmarques1995 Dec 23, 2024
5d6e679
Rebase
bmarques1995 Dec 23, 2024
83994da
remote: Remove unnecessary call
ryan-ph Dec 24, 2024
6039d28
remote: Return first matching refspec
ryan-ph Dec 24, 2024
099e62c
remote: Don't use designated initializer
ryan-ph Dec 24, 2024
ccc2028
Merge pull request #6962 from ryan-ph/ryanpham/negative-refspec/remote
ethomson Dec 24, 2024
0c27a85
repo: don't require option when `template_path` is specified
ethomson Dec 27, 2024
a844a6c
repo: put a newline on the .git link file
ethomson Dec 27, 2024
bf5f0b5
cli: add an `init` command
ethomson Dec 27, 2024
5723964
Merge pull request #6983 from libgit2/ethomson/template_path
ethomson Dec 27, 2024
5350142
Merge pull request #6981 from libgit2/ethomson/gitlink_newline
ethomson Dec 27, 2024
9f61001
cli: improve option help
ethomson Dec 27, 2024
ded9494
cmake: only add package target for libgit2 itself
ethomson Dec 23, 2024
838875e
Merge branch 'cmake_target'
ethomson Dec 28, 2024
800a953
Merge pull request #6984 from libgit2/ethomson/cli
ethomson Dec 28, 2024
e96e250
v1.9: update changelog
ethomson Dec 23, 2024
c536fcb
v1.9: update version numbers
ethomson Dec 23, 2024
dc81659
Merge pull request #6979 from libgit2/ethomson/v19
ethomson Dec 28, 2024
3aeb5bd
meta: revert soname version update
ethomson Dec 28, 2024
d85c1a1
Merge pull request #6985 from libgit2/ethomson/soname_revert
ethomson Dec 28, 2024
550cf62
cmake: warn for not using sha1dc
ethomson Dec 28, 2024
a8fbbf7
Merge pull request #6986 from libgit2/ethomson/warn_sha1
ethomson Dec 28, 2024
1329f1a
v1.9: final changelog updates
ethomson Dec 28, 2024
25d87c2
Merge pull request #6987 from libgit2/ethomson/changelog
ethomson Dec 28, 2024
d7f3fb5
README: add v1.9 builds
ethomson Dec 28, 2024
e447de9
ci: only build docs on main branch pushes
ethomson Dec 28, 2024
76fe397
Merge pull request #6989 from libgit2/ethomson/readme
ethomson Dec 28, 2024
338e6fb
Merge pull request #6990 from libgit2/ethomson/ci
ethomson Dec 28, 2024
ae99713
hash: allow `unsigned int` != `size_t` in sha256
ethomson Jan 2, 2025
2a601e0
include: Fix code comment termination
florianpircher Jan 2, 2025
4fb6de4
Update SelectSSH.cmake
lrm29 Jan 13, 2025
f4c3b35
alternates: allow relative paths in all repositories
vapier Jan 16, 2025
93aee58
ci: update download-artifact version
ethomson Feb 7, 2025
e855bd5
docs: add `update_refs` as ABI breaking change
ethomson Jan 7, 2025
ed642bb
transport: сheck a pointer allocation result
peter15914 Jan 2, 2025
3900c3b
src/libgit2/CMakeLists.txt: install cmake files into configured libdir
kanavin Jan 7, 2025
4c57f9e
benchmarks: update path to baseline cli
ethomson Jan 9, 2025
8f9e095
cli: fix undefined alloca() on CYGWIN
carlo-bramini Jan 20, 2025
b9f06e5
attr: honor ignorecase in attribute matching
ethomson Jan 15, 2025
ecc0a4d
test: set a temporary PROGRAMDATA directory
ethomson Jan 20, 2025
22f0130
filter: set a temporary sysdir in test
ethomson Jan 20, 2025
d4a7e3c
conflict tests: check `core.ignorecase`
emilazy Jan 21, 2025
298a9ba
Include common.h in version.h
ethomson Jan 23, 2025
3910cde
clar: update to latest version
ethomson Jan 22, 2025
0922fcc
Revert include path regression
ytnuf Feb 13, 2025
94103d1
Fix MSVC cross compilation
Faless May 27, 2025
3b8318b
tag: Refuse to use HEAD as a tagname
csware Apr 7, 2025
e07acfd
docs: correct docstring info for git_remote_url
DominiqueFuchs May 16, 2025
0059816
Fixed memory leak in openssl fips modes
Apr 11, 2025
c38a362
Fix circular includes between types.h and oid.h
georgthegreat Mar 31, 2025
6048d2b
fuzzers: Fix CFLAGS
nelhage Mar 3, 2025
48cd7e8
Don't use -fsanitizer for the standalone fuzzer build.
nelhage Mar 3, 2025
25bcfb3
test: failing diff stat test.
kivikakk Mar 29, 2025
b24b9e2
diff: account for common prefix in max namelen.
kivikakk Mar 29, 2025
455a069
AUTHORS: add self.
kivikakk Mar 29, 2025
4a4d6ee
v1.9.1: update changelog
ethomson Jun 6, 2025
4bb0ece
v1.9.1: update version numbers
ethomson Jun 6, 2025
0060d9c
Merge pull request #7084 from libgit2/ethomson/v1.9.1
ethomson Jun 6, 2025
82300b9
Merge tag 'v1.9.1'
orgads Sep 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
92 changes: 92 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# This file is an example configuration for clang-format 5.0.
#
# Note that this style definition should only be understood as a hint
# for writing new code. The rules are still work-in-progress and does
# not yet exactly match the style we have in the existing code.

# C Language specifics
Language: Cpp

# Use tabs whenever we need to fill whitespace that spans at least from one tab
# stop to the next one.
#
# These settings are mirrored in .editorconfig. Keep them in sync.
UseTab: ForIndentation
TabWidth: 8
IndentWidth: 8
ContinuationIndentWidth: 8
ColumnLimit: 80

AlignAfterOpenBracket: AlwaysBreak
AlignEscapedNewlines: Left
AlignTrailingComments: false

# Allow putting parameters onto the next line
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false

# Don't allow short braced statements to be on a single line
# if (a) not if (a) return;
# return;
AllowShortBlocksOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortLoopsOnASingleLine: false
AllowShortLambdasOnASingleLine: None

# Pack as many parameters or arguments onto the same line as possible
# int myFunction(int aaaaaaaaaaaa, int bbbbbbbb,
# int cccc);
BinPackArguments: true
BinPackParameters: false

BreakBeforeBraces: Linux
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: false
BreakStringLiterals: false

# The number of spaces before trailing line comments (// - comments).
# This does not affect trailing block comments (/* - comments).
SpacesBeforeTrailingComments: 1

# Don't insert spaces in casts
# x = (int32) y; not x = ( int32 ) y;
SpacesInCStyleCastParentheses: false

# Don't insert spaces inside container literals
# var arr = [1, 2, 3]; not var arr = [ 1, 2, 3 ];
SpacesInContainerLiterals: false

# Don't insert spaces after '(' or before ')'
# f(arg); not f( arg );
SpacesInParentheses: false

# Don't insert spaces after '[' or before ']'
# int a[5]; not int a[ 5 ];
SpacesInSquareBrackets: false

# Insert a space after '{' and before '}' in struct initializers
Cpp11BracedListStyle: false

# A list of macros that should be interpreted as foreach loops instead of as
# function calls.
ForEachMacros:
- 'git_array_foreach'
- 'git_vector_foreach'

# The maximum number of consecutive empty lines to keep.
MaxEmptyLinesToKeep: 1

# No empty line at the start of a block.
KeepEmptyLinesAtTheStartOfBlocks: false

# Penalties
# This decides what order things should be done if a line is too long
PenaltyBreakAssignment: 10
PenaltyBreakBeforeFirstCallParameter: 30
PenaltyBreakComment: 10
PenaltyBreakFirstLessLess: 0
PenaltyBreakString: 10
PenaltyExcessCharacter: 100
PenaltyReturnTypeOnItsOwnLine: 60

SortIncludes: false
3 changes: 3 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"postCreateCommand": "bash .devcontainer/setup.sh"
}
9 changes: 9 additions & 0 deletions .devcontainer/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
set -e

sudo apt-get update
sudo apt-get -y --no-install-recommends install cmake

mkdir build
cd build
cmake ..
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
* text=auto
ci/**/*.sh text eol=lf
script/**/*.sh text eol=lf
tests/resources/** linguist-vendored
109 changes: 109 additions & 0 deletions .github/actions/download-or-build-container/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# Run a build step in a container or directly on the Actions runner
name: Download or Build Container
description: Download a container from the package registry, or build it if it's not found

inputs:
container:
description: Container name
type: string
required: true
dockerfile:
description: Dockerfile
type: string
base:
description: Container base
type: string
registry:
description: Docker registry to read and publish to
type: string
default: ghcr.io
config-path:
description: Path to Dockerfiles
type: string
github_token:
description: GitHub Token
type: string

runs:
using: 'composite'
steps:
- name: Download container
run: |
IMAGE_NAME="${{ inputs.container }}"
DOCKERFILE_PATH="${{ inputs.dockerfile }}"
DOCKER_REGISTRY="${{ inputs.registry }}"
DOCKERFILE_ROOT="${{ inputs.config-path }}"

if [ "${DOCKERFILE_PATH}" = "" ]; then
DOCKERFILE_PATH="${DOCKERFILE_ROOT}/${IMAGE_NAME}"
else
DOCKERFILE_PATH="${DOCKERFILE_ROOT}/${DOCKERFILE_PATH}"
fi

GIT_WORKTREE=$(cd "${GITHUB_ACTION_PATH}" && git rev-parse --show-toplevel)
echo "::: git worktree is ${GIT_WORKTREE}"
cd "${GIT_WORKTREE}"

DOCKER_CONTAINER="${GITHUB_REPOSITORY}/${IMAGE_NAME}"
DOCKER_REGISTRY_CONTAINER="${DOCKER_REGISTRY}/${DOCKER_CONTAINER}"

echo "dockerfile=${DOCKERFILE_PATH}" >> $GITHUB_ENV
echo "docker-container=${DOCKER_CONTAINER}" >> $GITHUB_ENV
echo "docker-registry-container=${DOCKER_REGISTRY_CONTAINER}" >> $GITHUB_ENV

# Identify the last git commit that touched the Dockerfiles
# Use this as a hash to identify the resulting docker containers
echo "::: dockerfile path is ${DOCKERFILE_PATH}"

DOCKER_SHA=$(git log -1 --pretty=format:"%h" -- "${DOCKERFILE_PATH}")
echo "docker-sha=${DOCKER_SHA}" >> $GITHUB_ENV

echo "::: docker sha is ${DOCKER_SHA}"

DOCKER_REGISTRY_CONTAINER_SHA="${DOCKER_REGISTRY_CONTAINER}:${DOCKER_SHA}"

echo "docker-registry-container-sha=${DOCKER_REGISTRY_CONTAINER_SHA}" >> $GITHUB_ENV
echo "docker-registry-container-latest=${DOCKER_REGISTRY_CONTAINER}:latest" >> $GITHUB_ENV

echo "::: logging in to ${DOCKER_REGISTRY} as ${GITHUB_ACTOR}"

exists="true"
docker login https://${DOCKER_REGISTRY} -u ${GITHUB_ACTOR} -p ${GITHUB_TOKEN} || exists="false"

echo "::: pulling ${DOCKER_REGISTRY_CONTAINER_SHA}"

if [ "${exists}" != "false" ]; then
docker pull ${DOCKER_REGISTRY_CONTAINER_SHA} || exists="false"
fi

if [ "${exists}" = "true" ]; then
echo "::: docker container exists in registry"
echo "docker-container-exists=true" >> $GITHUB_ENV
else
echo "::: docker container does not exist in registry"
echo "docker-container-exists=false" >> $GITHUB_ENV
fi
shell: bash
env:
GITHUB_TOKEN: ${{ inputs.github_token }}
- name: Create container
run: |
if [ "${{ inputs.base }}" != "" ]; then
BASE_ARG="--build-arg BASE=${{ inputs.base }}"
fi

GIT_WORKTREE=$(cd "${GITHUB_ACTION_PATH}" && git rev-parse --show-toplevel)
echo "::: git worktree is ${GIT_WORKTREE}"
cd "${GIT_WORKTREE}"

docker build -t ${{ env.docker-registry-container-sha }} --build-arg UID=$(id -u) --build-arg GID=$(id -g) ${BASE_ARG} -f ${{ env.dockerfile }} .
docker tag ${{ env.docker-registry-container-sha }} ${{ env.docker-registry-container-latest }}
shell: bash
working-directory: source/${{ inputs.config-path }}
if: env.docker-container-exists != 'true'
- name: Publish container
run: |
docker push ${{ env.docker-registry-container-sha }}
docker push ${{ env.docker-registry-container-latest }}
shell: bash
if: env.docker-container-exists != 'true' && github.event_name != 'pull_request'
51 changes: 51 additions & 0 deletions .github/actions/run-build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Run a build step in a container or directly on the Actions runner
name: Run Build Step
description: Run a build step in a container or directly on the Actions runner

inputs:
command:
description: Command to run
type: string
required: true
container:
description: Optional container to run in
type: string
container-version:
description: Version of the container to run
type: string
shell:
description: Shell to use
type: string
required: true
default: 'bash'

runs:
using: 'composite'
steps:
- run: |
if [ -n "${{ inputs.container }}" ]; then
docker run \
--rm \
--user "$(id -u):$(id -g)" \
-v "$(pwd)/source:/home/libgit2/source" \
-v "$(pwd)/build:/home/libgit2/build" \
-w /home/libgit2 \
-e ASAN_SYMBOLIZER_PATH \
-e CC \
-e CFLAGS \
-e CMAKE_GENERATOR \
-e CMAKE_OPTIONS \
-e GITTEST_NEGOTIATE_PASSWORD \
-e GITTEST_FLAKY_STAT \
-e PKG_CONFIG_PATH \
-e SKIP_NEGOTIATE_TESTS \
-e SKIP_SSH_TESTS \
-e SKIP_PUSHOPTIONS_TESTS \
-e TSAN_OPTIONS \
-e UBSAN_OPTIONS \
${{ inputs.container-version }} \
/bin/bash -c "${{ inputs.command }}"
else
${{ inputs.command }}
fi
shell: ${{ inputs.shell != '' && inputs.shell || 'bash' }}
35 changes: 35 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
changelog:
categories:
- title: New features
labels:
- feature
- title: Performance improvements
labels:
- performance
- title: Bug fixes
labels:
- bug
- title: Security fixes
labels:
- security
- title: Code cleanups
labels:
- cleanup
- title: Build and CI improvements
labels:
- build
- title: Documentation improvements
labels:
- documentation
- title: Platform compatibility fixes
labels:
- compatibility
- title: Git compatibility fixes
labels:
- git compatibility
- title: Dependency updates
labels:
- dependency
- title: Other changes
labels:
- '*'
Loading