Skip to content

Commit cdef398

Browse files
committed
Merge branch 'main' into dev
Conflicts ========= * gix-index/src/entry/mod.rs * gix-utils/src/lib.rs
2 parents 8920229 + b83ee36 commit cdef398

File tree

117 files changed

+246
-246
lines changed

Some content is hidden

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

117 files changed

+246
-246
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ fast = ["gix/max-performance", "gix/comfort"]
3333
## Use `clap` 3.0 to build the prettiest, best documented and most user-friendly CLI at the expense of binary size.
3434
## Provides a terminal user interface for detailed and exhaustive progress.
3535
## Provides a line renderer for leaner progress display, without the need for a full-blown TUI.
36-
pretty-cli = [ "gitoxide-core/serde1", "prodash/progress-tree", "prodash/progress-tree-log", "prodash/local-time", "env_logger/humantime", "env_logger/color", "env_logger/auto-color" ]
36+
pretty-cli = [ "gitoxide-core/serde", "prodash/progress-tree", "prodash/progress-tree-log", "prodash/local-time", "env_logger/humantime", "env_logger/color", "env_logger/auto-color" ]
3737

3838
## The `--verbose` flag will be powered by an interactive progress mechanism that doubles as log as well as interactive progress
3939
## that appears after a short duration.

Makefile

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,17 @@ check: ## Build all code in suitable configurations
7777
&& cargo check
7878
cd gix-object && cargo check --all-features \
7979
&& cargo check --features verbose-object-parsing-errors
80-
cd gix-index && cargo check --features serde1
81-
cd gix-credentials && cargo check --features serde1
82-
cd gix-sec && cargo check --features serde1
83-
cd gix-revision && cargo check --features serde1
84-
cd gix-attributes && cargo check --features serde1
85-
cd gix-glob && cargo check --features serde1
86-
cd gix-mailmap && cargo check --features serde1
87-
cd gix-worktree && cargo check --features serde1
88-
cd gix-actor && cargo check --features serde1
89-
cd gix-date && cargo check --features serde1
90-
cd gix-pack && cargo check --features serde1 \
80+
cd gix-index && cargo check --features serde
81+
cd gix-credentials && cargo check --features serde
82+
cd gix-sec && cargo check --features serde
83+
cd gix-revision && cargo check --features serde
84+
cd gix-attributes && cargo check --features serde
85+
cd gix-glob && cargo check --features serde
86+
cd gix-mailmap && cargo check --features serde
87+
cd gix-worktree && cargo check --features serde
88+
cd gix-actor && cargo check --features serde
89+
cd gix-date && cargo check --features serde
90+
cd gix-pack && cargo check --features serde \
9191
&& cargo check --features pack-cache-lru-static \
9292
&& cargo check --features pack-cache-lru-dynamic \
9393
&& cargo check --features object-cache-dynamic \
@@ -138,7 +138,7 @@ check: ## Build all code in suitable configurations
138138
&& cargo check --no-default-features --features max-performance-safe \
139139
&& cargo check --no-default-features --features progress-tree \
140140
&& cargo check --no-default-features
141-
cd gix-odb && cargo check --features serde1
141+
cd gix-odb && cargo check --features serde
142142
cd cargo-smart-release && cargo check --all
143143

144144
unit-tests: ## run all unit tests

