Skip to content

Use gitoxide for robust diffing #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 37 commits into from
Aug 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
9a5f312
a script to create an index fixture (#16)
Byron Aug 27, 2022
ecd84eb
refactor (#16)
Byron Aug 27, 2022
07f4b6c
change!: move `CloneOptions` into `index` module. (#16)
Byron Aug 27, 2022
946ca4c
re-enable and fix doc-tests (#16)
Byron Aug 27, 2022
78e05bd
refactor (#16)
Byron Aug 27, 2022
0c77e40
refactor (#16)
Byron Aug 27, 2022
7e85688
also add commit-message information (#16)
Byron Aug 27, 2022
d28591b
build git repository from parts (#16)
Byron Aug 27, 2022
9a2ce43
add support for git-lfs to support archives (#16)
Byron Aug 27, 2022
f9e31f2
first test can instantiate an `Index` on the new fixture (#16)
Byron Aug 27, 2022
0efccd4
fix fixture script (#16)
Byron Aug 27, 2022
c0295c5
simplify CI.yml (#16)
Byron Aug 27, 2022
365bcf0
first successful test for addition (#16)
Byron Aug 27, 2022
56bfad7
add more tests for typical operations (#16)
Byron Aug 27, 2022
877b519
normalization test (#16)
Byron Aug 27, 2022
ebacafd
thanks clippy (#16)
Byron Aug 27, 2022
6dadfb7
use most recent git version of gitoxide for now (#16)
Byron Aug 27, 2022
aeb6f45
refactor (#16)
Byron Aug 27, 2022
61e217a
test for peek changes (#16)
Byron Aug 28, 2022
45494f0
remove redundant tests (#16)
Byron Aug 28, 2022
8a1bc25
test for auto-clone (#16)
Byron Aug 28, 2022
272bec8
port all old tests to the new fixture (#16)
Byron Aug 28, 2022
2d3a182
change!: Use `gitoxide` `Repository` instead of `git2::Repository` (#16)
Byron Aug 28, 2022
fa9cfab
refactor (#16)
Byron Aug 28, 2022
cd86f5b
frame for diffing (#16)
Byron Aug 28, 2022
55d71dc
first sketch of addition is working (#16)
Byron Aug 28, 2022
eadc65f
handle entire crate deletions as well (#16)
Byron Aug 28, 2022
3416414
handle modifications and yanks (#16)
Byron Aug 28, 2022
9ba7921
all diff-tests pass like before (#16)
Byron Aug 28, 2022
7cee17e
refactor (#16)
Byron Aug 28, 2022
3749220
refactor (#16)
Byron Aug 28, 2022
371b512
remove git2 verion of the diff algorithm (#16)
Byron Aug 28, 2022
68ff142
adapt to changes in git-repository (#16)
Byron Aug 28, 2022
ae3f971
first stab at normalization can reduce 245 version, but… (#16)
Byron Aug 28, 2022
eb148e5
and normalization works now (#16)
Byron Aug 28, 2022
9e9b972
thanks clippy
Byron Aug 28, 2022
23e14af
update to latest release of `gitoxide` (#16)
Byron Aug 28, 2022
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
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
**/generated-archives/*.tar.xz filter=lfs diff=lfs merge=lfs -text

# assure line feeds don't interfere with our working copy hash
**/tests/fixtures/*.sh text crlf=input eol=lf

2 changes: 2 additions & 0 deletions .github/workflows/rust.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: Swatinem/rust-cache@v2
- run: git lfs fetch && git lfs checkout
- name: tests
run: make test
- name: docs
Expand Down
8 changes: 7 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,21 @@ edition = "2018"
readme = "changelog.md"
include = ["src/**/*", "LICENSE.md", "README.md", "CHANGELOG.md"]

[lib]
test = false

[dependencies]
git-repository = "0.23.0"
similar = { version = "2.2.0", features = ["bytes"] }
serde = { version = "1", features = ["std", "derive"] }
serde_json = "1"
thiserror = "1.0.32"

[dependencies.git2]
version = "0.14.0"
default-features = false
features = ["https"]

[dev-dependencies]
git-testtools = "0.8.0"
tempdir = "0.3.5"
serial_test = "0.6.0"
14 changes: 4 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,12 @@ help: ## Display this help


CARGO = $(shell command -v cargo)
bare_index_path = tests/fixtures/index-bare

$(bare_index_path):
mkdir -p $(dir $@)
git clone --bare https://github.com/rust-lang/crates.io-index $@


##@ Development

test: $(bare_index_path) ## run all tests with cargo
RUST_BACKTRACE=1 CRATES_INDEX_DIFF_TEST_EXISTING_INDEX=$(bare_index_path) cargo test --jobs 1
test: ## run all tests with cargo
RUST_BACKTRACE=1 cargo test --jobs 1

quick-test: $(bare_index_path) ## run all fast tests with cargo (those which dont clone themselves
CRATES_INDEX_DIFF_TEST_EXISTING_INDEX=$(bare_index_path) cargo test --jobs 1 quick
quick-test: ## run all fast tests with cargo (those which dont clone themselves
cargo test --jobs 1 quick

326 changes: 0 additions & 326 deletions src/index.rs

This file was deleted.

Loading