Skip to content

Parse refspecs #474

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 36 commits into from
Aug 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
871a3c0
empty `git-refspec` crate for name reservation prior to implementatio…
Byron Aug 5, 2022
3383408
prepare git-refspec changelog prior to release (#450)
Byron Aug 5, 2022
d406689
Release git-refspec v0.0.0
Byron Aug 5, 2022
362bd46
all baseline test cases from git's test-suite (#450)
Byron Aug 5, 2022
5c823dc
sketch data structure that should do the trick (#450)
Byron Aug 5, 2022
b9a4bdc
frame for basic parsing (#450)
Byron Aug 5, 2022
9c5fed2
first few bits of error handling in parser (#450)
Byron Aug 5, 2022
5e4ee9b
run the baseline test and gather some information (#450)
Byron Aug 6, 2022
0ba1b73
sketch all possible instructions of fetch and push refspecs (#450)
Byron Aug 6, 2022
6713793
refactor (#450)
Byron Aug 6, 2022
3f264af
sort out how expectations can be expressed in test suite (#450)
Byron Aug 6, 2022
6e5bd5c
first successful test for returning a refspec. (#450)
Byron Aug 6, 2022
701d46f
add include directive (#450)
Byron Aug 6, 2022
966a9e9
support for deletion (#450)
Byron Aug 6, 2022
7afebb7
handle colon and empty on the right side (#450)
Byron Aug 6, 2022
e4227d6
basic validation and detection of patterns (#450)
Byron Aug 6, 2022
c99f575
Better handling of special cases (#450)
Byron Aug 6, 2022
c4499ce
tests for handling exclusions (#450)
Byron Aug 6, 2022
c23a21d
tests causing all instrucitons (#450)
Byron Aug 6, 2022
e8c072e
refactor (#450)
Byron Aug 6, 2022
d7c2789
handle ref-name validation mostly correctly (#450)
Byron Aug 6, 2022
3fa52f8
and the entire test-suite passes (#450)
Byron Aug 6, 2022
b62ee56
thanks clippy
Byron Aug 6, 2022
32d98e9
support for `@` shortcut. (#450)
Byron Aug 7, 2022
79e0eaf
negative must not be empty (#450)
Byron Aug 7, 2022
b889953
don't allow object hashes in excludes (#450)
Byron Aug 7, 2022
9c280b2
disallow excludes in push mode (#450)
Byron Aug 7, 2022
57a6e69
more detailed tests of what's allowed and where (#450)
Byron Aug 7, 2022
bb992ac
more push-spec restrictions (#450)
Byron Aug 7, 2022
62d721a
Add fuzz target (#450)
Byron Aug 7, 2022
febf070
add fuzz target and basic docs on how to run it (#450)
Byron Aug 7, 2022
c695a7e
improve docs (#450)
Byron Aug 7, 2022
6278966
don't expose mode() as it's kind of messy and should be left as imple…
Byron Aug 7, 2022
f0163c9
cleanup crate structure (#450)
Byron Aug 7, 2022
894538b
update crate status (#450)
Byron Aug 7, 2022
6c963b0
thanks clippy
Byron Aug 7, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ members = [
"git-lock",
"git-attributes",
"git-pathspec",
"git-refspec",
"git-path",
"git-repository",
"gitoxide-core",
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ is usable to some extend.
* [git-repository](https://github.com/Byron/gitoxide/blob/main/crate-status.md#git-repository)
* [git-attributes](https://github.com/Byron/gitoxide/blob/main/crate-status.md#git-attributes)
* [git-pathspec](https://github.com/Byron/gitoxide/blob/main/crate-status.md#git-pathspec)
* [git-refspec](https://github.com/Byron/gitoxide/blob/main/crate-status.md#git-refspec)
* `gitoxide-core`
* **very early** _(possibly without any documentation and many rough edges)_
* [git-index](https://github.com/Byron/gitoxide/blob/main/crate-status.md#git-index)
Expand Down
6 changes: 5 additions & 1 deletion crate-status.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,11 @@ Check out the [performance discussion][git-traverse-performance] as well.

### git-pathspec
* [x] parse
* [ ] check for match
* [ ] matching of paths

### git-refspec
* [x] parse
* [ ] matching of references and object names

### git-note

Expand Down
1 change: 1 addition & 0 deletions etc/check-package-size.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ echo "in root: gitoxide CLI"
(enter cargo-smart-release && indent cargo diet -n --package-size-limit 95KB)
(enter git-actor && indent cargo diet -n --package-size-limit 5KB)
(enter git-pathspec && indent cargo diet -n --package-size-limit 25KB)
(enter git-refspec && indent cargo diet -n --package-size-limit 15KB)
(enter git-path && indent cargo diet -n --package-size-limit 15KB)
(enter git-attributes && indent cargo diet -n --package-size-limit 15KB)
(enter git-discover && indent cargo diet -n --package-size-limit 20KB)
Expand Down
30 changes: 30 additions & 0 deletions git-refspec/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.0.0 (2022-08-05)

Initial release for name reservation.

### Commit Statistics

<csr-read-only-do-not-edit/>

- 2 commits contributed to the release.
- 0 commits where understood as [conventional](https://www.conventionalcommits.org).
- 1 unique issue was worked on: [#450](https://github.com/Byron/gitoxide/issues/450)

### Commit Details

<csr-read-only-do-not-edit/>

<details><summary>view details</summary>

* **[#450](https://github.com/Byron/gitoxide/issues/450)**
- prepare git-refspec changelog prior to release ([`3383408`](https://github.com/Byron/gitoxide/commit/3383408ce22ca9c7502ad2d1fab51cf12dc5ee72))
- empty `git-refspec` crate for name reservation prior to implementation ([`871a3c0`](https://github.com/Byron/gitoxide/commit/871a3c054d4fe6c1e92b6f2e260b19463404509f))
</details>

26 changes: 26 additions & 0 deletions git-refspec/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[package]
name = "git-refspec"
version = "0.0.0"
repository = "https://github.com/Byron/gitoxide"
license = "MIT/Apache-2.0"
description = "A WIP crate of the gitoxide project for parsing and representing refspecs"
authors = ["Sebastian Thiel <[email protected]>"]
edition = "2018"
include = ["src/**/*", "CHANGELOG.md", "README.md"]

[lib]
doctest = false

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
git-revision = { version = "^0.3.0", path = "../git-revision" }
git-validate = { version = "^0.5.4", path = "../git-validate" }
git-hash = { version = "^0.9.6", path = "../git-hash" }

bstr = { version = "0.2.13", default-features = false, features = ["std"]}
thiserror = "1.0.26"
smallvec = "1.9.0"

[dev-dependencies]
git-testtools = { path = "../tests/tools" }
11 changes: 11 additions & 0 deletions git-refspec/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# `git-refspec`

### Testing

#### Fuzzing

`cargo fuzz` is used for fuzzing, installable with `cargo install cargo-fuzz`.

Targets can be listed with `cargo fuzz list` and executed via `cargo +nightly fuzz run <target>`,
where `<target>` can be `parse` for example.

3 changes: 3 additions & 0 deletions git-refspec/fuzz/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
target
corpus
artifacts
Loading