gitoxide-core/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ async-client = ["gix/async-network-client-async-std", "gix-transport-configurati
3333

3434
#! ### Other
3535
## Data structures implement `serde::Serialize` and `serde::Deserialize`.
36-
serde1 = ["gix-commitgraph/serde1", "gix/serde1", "serde_json", "serde", "bytesize/serde"]
36+
serde = ["gix-commitgraph/serde", "gix/serde", "serde_json", "dep:serde", "bytesize/serde"]
3737

3838

3939
[dependencies]
@@ -73,5 +73,5 @@ rusqlite = { version = "0.29.0", optional = true, features = ["bundled"] }
7373
document-features = { version = "0.2.0", optional = true }
7474

7575
[package.metadata.docs.rs]
76-
features = ["document-features", "blocking-client", "organize", "estimate-hours", "serde1"]
76+
features = ["document-features", "blocking-client", "organize", "estimate-hours", "serde"]
7777
rustdoc-args = ["--cfg", "docsrs"]

gitoxide-core/src/commitgraph/verify.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ where
4646
.verify_integrity(noop_processor)
4747
.with_context(|| "Verification failure")?;
4848

49-
#[cfg_attr(not(feature = "serde1"), allow(clippy::single_match))]
49+
#[cfg_attr(not(feature = "serde"), allow(clippy::single_match))]
5050
match output_statistics {
5151
Some(OutputFormat::Human) => drop(print_human_output(&mut out, &stats)),
52-
#[cfg(feature = "serde1")]
52+
#[cfg(feature = "serde")]
5353
Some(OutputFormat::Json) => serde_json::to_writer_pretty(out, &stats)?,
5454
_ => {}
5555
}

gitoxide-core/src/index/entries.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub fn entries(
1010
use crate::OutputFormat::*;
1111
let file = parse_file(index_path, object_hash)?;
1212

13-
#[cfg(feature = "serde1")]
13+
#[cfg(feature = "serde")]
1414
if let Json = format {
1515
out.write_all(b"[\n")?;
1616
}
@@ -19,19 +19,19 @@ pub fn entries(
1919
while let Some(entry) = entries.next() {
2020
match format {
2121
Human => to_human(&mut out, &file, entry)?,
22-
#[cfg(feature = "serde1")]
22+
#[cfg(feature = "serde")]
2323
Json => to_json(&mut out, &file, entry, entries.peek().is_none())?,
2424
}
2525
}
2626

27-
#[cfg(feature = "serde1")]
27+
#[cfg(feature = "serde")]
2828
if let Json = format {
2929
out.write_all(b"]\n")?;
3030
}
3131
Ok(())
3232
}
3333

34-
#[cfg(feature = "serde1")]
34+
#[cfg(feature = "serde")]
3535
pub(crate) fn to_json(
3636
mut out: &mut impl std::io::Write,
3737
file: &gix::index::File,
@@ -40,7 +40,7 @@ pub(crate) fn to_json(
4040
) -> anyhow::Result<()> {
4141
use gix::bstr::ByteSlice;
4242

43-
#[cfg_attr(feature = "serde1", derive(serde::Serialize))]
43+
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
4444
struct Entry<'a> {
4545
stat: &'a gix::index::entry::Stat,
4646
hex_id: String,

gitoxide-core/src/index/information.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pub struct Options {
44
pub extension_details: bool,
55
}
66

7-
#[cfg(feature = "serde1")]
7+
#[cfg(feature = "serde")]
88
mod serde_only {
99

1010
mod ext {
@@ -153,5 +153,5 @@ mod serde_only {
153153
}
154154
}
155155
}
156-
#[cfg(feature = "serde1")]
156+
#[cfg(feature = "serde")]
157157
pub(crate) use serde_only::Collection;

gitoxide-core/src/index/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ pub fn verify(
3939
file.verify_integrity()?;
4040
file.verify_entries()?;
4141
file.verify_extensions(false, gix::index::verify::extensions::no_find)?;
42-
#[cfg_attr(not(feature = "serde1"), allow(irrefutable_let_patterns))]
42+
#[cfg_attr(not(feature = "serde"), allow(irrefutable_let_patterns))]
4343
if let crate::OutputFormat::Human = format {
4444
writeln!(out, "OK").ok();
4545
}
4646
Ok(())
4747
}
4848

49-
#[cfg_attr(not(feature = "serde1"), allow(unused_variables, unused_mut))]
49+
#[cfg_attr(not(feature = "serde"), allow(unused_variables, unused_mut))]
5050
pub fn information(
5151
index_path: impl AsRef<Path>,
5252
out: impl std::io::Write,
@@ -60,7 +60,7 @@ pub fn information(
6060
}: information::Options,
6161
) -> anyhow::Result<()> {
6262
use crate::OutputFormat::*;
63-
#[cfg(feature = "serde1")]
63+
#[cfg(feature = "serde")]
6464
if let Human = format {
6565
writeln!(err, "Defaulting to JSON printing as nothing else will be implemented.").ok();
6666
format = Json;
@@ -69,7 +69,7 @@ pub fn information(
6969
Human => {
7070
anyhow::bail!("Cannot print information using 'human' format.")
7171
}
72-
#[cfg(feature = "serde1")]
72+
#[cfg(feature = "serde")]
7373
Json => {
7474
let info = information::Collection::try_from_file(parse_file(index_path, object_hash)?, extension_details)?;
7575
serde_json::to_writer_pretty(out, &info)?;

gitoxide-core/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ use std::str::FromStr;
3535
#[derive(Debug, Eq, PartialEq, Hash, Clone, Copy)]
3636
pub enum OutputFormat {
3737
Human,
38-
#[cfg(feature = "serde1")]
38+
#[cfg(feature = "serde")]
3939
Json,
4040
}
4141

4242
impl OutputFormat {
4343
pub fn variants() -> &'static [&'static str] {
4444
&[
4545
"human",
46-
#[cfg(feature = "serde1")]
46+
#[cfg(feature = "serde")]
4747
"json",
4848
]
4949
}
@@ -56,7 +56,7 @@ impl FromStr for OutputFormat {
5656
let s_lc = s.to_ascii_lowercase();
5757
Ok(match s_lc.as_str() {
5858
"human" => OutputFormat::Human,
59-
#[cfg(feature = "serde1")]
59+
#[cfg(feature = "serde")]
6060
"json" => OutputFormat::Json,
6161
_ => return Err(format!("Invalid output format: '{}'", s)),
6262
})

gitoxide-core/src/pack/create.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ where
314314
fn print(stats: Statistics, format: OutputFormat, out: impl std::io::Write) -> anyhow::Result<()> {
315315
match format {
316316
OutputFormat::Human => human_output(stats, out).map_err(Into::into),
317-
#[cfg(feature = "serde1")]
317+
#[cfg(feature = "serde")]
318318
OutputFormat::Json => serde_json::to_writer_pretty(out, &stats).map_err(Into::into),
319319
}
320320
}
@@ -365,7 +365,7 @@ fn human_output(
365365
}
366366

367367
#[derive(Default)]
368-
#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
368+
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
369369
struct Statistics {
370370
counts: pack::data::output::count::objects::Outcome,
371371
entries: pack::data::output::entry::iter_from_counts::Outcome,

gitoxide-core/src/pack/index.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ where
121121
.with_context(|| "Failed to write pack and index")?;
122122
match format {
123123
OutputFormat::Human => drop(human_output(out, res)),
124-
#[cfg(feature = "serde1")]
124+
#[cfg(feature = "serde")]
125125
OutputFormat::Json => serde_json::to_writer_pretty(out, &res)?,
126126
};
127127
Ok(())

gitoxide-core/src/pack/multi_index.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pub fn create(
3535
Ok(())
3636
}
3737

38-
#[cfg(feature = "serde1")]
38+
#[cfg(feature = "serde")]
3939
mod info {
4040
use std::path::PathBuf;
4141

@@ -48,7 +48,7 @@ mod info {
4848
}
4949
}
5050

51-
#[cfg_attr(not(feature = "serde1"), allow(unused_variables))]
51+
#[cfg_attr(not(feature = "serde"), allow(unused_variables))]
5252
pub fn info(
5353
multi_index_path: PathBuf,
5454
format: OutputFormat,
@@ -58,7 +58,7 @@ pub fn info(
5858
if format == OutputFormat::Human {
5959
writeln!(err, "Defaulting to JSON as human format isn't implemented").ok();
6060
}
61-
#[cfg(feature = "serde1")]
61+
#[cfg(feature = "serde")]
6262
{
6363
let file = gix::odb::pack::multi_index::File::at(&multi_index_path)?;
6464
serde_json::to_writer_pretty(

gitoxide-core/src/pack/receive.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ mod async_io {
272272
#[cfg(feature = "async-client")]
273273
pub use self::async_io::receive;
274274

275-
#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
275+
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
276276
pub struct JsonBundleWriteOutcome {
277277
pub index_version: pack::index::Version,
278278
pub index_hash: String,
@@ -292,7 +292,7 @@ impl From<pack::index::write::Outcome> for JsonBundleWriteOutcome {
292292
}
293293
}
294294

295-
#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
295+
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
296296
pub struct JsonOutcome {
297297
pub index: JsonBundleWriteOutcome,
298298
pub pack_kind: pack::data::Version,
@@ -385,7 +385,7 @@ fn receive_pack_blocking<W: io::Write>(
385385

386386
match ctx.format {
387387
OutputFormat::Human => drop(print(&mut ctx.out, outcome, refs)),
388-
#[cfg(feature = "serde1")]
388+
#[cfg(feature = "serde")]
389389
OutputFormat::Json => {
390390
serde_json::to_writer_pretty(&mut ctx.out, &JsonOutcome::from_outcome_and_refs(outcome, refs))?
391391
}

gitoxide-core/src/pack/verify.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ where
174174
drop(print_statistics(&mut out, &stats));
175175
}
176176
},
177-
#[cfg(feature = "serde1")]
177+
#[cfg(feature = "serde")]
178178
Some(OutputFormat::Json) => serde_json::to_writer_pretty(out, &multi_index.index_names().iter().zip(res.pack_traverse_statistics).collect::<Vec<_>>())?,
179179
_ => {}
180180
};
@@ -189,10 +189,10 @@ where
189189
ext => return Err(anyhow!("Unknown extension {:?}, expecting 'idx' or 'pack'", ext)),
190190
};
191191
if let Some(stats) = res.1.as_ref() {
192-
#[cfg_attr(not(feature = "serde1"), allow(clippy::single_match))]
192+
#[cfg_attr(not(feature = "serde"), allow(clippy::single_match))]
193193
match output_statistics {
194194
Some(OutputFormat::Human) => drop(print_statistics(&mut out, stats)),
195-
#[cfg(feature = "serde1")]
195+
#[cfg(feature = "serde")]
196196
Some(OutputFormat::Json) => serde_json::to_writer_pretty(out, stats)?,
197197
_ => {}
198198
};

gitoxide-core/src/repository/mailmap.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
use std::io;
22

3-
#[cfg(feature = "serde1")]
3+
#[cfg(feature = "serde")]
44
use gix::mailmap::Entry;
55

66
use crate::OutputFormat;
77

8-
#[cfg(feature = "serde1")]
9-
#[cfg_attr(feature = "serde1", derive(serde::Serialize))]
8+
#[cfg(feature = "serde")]
9+
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
1010
struct JsonEntry {
1111
new_name: Option<String>,
1212
new_email: Option<String>,
1313
old_name: Option<String>,
1414
old_email: String,
1515
}
1616

17-
#[cfg(feature = "serde1")]
17+
#[cfg(feature = "serde")]
1818
impl<'a> From<Entry<'a>> for JsonEntry {
1919
fn from(v: Entry<'a>) -> Self {
2020
use gix::bstr::ByteSlice;
@@ -30,7 +30,7 @@ impl<'a> From<Entry<'a>> for JsonEntry {
3030
pub fn entries(
3131
repo: gix::Repository,
3232
format: OutputFormat,
33-
#[cfg_attr(not(feature = "serde1"), allow(unused_variables))] out: impl io::Write,
33+
#[cfg_attr(not(feature = "serde"), allow(unused_variables))] out: impl io::Write,
3434
mut err: impl io::Write,
3535
) -> anyhow::Result<()> {
3636
if format == OutputFormat::Human {
@@ -42,7 +42,7 @@ pub fn entries(
4242
writeln!(err, "Error while loading mailmap, the first error is: {}", e).ok();
4343
}
4444

45-
#[cfg(feature = "serde1")]
45+
#[cfg(feature = "serde")]
4646
serde_json::to_writer_pretty(
4747
out,
4848
&mailmap.entries().into_iter().map(JsonEntry::from).collect::<Vec<_>>(),

gitoxide-core/src/repository/odb.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use anyhow::bail;
44

55
use crate::OutputFormat;
66

7-
#[cfg_attr(not(feature = "serde1"), allow(unused_variables))]
7+
#[cfg_attr(not(feature = "serde"), allow(unused_variables))]
88
pub fn info(
99
repo: gix::Repository,
1010
format: OutputFormat,
@@ -15,7 +15,7 @@ pub fn info(
1515
writeln!(err, "Only JSON is implemented - using that instead")?;
1616
}
1717

18-
#[cfg_attr(feature = "serde1", derive(serde::Serialize))]
18+
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
1919
pub struct Statistics {
2020
pub path: std::path::PathBuf,
2121
pub object_hash: String,
@@ -33,7 +33,7 @@ pub fn info(
3333
metrics: store.metrics(),
3434
};
3535

36-
#[cfg(feature = "serde1")]
36+
#[cfg(feature = "serde")]
3737
{
3838
serde_json::to_writer_pretty(out, &stats)?;
3939
}
@@ -53,7 +53,7 @@ pub mod statistics {
5353
}
5454
}
5555

56-
#[cfg_attr(not(feature = "serde1"), allow(unused_variables))]
56+
#[cfg_attr(not(feature = "serde"), allow(unused_variables))]
5757
pub fn statistics(
5858
repo: gix::Repository,
5959
mut progress: impl gix::Progress,
@@ -73,7 +73,7 @@ pub fn statistics(
7373
let counter = progress.counter();
7474
let start = std::time::Instant::now();
7575

76-
#[cfg_attr(feature = "serde1", derive(serde::Serialize))]
76+
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
7777
#[derive(Default)]
7878
struct Statistics {
7979
total_objects: usize,
@@ -195,7 +195,7 @@ pub fn statistics(
195195

196196
progress.show_throughput(start);
197197

198-
#[cfg(feature = "serde1")]
198+
#[cfg(feature = "serde")]
199199
{
200200
serde_json::to_writer_pretty(out, &stats)?;
201201
}

0 commit comments

Comments
 (0)