Skip to content

consecutive negotiation #855

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 12 commits into from
May 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
30 changes: 23 additions & 7 deletions Cargo.lock

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

7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ repository = "https://github.com/Byron/gitoxide"
authors = ["Sebastian Thiel <[email protected]>"]
edition = "2021"
license = "MIT OR Apache-2.0"
version = "0.25.0"
version = "0.26.0"
default-run = "gix"
include = ["src/**/*", "LICENSE-*", "README.md", "CHANGELOG.md"]
resolver = "2"
Expand Down Expand Up @@ -151,9 +151,9 @@ gitoxide-core-async-client = ["gitoxide-core/async-client", "futures-lite"]
[dependencies]
anyhow = "1.0.42"

gitoxide-core = { version = "^0.27.0", path = "gitoxide-core" }
gitoxide-core = { version = "^0.28.0", path = "gitoxide-core" }
gix-features = { version = "^0.29.0", path = "gix-features" }
gix = { version = "^0.44.1", path = "gix", default-features = false }
gix = { version = "^0.45.0", path = "gix", default-features = false }
time = "0.3.19"

clap = { version = "4.1.1", features = ["derive", "cargo"] }
Expand Down Expand Up @@ -221,6 +221,7 @@ members = [
"gix-packetline",
"gix-mailmap",
"gix-note",
"gix-negotiate",
"gix-fetchhead",
"gix-prompt",
"gix-filter",
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ is usable to some extent.
* [gix-hashtable](https://github.com/Byron/gitoxide/blob/main/crate-status.md#gix-hashtable)
* [gix-worktree](https://github.com/Byron/gitoxide/blob/main/crate-status.md#gix-worktree)
* [gix-bitmap](https://github.com/Byron/gitoxide/blob/main/crate-status.md#gix-bitmap)
* [gix-negotiate](https://github.com/Byron/gitoxide/blob/main/crate-status.md#gix-negotiate)
* `gitoxide-core`
* **very early** _(possibly without any documentation and many rough edges)_
* [gix-date](https://github.com/Byron/gitoxide/blob/main/crate-status.md#gix-date)
Expand Down
4 changes: 2 additions & 2 deletions cargo-smart-release/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cargo-smart-release"
version = "0.19.0"
version = "0.20.0"
authors = ["Sebastian Thiel <[email protected]>"]
repository = "https://github.com/Byron/gitoxide"
description = "Cargo subcommand for fearlessly releasing crates in workspaces."
Expand All @@ -25,7 +25,7 @@ cache-efficiency-debug = ["gix/cache-efficiency-debug"]
vendored-openssl = ["crates-index/vendored-openssl"]

[dependencies]
gix = { version = "^0.44.1", path = "../gix", default-features = false, features = ["max-performance-safe"] }
gix = { version = "^0.45.0", path = "../gix", default-features = false, features = ["max-performance-safe"] }
anyhow = "1.0.42"
clap = { version = "4.1.0", features = ["derive", "cargo"] }
env_logger = { version = "0.10.0", default-features = false, features = ["humantime", "auto-color"] }
Expand Down
6 changes: 6 additions & 0 deletions crate-status.md
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,12 @@ A mechanism to associate metadata with any object, and keep revisions of it usin

* [ ] CRUD for git notes

### gix-negotiate
* **algorithms**
- [ ] `noop`
- [ ] `consecutive`
- [ ] `skipping`

### gix-fetchhead
* [ ] parse `FETCH_HEAD` information back entirely
* [ ] write typical fetch-head lines
Expand Down
4 changes: 2 additions & 2 deletions gitoxide-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "gitoxide-core"
description = "The library implementing all capabilities of the gitoxide CLI"
repository = "https://github.com/Byron/gitoxide"
version = "0.27.0"
version = "0.28.0"
authors = ["Sebastian Thiel <[email protected]>"]
license = "MIT/Apache-2.0"
edition = "2021"
Expand Down Expand Up @@ -38,7 +38,7 @@ serde = ["gix/serde", "serde_json", "dep:serde", "bytesize/serde"]

[dependencies]
# deselect everything else (like "performance") as this should be controllable by the parent application.
gix = { version = "^0.44.1", path = "../gix", default-features = false }
gix = { version = "^0.45.0", path = "../gix", default-features = false }
gix-pack-for-configuration-only = { package = "gix-pack", version = "^0.35.0", path = "../gix-pack", default-features = false, features = ["pack-cache-lru-dynamic", "pack-cache-lru-static"] }
gix-transport-configuration-only = { package = "gix-transport", version = "^0.31.0", path = "../gix-transport", default-features = false }
serde = { version = "1.0.114", optional = true, default-features = false, features = ["derive"] }
Expand Down
39 changes: 37 additions & 2 deletions gix-commitgraph/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,40 @@ 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.15.0 (2023-05-19)

### New Features (BREAKING)

- <csr-id-ed258da9015d2d68734aeac485dd009760fc4da4/> `describe` usees commitgraph.
With it it can leverage the commitgraph data structure would would be more prominent
on server-side applications, presumably.

### Refactor (BREAKING)

- <csr-id-967f3b954e9fb4fc7757f8920998173caf0491ab/> make API more consistent with other `gix-*` crates.
For that, we remove duplicate import paths for types.
We also improve lifetimes around parent iteration, and make the type explicit.

### Commit Statistics

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

- 2 commits contributed to the release over the course of 1 calendar day.
- 21 days passed between releases.
- 2 commits were understood as [conventional](https://www.conventionalcommits.org).
- 0 issues like '(#ID)' were seen in commit messages

### Commit Details

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

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

* **Uncategorized**
- `describe` usees commitgraph. ([`ed258da`](https://github.com/Byron/gitoxide/commit/ed258da9015d2d68734aeac485dd009760fc4da4))
- Make API more consistent with other `gix-*` crates. ([`967f3b9`](https://github.com/Byron/gitoxide/commit/967f3b954e9fb4fc7757f8920998173caf0491ab))
</details>

## 0.14.0 (2023-04-27)

### New Features (BREAKING)
Expand All @@ -21,8 +55,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

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

- 9 commits contributed to the release over the course of 56 calendar days.
- 60 days passed between releases.
- 10 commits contributed to the release over the course of 57 calendar days.
- 61 days passed between releases.
- 1 commit was understood as [conventional](https://www.conventionalcommits.org).
- 1 unique issue was worked on: [#814](https://github.com/Byron/gitoxide/issues/814)

Expand All @@ -35,6 +69,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* **[#814](https://github.com/Byron/gitoxide/issues/814)**
- Rename `serde1` cargo feature to `serde` and use the weak-deps cargo capability. ([`b83ee36`](https://github.com/Byron/gitoxide/commit/b83ee366a3c65c717beb587ad809268f1c54b8ad))
* **Uncategorized**
- Release gix-commitgraph v0.14.0, gitoxide-core v0.26.0, gitoxide v0.24.0 ([`9f2317f`](https://github.com/Byron/gitoxide/commit/9f2317f2514872001168d2be6e33e2ee2872420e))
- Release gix-hash v0.11.1, gix-path v0.7.4, gix-glob v0.6.0, gix-attributes v0.11.0, gix-config-value v0.11.0, gix-fs v0.1.1, gix-tempfile v5.0.3, gix-utils v0.1.1, gix-lock v5.0.1, gix-object v0.29.1, gix-ref v0.28.0, gix-sec v0.7.0, gix-config v0.21.0, gix-prompt v0.4.0, gix-url v0.17.0, gix-credentials v0.13.0, gix-diff v0.29.0, gix-discover v0.17.0, gix-hashtable v0.2.0, gix-ignore v0.1.0, gix-bitmap v0.2.3, gix-traverse v0.25.0, gix-index v0.16.0, gix-mailmap v0.12.0, gix-pack v0.34.0, gix-odb v0.44.0, gix-packetline v0.16.0, gix-transport v0.30.0, gix-protocol v0.31.0, gix-revision v0.13.0, gix-refspec v0.10.0, gix-worktree v0.16.0, gix v0.44.0, safety bump 7 crates ([`91134a1`](https://github.com/Byron/gitoxide/commit/91134a11c8ba0e942f692488ec9bce9fa1086324))
- Release gix-utils v0.1.0, gix-hash v0.11.0, gix-date v0.5.0, gix-features v0.29.0, gix-actor v0.20.0, gix-object v0.29.0, gix-archive v0.1.0, gix-fs v0.1.0, safety bump 25 crates ([`8dbd0a6`](https://github.com/Byron/gitoxide/commit/8dbd0a60557a85acfa231800a058cbac0271a8cf))
- Merge branch 'main' into dev ([`cdef398`](https://github.com/Byron/gitoxide/commit/cdef398c4a3bd01baf0be2c27a3f77a400172b0d))
Expand Down
2 changes: 1 addition & 1 deletion gix-commitgraph/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "gix-commitgraph"
version = "0.14.0"
version = "0.15.0"
repository = "https://github.com/Byron/gitoxide"
documentation = "https://git-scm.com/docs/commit-graph#:~:text=The%20commit-graph%20file%20is%20a%20supplemental%20data%20structure,or%20in%20the%20info%20directory%20of%20an%20alternate."
license = "MIT/Apache-2.0"
Expand Down
7 changes: 7 additions & 0 deletions gix-commitgraph/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![deny(missing_docs, rust_2018_idioms, unsafe_code)]

use std::path::Path;

/// A single commit-graph file.
///
/// All operations on a `File` are local to that graph file. Since a commit graph can span multiple
Expand All @@ -41,6 +43,11 @@ pub struct Graph {
files: Vec<File>,
}

/// Instantiate a commit graph from an `.git/objects/info` directory, or one of the various commit-graph files.
pub fn at(path: impl AsRef<Path>) -> Result<Graph, init::Error> {
Graph::at(path)
}

mod access;
pub mod file;
///
Expand Down
4 changes: 2 additions & 2 deletions gix-commitgraph/tests/access/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fn octupus_merges() -> crate::Result {
"four_parents",
],
);
let cg = Graph::from_info_dir(repo_dir.join(".git").join("objects").join("info"))?;
let cg = Graph::at(repo_dir.join(".git").join("objects").join("info"))?;
check_common(&cg, &refs);

assert_eq!(cg.commit_at(refs["root"].pos()).generation(), 1);
Expand All @@ -48,7 +48,7 @@ fn octupus_merges() -> crate::Result {
fn single_commit() -> crate::Result {
let repo_dir = make_readonly_repo("single_commit.sh");
let refs = inspect_refs(&repo_dir, &["commit"]);
let cg = Graph::from_info_dir(repo_dir.join(".git").join("objects").join("info"))?;
let cg = gix_commitgraph::at(repo_dir.join(".git").join("objects").join("info"))?;
check_common(&cg, &refs);

assert_eq!(cg.commit_at(refs["commit"].pos()).generation(), 1);
Expand Down
29 changes: 29 additions & 0 deletions gix-negotiate/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# 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).

## v0.1.0 (2023-05-19)

Initial release with a single function to calculate the window size for `HAVE` lines.

### Commit Statistics

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

- 1 commit contributed to the release.
- 0 commits were understood as [conventional](https://www.conventionalcommits.org).
- 0 issues like '(#ID)' were seen in commit messages

### Commit Details

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

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

* **Uncategorized**
- Add new crate for implementing and testing git negotiation logic. ([`372ba09`](https://github.com/Byron/gitoxide/commit/372ba09bb00e3fab674f0251f697aab11c5559f8))
</details>

27 changes: 27 additions & 0 deletions gix-negotiate/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[package]
name = "gix-negotiate"
version = "0.1.0"
repository = "https://github.com/Byron/gitoxide"
license = "MIT/Apache-2.0"
description = "A crate of the gitoxide project implementing negotiation algorithms"
authors = ["Sebastian Thiel <[email protected]>"]
edition = "2021"
rust-version = "1.64"

[lib]
doctest = false
test = false

[dependencies]
gix-hash = { version = "^0.11.1", path = "../gix-hash" }
gix-object = { version = "^0.29.2", path = "../gix-object" }
gix-commitgraph = { version = "^0.15.0", path = "../gix-commitgraph" }
gix-revision = { version = "^0.14.0", path = "../gix-revision" }
thiserror = "1.0.40"
smallvec = "1.10.0"
bitflags = "2"

[dev-dependencies]
gix-testtools = { path = "../tests/tools" }
gix-odb = { path = "../gix-odb" }
gix-ref = { path = "../gix-ref" }
Loading