Skip to content

Commit 3b4b22c

Browse files
committed
orphan of gix-v0.66.0 tag
0 parents  commit 3b4b22c

File tree

2,220 files changed

+315661
-0
lines changed

Some content is hidden

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

2,220 files changed

+315661
-0
lines changed

.cargo/config.toml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[build]
2+
rustflags = [
3+
# Rustc lints
4+
# "-W", "warning_name"
5+
6+
# Clippy lints
7+
"-W", "clippy::cloned_instead_of_copied",
8+
"-W", "clippy::map_unwrap_or",
9+
"-W", "clippy::redundant_closure_for_method_calls",
10+
"-W", "clippy::unnested_or_patterns",
11+
"-W", "clippy::uninlined_format_args",
12+
13+
# Rejected for now, and why
14+
# "-W" "clippy::default_trait_access" - sometimes makes imports necessary, just for a default value. It's good for more explicit typing though.
15+
# "-W" "clippy::range_plus_one" - useful, but caused too many false positives as we use range types directly quite a lot
16+
# "-W", "clippy::explicit_iter_loop", - the cases I saw turned `foo.iter_mut()` into `&mut *foo`
17+
18+
19+
# Rustdoc lints
20+
# "-W", "rustdoc::warning_name"
21+
# "-A", "rustdoc::warning_name"
22+
]

.devcontainer/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ARG VARIANT="1"
2+
FROM mcr.microsoft.com/devcontainers/rust:${VARIANT}
3+
RUN apt update && apt install -y cmake

.devcontainer/devcontainer.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "Rust",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"args": { "VARIANT": "1" }
6+
},
7+
"customizations": {
8+
"vscode": {
9+
"extensions": [
10+
"EditorConfig.EditorConfig",
11+
"rust-lang.rust-analyzer"
12+
]
13+
}
14+
},
15+
"remoteUser": "vscode"
16+
}

.editorconfig

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# EditorConfig is awesome: http://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines with a newline ending every file
7+
[*]
8+
end_of_line = lf
9+
insert_final_newline = true
10+
11+
[*.sh]
12+
indent_style = space
13+
indent_size = 2
14+
15+
# Tab indentation (no size specified)
16+
[Makefile]
17+
indent_style = tab
18+
19+
# Matches .json files or the exact file .travis.yml
20+
[{*.json,.travis.yml}]
21+
indent_style = space
22+
indent_size = 2

