Skip to content
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
6 changes: 3 additions & 3 deletions Cargo.lock

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

13 changes: 11 additions & 2 deletions cargo-smart-release/src/command/release/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ use super::{
pub(in crate::command::release_impl) fn edit_version_and_fixup_dependent_crates<'repo>(
meta: &Metadata,
publishees: &[(&Package, String)],
Options { verbose, dry_run, .. }: Options,
Options {
verbose,
dry_run,
skip_publish,
..
}: Options,
ctx: &'repo Context,
) -> anyhow::Result<Option<Oid<'repo>>> {
let mut locks_by_manifest_path = BTreeMap::new();
Expand Down Expand Up @@ -72,7 +77,11 @@ pub(in crate::command::release_impl) fn edit_version_and_fixup_dependent_crates<
set_version_and_update_package_dependency(package_to_update, None, publishees, &mut lock, verbose)?;
}

let message = format!("Release {}", names_and_versions(publishees));
let message = format!(
"{} {}",
if skip_publish { "Bump" } else { "Release" },
names_and_versions(publishees)
);
if verbose {
log::info!("{} persist changes to manifests with: {:?}", will(dry_run), message);
}
Expand Down
2 changes: 1 addition & 1 deletion git-diff/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "git-diff"
version = "0.8.2"
version = "0.9.0"
repository = "https://github.com/Byron/gitoxide"
license = "MIT/Apache-2.0"
description = "Calculate differences between various git objects"
Expand Down
4 changes: 2 additions & 2 deletions git-pack/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ all-features = true
git-features = { version = "^0.16.0", path = "../git-features", features = ["crc32", "rustsha1", "progress", "zlib"] }
git-hash = { version = "^0.5.0", path = "../git-hash" }
git-object = { version ="^0.13.0", path = "../git-object" }
git-traverse = { version ="0.7.0", path = "../git-traverse" }
git-diff = { version ="0.8.0", path = "../git-diff" }
git-traverse = { version ="^0.8.0", path = "../git-traverse" }
git-diff = { version ="^0.9.0", path = "../git-diff" }
git-tempfile = { version ="^1.0.0", path = "../git-tempfile" }

smallvec = "1.3.0"
Expand Down
16 changes: 16 additions & 0 deletions git-packetline/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
### 0.10.0 (2021-08-??)

#### Breaking

* **renames / moves**
- `immutable::PacketLine` -> `PacketLineRef`
- `immutable::Error` -> `ErrorRef`
- `immutable::Text` -> `TextRef`
- `immutable::Band` -> `BandRef`
- `immutable::DecodeBandError` -> `decode::band::Error`
- `pub immutable::` -> `line::`
- `pub write::` -> `write::`

* **removals**
- `write::Writer` (is now only `Writer`)
- `read::StreamingPeekableIter` (is now only `StreamingPeekableIter`)
4 changes: 2 additions & 2 deletions git-packetline/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "git-packetline"
version = "0.9.1"
version = "0.10.0"
repository = "https://github.com/Byron/gitoxide"
license = "MIT/Apache-2.0"
description = "A WIP crate of the gitoxide project implementing the pkt-line serialization format"
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
edition = "2018"
include = ["src/**/*"]
include = ["src/**/*", "CHANGELOG.md"]

[lib]
doctest = false
Expand Down
36 changes: 27 additions & 9 deletions git-packetline/src/decode.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use bstr::BString;
use quick_error::quick_error;

use crate::{PacketLine, DELIMITER_LINE, FLUSH_LINE, MAX_DATA_LEN, MAX_LINE_LEN, RESPONSE_END_LINE, U16_HEX_BYTES};
use crate::{PacketLineRef, DELIMITER_LINE, FLUSH_LINE, MAX_DATA_LEN, MAX_LINE_LEN, RESPONSE_END_LINE, U16_HEX_BYTES};

quick_error! {
/// The error used in the [`decode`][crate::decode] module
Expand Down Expand Up @@ -29,13 +29,31 @@ quick_error! {
}
}

///
pub mod band {
use quick_error::quick_error;
quick_error! {
/// The error used in [`PacketLineRef::decode_band()`].
#[derive(Debug)]
#[allow(missing_docs)]
pub enum Error {
InvalidSideBand(band: u8) {
display("attempt to decode a non-side channel line or input was malformed: {}", band)
}
NonDataLine {
display("attempt to decode a non-data line into a side-channel band")
}
}
}
}

/// A utility return type to support incremental parsing of packet lines.
#[derive(Debug, Clone)]
pub enum Stream<'a> {
/// Indicate a single packet line was parsed completely
Complete {
/// The parsed packet line
line: PacketLine<'a>,
line: PacketLineRef<'a>,
/// The amount of bytes consumed from input
bytes_consumed: usize,
},
Expand All @@ -49,7 +67,7 @@ pub enum Stream<'a> {
/// The result of [`hex_prefix()`] indicating either a special packet line or the amount of wanted bytes
pub enum PacketLineOrWantedSize<'a> {
/// The special kind of packet line decoded from the hex prefix. It never contains actual data.
Line(PacketLine<'a>),
Line(PacketLineRef<'a>),
/// The amount of bytes indicated by the hex prefix of the packet line.
Wanted(u16),
}
Expand All @@ -58,9 +76,9 @@ pub enum PacketLineOrWantedSize<'a> {
pub fn hex_prefix(four_bytes: &[u8]) -> Result<PacketLineOrWantedSize<'_>, Error> {
debug_assert_eq!(four_bytes.len(), 4, "need four hex bytes");
for (line_bytes, line_type) in &[
(FLUSH_LINE, PacketLine::Flush),
(DELIMITER_LINE, PacketLine::Delimiter),
(RESPONSE_END_LINE, PacketLine::ResponseEnd),
(FLUSH_LINE, PacketLineRef::Flush),
(DELIMITER_LINE, PacketLineRef::Delimiter),
(RESPONSE_END_LINE, PacketLineRef::ResponseEnd),
] {
if four_bytes == *line_bytes {
return Ok(PacketLineOrWantedSize::Line(*line_type));
Expand All @@ -85,12 +103,12 @@ pub fn hex_prefix(four_bytes: &[u8]) -> Result<PacketLineOrWantedSize<'_>, Error
}

/// Obtain a `PacketLine` from `data` after assuring `data` is small enough to fit.
pub fn to_data_line(data: &[u8]) -> Result<PacketLine<'_>, Error> {
pub fn to_data_line(data: &[u8]) -> Result<PacketLineRef<'_>, Error> {
if data.len() > MAX_LINE_LEN {
return Err(Error::DataLengthLimitExceeded(data.len()));
}

Ok(PacketLine::Data(data))
Ok(PacketLineRef::Data(data))
}

/// Decode `data` as packet line while reporting whether the data is complete or not using a [`Stream`].
Expand Down Expand Up @@ -129,7 +147,7 @@ pub fn streaming(data: &[u8]) -> Result<Stream<'_>, Error> {
///
/// Note that failure also happens if there is not enough data to parse a complete packet line, as opposed to [`streaming()`] decoding
/// succeeds in that case, stating how much more bytes are required.
pub fn all_at_once(data: &[u8]) -> Result<PacketLine<'_>, Error> {
pub fn all_at_once(data: &[u8]) -> Result<PacketLineRef<'_>, Error> {
match streaming(data)? {
Stream::Complete { line, .. } => Ok(line),
Stream::Incomplete { bytes_needed } => Err(Error::NotEnoughData(bytes_needed)),
Expand Down
139 changes: 0 additions & 139 deletions git-packetline/src/immutable/mod.rs

This file was deleted.

Loading