Skip to content

Changes needed to use gitoxide for radicle-link test setup #190

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 91 commits into from
Sep 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
6d0bedd
[actor #190] methods to get an actor signature at the current time
Byron Aug 31, 2021
1927be7
[repository #190] Make local-offset available on demand only…
Byron Aug 31, 2021
3a7d379
[various #190] rename 'local-offset' to 'local-time-support'
Byron Aug 31, 2021
7c559d6
[repository #190] A way to write objects and the empty tree specifically
Byron Sep 1, 2021
1e029b4
[repository #190] refactor
Byron Sep 1, 2021
26a6637
[repository #190] put git-lock into ST1…
Byron Sep 1, 2021
78bacf9
[object #190] More conversion methods for Object
Byron Sep 1, 2021
3f36a01
[ref #190] refactor
Byron Sep 1, 2021
507d710
[features #190] be more explicit about why sha1-asm is disabled
Byron Sep 2, 2021
c5de433
[object #190] consistent method naming
Byron Sep 2, 2021
63bedc7
[refs #190] refactor; handle value-checks in dereffed symlinks correctly
Byron Sep 2, 2021
bfcf8f1
[repository #190] first version of 'commit(…)' without reflog message…
Byron Sep 2, 2021
0763ac2
[repository #190] thanks clippy
Byron Sep 2, 2021
43f7568
[repository #190] commit::summary()
Byron Sep 2, 2021
e7a8b62
[repository #190] produce nice reflog messages
Byron Sep 2, 2021
4ec631c
[repository #190] another commit() test…
Byron Sep 2, 2021
e4abcf3
allow incremental builds…
Byron Sep 2, 2021
06b9270
[repository #190] show that unconditional creation of references does…
Byron Sep 3, 2021
9741987
[ref #190] prepare massive refactoring to get additional constraint
Byron Sep 3, 2021
1a4786f
[ref #190] Allow for explicit expected previous values
Byron Sep 3, 2021
07126d6
[ref #190] refactor
Byron Sep 3, 2021
68f7fc2
[ref #190] don't claim there was a previous oid unnecessarily…
Byron Sep 3, 2021
c04c8b9
[ref #190] be explicit about what the previous reflog oid is for…
Byron Sep 3, 2021
0e65559
[ref #190] refactor
Byron Sep 3, 2021
74f85b1
[ref #190] deletions also use PreviousValue now
Byron Sep 3, 2021
980e16a
[ref #190] more tests
Byron Sep 3, 2021
8634341
[ref #190] introduce Raw reference type that simplifies everything…
Byron Sep 3, 2021
d6bef3a
[repository #190] refactor
Byron Sep 3, 2021
9473a71
[ref #190] raw reference peeling
Byron Sep 3, 2021
7aeea9c
[ref #190] Use Raw Reference everywhere for great simplification…
Byron Sep 3, 2021
14dff63
thanks clippy
Byron Sep 3, 2021
df21f25
[ref #190] fix remaining tests
Byron Sep 3, 2021
c55ce4d
[repository #190] experiment with 'HEAD' API…
Byron Sep 3, 2021
ac4413c
Bump git-ref v0.7.0
Byron Sep 3, 2021
3e64ec1
[ref #190] fix docs
Byron Sep 3, 2021
2cb511e
[ref #190] cache peeled objects properly
Byron Sep 3, 2021
43ac4f5
[repository #190] a major step forward with `head()` access
Byron Sep 4, 2021
15d4ac8
[repository #190] refactor
Byron Sep 4, 2021
376c045
thanks clippy
Byron Sep 4, 2021
0b635e9
[ref #190] Move file-log-specific functionality into own extension tr…
Byron Sep 4, 2021
60fc215
[ref #190] move remaining file store functions to extension trait
Byron Sep 4, 2021
4a36ded
[ref #190] First working sketch of reverse log iter access
Byron Sep 4, 2021
641edde
[repository #190] reflog tests
Byron Sep 4, 2021
998c7c6
[ref #190] check for zero sized buffers in reverse log iterators…
Byron Sep 4, 2021
946bbf1
[repository #190] ref log for HEAD specifically
Byron Sep 4, 2021
2de86f9
[ref #190] reverse reflog ergonomics
Byron Sep 4, 2021
023dedc
thanks clippy
Byron Sep 4, 2021
49fe1dc
[ref #190] refactor
Byron Sep 4, 2021
e751688
[repository #190] refactor
Byron Sep 4, 2021
c3e240d
[ref #190] add forward log iter and localize iter types…
Byron Sep 4, 2021
28afd8e
[repository #190] shortcut to create references
Byron Sep 4, 2021
7a111b1
[repository #190] refactor
Byron Sep 5, 2021
1fe1b42
[ref #190] more Target conversions…
Byron Sep 5, 2021
e34be7e
[ref #190] refactor
Byron Sep 5, 2021
a985491
[repository #190] obtain the kind fo hash used in a repo
Byron Sep 5, 2021
6efd90d
Bump git-hash v0.6.0
Byron Sep 5, 2021
427f146
[repository #190] prepare reference iteration
Byron Sep 5, 2021
8c532a4
[repository #190] refactor
Byron Sep 5, 2021
2c0939a
[repository #190] implementation of reference iteration (all() for now)…
Byron Sep 5, 2021
a6e19c9
[repository #190] prefixed reference iteration
Byron Sep 5, 2021
1795a33
[ref #190] more conversion trait impls
Byron Sep 5, 2021
e4411ff
[repository #190] cleanup usage of bstr…
Byron Sep 5, 2021
3b7ffde
[repository #190] public bstr re-export
Byron Sep 5, 2021
3d8796e
[repository #190] turns out we need bstr with unicode support
Byron Sep 5, 2021
16b2232
[ref #190] Make References sortable
Byron Sep 5, 2021
0b0fea4
[#190] faster builds with debug=false and dependency caching
Byron Sep 5, 2021
a22c95b
[#190] run tests faster (at the cost of compile time)
Byron Sep 6, 2021
d14f073
[repository #190] transparent namespace support
Byron Sep 6, 2021
f58a0ff
[ref #190] more assetions to understand 'find(…)' for namespaced refs…
Byron Sep 6, 2021
d335731
[repository #190] note a known limitation about finding references in…
Byron Sep 6, 2021
f5e118c
[repository #190] fix build
Byron Sep 6, 2021
1ef6cb3
[ref #190] refactor
Byron Sep 6, 2021
609c249
[repository #190] refactor
Byron Sep 6, 2021
d2d1db6
[repository #190] prepare for namespacing support on file store level
Byron Sep 6, 2021
0660a6f
[#190] disable caching to see if this fixes windows
Byron Sep 6, 2021
3c7968c
[ref #190] refactor
Byron Sep 6, 2021
d5987d4
[ref #190] iteration with namespace support
Byron Sep 6, 2021
1aa9c11
[repository #190] leverage git-ref namespace support
Byron Sep 6, 2021
5fcd0e4
[ref #190] prepare test for namespaced find(…)
Byron Sep 6, 2021
1240c21
[ref #190] find() with namespace support
Byron Sep 6, 2021
c663da1
[ref #190] don't provide namespace support for loose and packed refs…
Byron Sep 6, 2021
e5a5c09
[repository #190] fix tests; needs inbound transaction handling…
Byron Sep 6, 2021
e426e15
[ref #190] fix tests
Byron Sep 6, 2021
010be48
[ref #190] refactor
Byron Sep 6, 2021
e7188e0
[repository #190] refactor
Byron Sep 6, 2021
85f1a48
[repository #190] first shot at ancestor iteration…
Byron Sep 6, 2021
f4d1ec4
[repository #190] access to repository directories
Byron Sep 6, 2021
e5e3c80
Bump git-pack v0.10.0
Byron Sep 6, 2021
6da3599
[repository #190] fix build, lets just make traversal available by de…
Byron Sep 6, 2021
fdc3678
[repository #190] test for oid.ancestors().all()
Byron Sep 6, 2021
ab250f7
[odb #190] Read all eligble packed refs, no "pack-" prefix needed
Byron Sep 7, 2021
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
3 changes: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
[profile.dev]
debug = false

[build]
rustflags = "--cfg unsound_local_offset -C target-cpu=native"
4 changes: 3 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# - uses: Swatinem/rust-cache@v1 - todo: figure out why windows doesn't seem to get its own caches, maybe?
- name: clippy
run: cargo clippy --all
- name: fmt
Expand Down Expand Up @@ -44,6 +45,7 @@ jobs:
profile: default
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v1
- name: "Check default features build on windows"
uses: actions-rs/cargo@v1
with:
Expand Down Expand Up @@ -75,4 +77,4 @@ jobs:
- uses: actions/checkout@v2
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check ${{ matrix.checks }}
command: check ${{ matrix.checks }}
9 changes: 5 additions & 4 deletions Cargo.lock

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

14 changes: 12 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ pretty-cli = ["clap",
"prodash/local-time",
"prodash-render-tui",
"prodash-render-line",
"gitoxide-core/local-time-support",
"env_logger",
"futures-lite"]
lean-cli = ["argh", "prodash/progress-log", "env_logger" ]
Expand Down Expand Up @@ -79,8 +80,17 @@ env_logger = { version = "0.9.0", optional = true, default-features = false, fea
crosstermion = { version = "0.8.0", optional = true, default-features = false }
futures-lite = { version = "1.12.0", optional = true, default-features = false, features = ["std"] }

[profile.dev]
incremental = false
# toml_edit can't parse this :(
#[profile.dev.package]
#git-object.opt-level = 3
#git-ref.opt-level = 3
#git-pack.opt-level = 3
#git-hash.opt-level = 3
#git-actor.opt-level = 3
#git-config.opt-level = 3
#miniz_oxide.opt-level = 3
#sha-1.opt-level = 3
#sha1.opt-level = 3

[profile.release]
overflow-checks = false
Expand Down
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,12 @@ check: ## Build all code in suitable configurations
cargo check --no-default-features --features lean-termion
cargo check --no-default-features --features max
cargo check --no-default-features --features max-termion
cd git-actor && cargo check
cd git-actor && cargo check \
&& cargo check --features local-time-support
cd gitoxide-core && cargo check \
&& cargo check --features blocking-client \
&& cargo check --features async-client
&& cargo check --features async-client \
&& cargo check --features local-time-support
cd gitoxide-core && if cargo check --all-features 2>/dev/null; then false; else true; fi
cd git-hash && cargo check --all-features \
&& cargo check
Expand All @@ -110,6 +112,7 @@ check: ## Build all code in suitable configurations
&& cargo check --features rustsha1 \
&& cargo check --features fast-sha1 \
&& cargo check --features progress \
&& cargo check --features time \
&& cargo check --features io-pipe \
&& cargo check --features crc32 \
&& cargo check --features zlib \
Expand All @@ -131,6 +134,7 @@ check: ## Build all code in suitable configurations
cd git-repository && cargo check --all-features \
&& cargo check --no-default-features --features local \
&& cargo check --no-default-features --features network \
&& cargo check --no-default-features --features one-stop-shop \
&& cargo check --no-default-features
cd cargo-smart-release && cargo check
cd experiments/object-access && cargo check
Expand Down
26 changes: 15 additions & 11 deletions STABILITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ Please note that this guide isn't stable itself and may be adjusted to fit chang

## Terminology

* _dependent crate_
- _dependent crate_
- A crate which depends on a crate in this workspace directly.
* _downstream crate_
- _downstream crate_
- A crate which directly or indirectly depends on a crate in this workspace.
* _workspace crate_
- _workspace crate_
- A crate which is a member of this workspace and hence is stored in this repository
* _breaking change_
- _breaking change_
- A change in code that requires a `dependent crate` to adjust their code to fix compile errors.
* _release_
- _release_
- A new version of a crate is published to crates.io
* _development version_
- _development version_
- A crate version whose _major_ version is 0.
* _release version_
- _release version_
- A crate version whose _major_ version is 1 or higher.

## Tiers
Expand Down Expand Up @@ -56,9 +56,13 @@ The following schematic helps to visualize what follows.
║ │ ┌─────────────┐ ┌─────────────┐ │ ║
║ │ │ git-ref │ │ git-config │ │ ║ │
║ │ └─────────────┘ └─────────────┘ │ ║
║ └───────────────────────────────────┘ ║ │
║ ║
╚═════════════════════════════════════════════╝ │
║ │ ┌─────────────┐ ┌─────────────┐ │ ║ │
║ │ │ git-object │ │ git-lock │ │ ║
║ │ └─────────────┘ └─────────────┘ │ ║ │
║ └───────────────────────────────────┘ ║
║ ║ │
╚═════════════════════════════════════════════╝
Stability Tier 2 ─────────────────────────────┐
│ │ │
│ Plumbing Crates─────────────────────┐ │
Expand Down Expand Up @@ -95,7 +99,7 @@ If there are additional breaking changes without a release, these push back the

### Tier 1: released apps and application crates

Released apps and application crates are marked with major version number 1 or above, like `2.3.0+21.06` and live in tier 1 _(->ST1)_,
Released apps and application crates are marked with major version number 1 or above, like `2.3.0+21.06` and live in tier 1 _(->ST1)_,
with the build identifiers for year (`21`) and and month `06` appended, based on the actual release year and month.

Breaking changes are collected and may be released no more often than every 6 months by incrementing the major version number. If there are additional breaking changes,
Expand Down
9 changes: 9 additions & 0 deletions cargo-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ The library powering the command-line interface.
- **async-client**
- The client to connect to git servers will be async, while supporting only the 'git' transport itself. It's the most limited and can be seen as example
on how to use custom transports for custom servers.
* **local-time-support**
- Functions dealing with time may include the local timezone offset, not just UTC with the offset being zero.

[skim]: https://github.com/lotabout/skim
[git-hours]: https://github.com/kimmobrunfeldt/git-hours
Expand All @@ -83,6 +85,11 @@ The library powering the command-line interface.
for the LRU-cache itself low.
* **pack-cache-lru-dynamic**
* Provide a hash-map based LRU cache whose eviction is based a memory cap calculated from object data.

### git-actor

* **local-time-support**
- Make `Signature` initializers using the local time (with UTC offset) available.

### git-features

Expand Down Expand Up @@ -185,6 +192,8 @@ be selected.
* **unstable**
- Re-export stability tier 2 crates for convenience and make `Repository` struct fields with types from these crates publicly accessible.
- Doing so is less stable than the stability tier 1 that `git-repository` is a member of.
* **local-time-support**
- Functions dealing with time may include the local timezone offset, not just UTC with the offset being zero.

The following toggles can be used to reduce dependencies.

Expand Down
17 changes: 7 additions & 10 deletions cargo-smart-release/src/command/release/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use cargo_metadata::{
camino::{Utf8Component, Utf8Path},
Package,
};
use git_repository::{easy::object, prelude::ReferenceAccessExt, refs};
use git_repository::{easy::object, prelude::ReferenceAccessExt, refs, refs::transaction::PreviousValue};

use super::{tag_name_for, utils::will, Context, Oid, Options};

Expand Down Expand Up @@ -46,8 +46,8 @@ pub(in crate::command::release_impl) fn has_changed_since_last_release(
.strip_prefix(&ctx.root)
.expect("workspace members are releative to the root directory");

let current_commit = ctx.git_easy.find_reference("HEAD")?.peel_to_oid_in_place()?;
let released_target = tag_ref.peel_to_oid_in_place()?;
let current_commit = ctx.git_easy.find_reference("HEAD")?.peel_to_id_in_place()?;
let released_target = tag_ref.peel_to_id_in_place()?;

if repo_relative_crate_dir.as_os_str().is_empty() {
Ok(current_commit != released_target)
Expand Down Expand Up @@ -126,7 +126,7 @@ pub(in crate::command::release_impl) fn commit_changes(
if !cmd.status()?.success() {
bail!("Failed to commit changed manifests");
}
Ok(Some(ctx.git_easy.find_reference("HEAD")?.peel_to_oid_in_place()?))
Ok(Some(ctx.git_easy.find_reference("HEAD")?.peel_to_id_in_place()?))
}

pub(in crate::command::release_impl) fn create_version_tag<'repo>(
Expand Down Expand Up @@ -155,12 +155,9 @@ pub(in crate::command::release_impl) fn create_version_tag<'repo>(
}
Ok(Some(format!("refs/tags/{}", tag_name).try_into()?))
} else {
let edits = ctx.git_easy.tag(
tag_name,
commit_id.expect("set in --execute mode"),
git_lock::acquire::Fail::Immediately,
false,
)?;
let edits = ctx
.git_easy
.tag(tag_name, commit_id.expect("set in --execute mode"), PreviousValue::Any)?;
assert_eq!(edits.len(), 1, "We create only one tag and there is no expansion");
let tag = edits.into_iter().next().expect("the promised tag");
log::info!("Created tag {}", tag.name.as_bstr());
Expand Down
1 change: 1 addition & 0 deletions crate-status.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ See its [README.md](https://github.com/Byron/gitoxide/blob/main/git-lock/README.

### git-repository
* [x] utilities for applications to make long running operations interruptible gracefully and to support timeouts in servers.
* [ ] handle `core.repositoryFormatVersion` and extensions
* [x] discovery
* [ ] option to not cross file systems
* [ ] handle git-common-dir
Expand Down
4 changes: 2 additions & 2 deletions etc/check-package-size.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function indent () {
}

echo "in root: gitoxide CLI"
indent cargo diet -n --package-size-limit 25KB
#indent cargo diet -n --package-size-limit 25KB - fails right now because of dotted profile.dev.package
(enter cargo-smart-release && indent cargo diet -n --package-size-limit 15KB)
(enter git-actor && indent cargo diet -n --package-size-limit 5KB)
(enter git-tempfile && indent cargo diet -n --package-size-limit 20KB)
Expand All @@ -34,6 +34,6 @@ indent cargo diet -n --package-size-limit 25KB
(enter git-odb && indent cargo diet -n --package-size-limit 15KB)
(enter git-protocol && indent cargo diet -n --package-size-limit 25KB)
(enter git-packetline && indent cargo diet -n --package-size-limit 15KB)
(enter git-repository && indent cargo diet -n --package-size-limit 30KB)
(enter git-repository && indent cargo diet -n --package-size-limit 35KB)
(enter git-transport && indent cargo diet -n --package-size-limit 30KB)
(enter gitoxide-core && indent cargo diet -n --package-size-limit 20KB)
Binary file modified etc/crate-structure.monopic
Binary file not shown.
6 changes: 3 additions & 3 deletions experiments/diffing/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use git_repository::{
objs::{bstr::BStr, TreeRefIter},
odb,
prelude::*,
refs::file::loose::reference::peel,
refs::{file::ReferenceExt, peel},
};
use rayon::prelude::*;

Expand Down Expand Up @@ -255,7 +255,7 @@ where
where
L: for<'a> FnMut(&oid, &'a mut Vec<u8>) -> Option<odb::data::Object<'a>>,
{
find(id, buf).and_then(|o| o.into_tree_iter())
find(id, buf).and_then(|o| o.try_into_tree_iter())
}

fn tree_iter_by_commit<'b, L>(id: &oid, buf: &'b mut Vec<u8>, mut find: L) -> TreeRefIter<'b>
Expand All @@ -264,7 +264,7 @@ where
{
let tid = find(id, buf)
.expect("commit present")
.into_commit_iter()
.try_into_commit_iter()
.expect("a commit")
.tree_id()
.expect("tree id present and decodable");
Expand Down
6 changes: 3 additions & 3 deletions experiments/traversal/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use git_repository::{
objs::{bstr::BStr, tree::EntryRef},
odb,
prelude::*,
refs::file::loose::reference::peel,
refs::{file::ReferenceExt, peel},
traverse::{tree, tree::visit::Action},
};

Expand Down Expand Up @@ -209,13 +209,13 @@ where
for commit in commits {
let tree_id = db
.try_find(commit, &mut buf, &mut cache)?
.and_then(|o| o.into_commit_iter().and_then(|mut c| c.tree_id()))
.and_then(|o| o.try_into_commit_iter().and_then(|mut c| c.tree_id()))
.expect("commit as starting point");

let mut count = Count { entries: 0, seen };
db.find_tree_iter(tree_id, &mut buf2, &mut cache)?.traverse(
&mut state,
|oid, buf| db.find(oid, buf, &mut cache).ok().and_then(|o| o.into_tree_iter()),
|oid, buf| db.find(oid, buf, &mut cache).ok().and_then(|o| o.try_into_tree_iter()),
&mut count,
)?;
entries += count.entries as u64;
Expand Down
2 changes: 2 additions & 0 deletions git-actor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ doctest = false

[features]
serde1 = ["serde", "bstr/serde1"]
local-time-support = ["git-features/time"]

[package.metadata.docs.rs]
all-features = true

[dependencies]
git-features = { version = "^0.16.0", path = "../git-features", optional = true }
quick-error = "2.0.0"
btoi = "0.4.2"
bstr = { version = "0.2.13", default-features = false, features = ["std"]}
Expand Down
Loading