.gitattributes

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
**/generated-archives/*.tar* filter=lfs-disabled diff=lfs merge=lfs -text
2+
3+
# assure line feeds don't interfere with our working copy hash
4+
**/tests/fixtures/**/*.sh text crlf=input eol=lf
5+
/justfile text crlf=input eol=lf
6+
7+
# have GitHub treat the gix-packetline-blocking src copy as auto-generated
8+
gix-packetline-blocking/src/ linguist-generated=true

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: byron

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Report undesirable behaviour 🐛
2+
description: Create an issue to help us improve
3+
body:
4+
- type: markdown
5+
attributes:
6+
value: Thanks for contributing by creating an issue! ❤️
7+
- type: textarea
8+
attributes:
9+
label: Current behavior 😯
10+
description: Describe what happens instead of the expected behavior.
11+
- type: textarea
12+
attributes:
13+
label: Expected behavior 🤔
14+
description: Describe what should happen.
15+
- type: textarea
16+
attributes:
17+
label: Git behavior
18+
description: Describe what Git does under similar circumstances.
19+
- type: textarea
20+
attributes:
21+
label: Steps to reproduce 🕹
22+
description: Describe how we can reproduce the behaviour.
23+
placeholder: |
24+
1.
25+
2.
26+
3. …
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Feature request 💄
2+
description: Suggest an improvement
3+
labels: ["enhancement"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: Thanks for contributing by creating an issue! ❤️
8+
- type: textarea
9+
attributes:
10+
label: Summary 💡
11+
description: Describe how it should work.
12+
- type: textarea
13+
attributes:
14+
label: Motivation 🔦
15+
description: >
16+
What are you trying to accomplish?
17+
How has the lack of this feature affected you?
18+
Are there other tools or libraries already showing how (_parts of_) it should work?

.github/dependabot.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: "/"
5+
schedule:
6+
interval: weekly
7+
groups:
8+
github-actions:
9+
patterns: ["*"]
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: cargo
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
time: "21:00"
8+
open-pull-requests-limit: 10

.github/pull_request_template.md

Whitespace-only changes.

.github/workflows/ci.yml

Lines changed: 248 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,248 @@
1+
name: ci
2+
3+
env:
4+
CARGO_TERM_COLOR: always
5+
CLICOLOR: 1
6+
7+
on:
8+
push:
9+
branches:
10+
- main
11+
- 'run-ci/**'
12+
- '**/run-ci/**'
13+
tags-ignore:
14+
- '*'
15+
paths:
16+
- '.github/**'
17+
- 'ci/**'
18+
- 'etc/**'
19+
- 'src/**'
20+
- 'tests/**'
21+
- 'cargo-*/**'
22+
- 'gix*/**'
23+
- '*.toml'
24+
- Makefile
25+
pull_request:
26+
branches:
27+
- main
28+
paths:
29+
- '.github/**'
30+
- 'ci/**'
31+
- 'etc/**'
32+
- 'src/**'
33+
- 'tests/**'
34+
- 'cargo-*/**'
35+
- 'gix*/**'
36+
- '*.toml'
37+
- Makefile
38+
workflow_dispatch:
39+
40+
jobs:
41+
pure-rust-build:
42+
runs-on: ubuntu-latest
43+
container: debian:buster
44+
steps:
45+
- uses: actions/checkout@v4
46+
- name: Prerequisites
47+
run: apt-get update && apt-get install --no-install-recommends -y ca-certificates curl gcc libc-dev # gcc is required as OS abstraction
48+
- name: install Rust via Rustup
49+
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal;
50+
- uses: Swatinem/rust-cache@v2
51+
- run: /github/home/.cargo/bin/cargo install --debug --locked --no-default-features --features max-pure --path .
52+
53+
test:
54+
runs-on: ubuntu-latest
55+
steps:
56+
- uses: actions/checkout@v4
57+
- uses: dtolnay/rust-toolchain@stable
58+
- uses: Swatinem/rust-cache@v2
59+
- name: Setup dependencies
60+
run:
61+
sudo apt-get install tree
62+
- uses: extractions/setup-just@v2
63+
- name: test
64+
env:
65+
CI: true
66+
GIX_TEST_IGNORE_ARCHIVES: 1
67+
run: just ci-test
68+
69+
test-fast:
70+
strategy:
71+
matrix:
72+
os:
73+
- windows-latest
74+
- macos-latest
75+
- ubuntu-latest
76+
runs-on: ${{ matrix.os }}
77+
steps:
78+
- uses: actions/checkout@v4
79+
- uses: dtolnay/rust-toolchain@stable
80+
- uses: Swatinem/rust-cache@v2
81+
- name: Setup dependencies (macos)
82+
if: startsWith(matrix.os, 'macos')
83+
run:
84+
brew install tree openssl gnu-sed
85+
- name: "cargo check default features"
86+
if: startsWith(matrix.os, 'windows')
87+
run: cargo check --all --bins --examples
88+
- uses: taiki-e/install-action@v2
89+
with:
90+
tool: nextest
91+
- name: "Test (nextest)"
92+
run: cargo nextest run --all --no-fail-fast
93+
94+
test-32bit:
95+
runs-on: ubuntu-latest
96+
strategy:
97+
matrix:
98+
target: [ armv7-linux-androideabi ]
99+
steps:
100+
- uses: actions/checkout@v4
101+
- uses: dtolnay/rust-toolchain@stable
102+
- uses: Swatinem/rust-cache@v2
103+
- name: Install Rust
104+
uses: dtolnay/rust-toolchain@master
105+
with:
106+
toolchain: stable
107+
targets: ${{ matrix.target }}
108+
- uses: taiki-e/install-action@v2
109+
with:
110+
tool: cross
111+
- name: "check"
112+
run: cross check -p gix --target ${{ matrix.target }}
113+
- name: "Test (unit)"
114+
# run high-level unit tests that exercise a lot of code while being pure Rust to ease building test binaries.
115+
# TODO: figure out why `git` doesn't pick up environment configuration so build scripts fail when using `-p gix`.
116+
run: cross test -p gix-hashtable --target ${{ matrix.target }}
117+
118+
installation:
119+
strategy:
120+
matrix:
121+
build: [ win-msvc, win-gnu, win32-msvc, win32-gnu ]
122+
include:
123+
- build: win-msvc
124+
os: windows-latest
125+
rust: stable
126+
target: x86_64-pc-windows-msvc
127+
- build: win-gnu
128+
os: windows-latest
129+
rust: stable-x86_64-gnu
130+
target: x86_64-pc-windows-gnu
131+
- build: win32-msvc
132+
os: windows-latest
133+
rust: stable
134+
target: i686-pc-windows-msvc
135+
- build: win32-gnu
136+
os: windows-latest
137+
rust: stable
138+
target: i686-pc-windows-gnu
139+
runs-on: ${{ matrix.os }}
140+
steps:
141+
- uses: actions/checkout@v4
142+
- name: Install Rust
143+
uses: dtolnay/rust-toolchain@master
144+
with:
145+
toolchain: ${{ matrix.rust }}
146+
targets: ${{ matrix.target }}
147+
- uses: Swatinem/rust-cache@v2
148+
- uses: msys2/setup-msys2@v2
149+
with:
150+
msystem: MINGW${{ startsWith(matrix.target, 'i686-') && '32' || '64' }}
151+
pacboy: cc:p
152+
path-type: inherit
153+
- name: "Install prerequisites"
154+
run: vcpkg install zlib:x64-windows-static-md
155+
- name: "Installation from crates.io: gitoxide"
156+
run: cargo +${{ matrix.rust }} install --target ${{ matrix.target }} --no-default-features --features max-pure --target-dir install-artifacts --debug --force gitoxide
157+
shell: msys2 {0}
158+
159+
lint:
160+
runs-on: ubuntu-latest
161+
steps:
162+
- uses: actions/checkout@v4
163+
- uses: dtolnay/rust-toolchain@master
164+
with:
165+
toolchain: stable
166+
components: clippy,rustfmt
167+
- uses: extractions/setup-just@v2
168+
- name: Run cargo clippy
169+
run: just clippy -D warnings -A unknown-lints
170+
- name: Run cargo doc
171+
run: just doc
172+
- name: Run cargo fmt
173+
run: cargo fmt --all -- --check
174+
- name: Run cargo diet
175+
run: |
176+
curl -LSfs https://raw.githubusercontent.com/the-lean-crate/cargo-diet/master/ci/install.sh | \
177+
sh -s -- --git the-lean-crate/cargo-diet --target x86_64-unknown-linux-musl --tag v1.2.4
178+
179+
# Let's not fail CI for this, it will fail locally often enough, and a crate a little bigger
180+
# than allows is no problem either if it comes to that.
181+
just check-size || true
182+
183+
cargo-deny:
184+
runs-on: ubuntu-latest
185+
strategy:
186+
matrix:
187+
checks:
188+
- advisories
189+
- bans licenses sources
190+
191+
# Prevent sudden announcement of a new advisory from failing ci:
192+
continue-on-error: ${{ matrix.checks == 'advisories' }}
193+
194+
steps:
195+
- uses: actions/checkout@v4
196+
- uses: EmbarkStudios/cargo-deny-action@v2
197+
with:
198+
command: check ${{ matrix.checks }}
199+
200+
wasm:
201+
name: WebAssembly
202+
runs-on: ubuntu-latest
203+
continue-on-error: true
204+
strategy:
205+
matrix:
206+
target: [ wasm32-unknown-unknown, wasm32-wasi ]
207+
steps:
208+
- uses: actions/checkout@master
209+
- name: Install Rust
210+
run: rustup update stable && rustup default stable && rustup target add ${{ matrix.target }}
211+
- uses: Swatinem/rust-cache@v2
212+
- run: set +x; for name in gix-actor gix-attributes gix-bitmap gix-chunk gix-command gix-commitgraph gix-date gix-glob gix-hash gix-hashtable gix-mailmap gix-object gix-packetline gix-path gix-quote gix-refspec gix-revision gix-traverse gix-validate; do (cd $name && cargo build --target ${{ matrix.target }}); done
213+
name: crates without feature toggles
214+
- run: set +x; for feature in progress fs-walkdir-parallel parallel io-pipe crc32 zlib zlib-rust-backend fast-sha1 rustsha1 cache-efficiency-debug; do (cd gix-features && cargo build --features $feature --target ${{ matrix.target }}); done
215+
name: features of gix-features
216+
- run: set +x; for name in gix-pack; do (cd $name && cargo build --features wasm --target ${{ matrix.target }}); done
217+
name: crates with 'wasm' feature
218+
- run: cd gix-pack && cargo build --all-features --target ${{ matrix.target }}
219+
name: gix-pack with all features (including wasm)
220+
221+
check-packetline:
222+
strategy:
223+
fail-fast: false
224+
matrix:
225+
os:
226+
- ubuntu-latest
227+
# We consider this script read-only and its effect is the same everywhere.
228+
# However, when changes are made to `etc/copy-packetline.sh`, re-enable the other platforms for testing.
229+
# - macos-latest
230+
# - windows-latest
231+
runs-on: ${{ matrix.os }}
232+
defaults:
233+
run:
234+
shell: bash
235+
steps:
236+
- uses: actions/checkout@v4
237+
- name: Check that working tree is initially clean
238+
run: |
239+
set -x
240+
git status
241+
git diff --exit-code
242+
- name: Regenerate gix-packetline-blocking/src
243+
run: etc/copy-packetline.sh
244+
- name: Check that gix-packetline-blocking/src was already up to date
245+
run: |
246+
set -x
247+
git status
248+
git diff --exit-code

0 commit comments

Comments
 (0)