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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ All notable changes to this project will be documented in this file.
- trino-cli: Add version 470 ([#999]).
- trino-storage-connector: Add version 470 ([#999]).
- superset: Add version `4.1.1` ([#991]).
- Add Patchable patch management tool ([#1003]).
- Add Patchable patch management tool ([#1003], [#1007]).
- nifi: Add 1.28.1, 2.2.0 ([#1006]).

### Changed
Expand Down Expand Up @@ -77,6 +77,7 @@ All notable changes to this project will be documented in this file.
[#1000]: https://github.com/stackabletech/docker-images/pull/1000
[#1003]: https://github.com/stackabletech/docker-images/pull/1003
[#1006]: https://github.com/stackabletech/docker-images/pull/1006
[#1007]: https://github.com/stackabletech/docker-images/pull/1007

## [24.11.1] - 2025-01-14

Expand Down
198 changes: 198 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 @@ -11,4 +11,5 @@ tempfile = "3.16.0"
time = { version = "0.3.37", features = ["parsing"] }
toml = "0.8.19"
tracing = "0.1.41"
tracing-indicatif = "0.3.9"
tracing-subscriber = { version = "0.3.19", features = ["env-filter"] }
1 change: 1 addition & 0 deletions rust/patchable/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ tempfile.workspace = true
time.workspace = true
toml.workspace = true
tracing.workspace = true
tracing-indicatif.workspace = true
tracing-subscriber.workspace = true
4 changes: 4 additions & 0 deletions rust/patchable/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use std::{
use git2::{Oid, Repository};
use serde::{Deserialize, Serialize};
use snafu::{OptionExt, ResultExt as _, Snafu};
use tracing_indicatif::IndicatifLayer;
use tracing_subscriber::{layer::SubscriberExt as _, util::SubscriberInitExt as _};

#[derive(clap::Parser)]
Expand Down Expand Up @@ -109,6 +110,8 @@ struct Opts {
}

#[derive(clap::Parser)]
// CLI parameters are documented for the CLI's `--help`, not for rustdoc
#[allow(rustdoc::bare_urls, rustdoc::invalid_html_tags)]
enum Cmd {
/// Check out a patched source tree to docker-images/<PRODUCT>/patchable-work/worktree/<VERSION>
///
Expand Down Expand Up @@ -221,6 +224,7 @@ type Result<T, E = Error> = std::result::Result<T, E>;
fn main() -> Result<()> {
tracing_subscriber::registry()
.with(tracing_subscriber::fmt::layer().with_writer(std::io::stderr))
.with(IndicatifLayer::new())
.with(
tracing_subscriber::EnvFilter::builder()
.with_default_directive(tracing_subscriber::filter::LevelFilter::INFO.into())
Expand Down
30 changes: 18 additions & 12 deletions rust/patchable/src/patch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ use std::{

use git2::{Oid, Repository};
use snafu::{OptionExt, ResultExt as _, Snafu};
use tracing_indicatif::suspend_tracing_indicatif;

use crate::{
error::{self, CommitId},
patch_mail::{self, mailinfo, mailsplit},
utils::raw_git_cmd,
};

#[cfg(doc)]
use crate::repo::ensure_worktree_is_at;

#[derive(Debug, Snafu)]
pub enum Error {
#[snafu(display("failed to open stgit series file {path:?}"))]
Expand Down Expand Up @@ -342,18 +346,20 @@ pub fn format_patches(
}

tracing::info!("exporting commits since base");
let status = raw_git_cmd(repo)
.arg("format-patch")
.arg(format!("{base_commit}..{leaf_commit}"))
.arg("-o")
.arg(patch_dir)
.args([
"--keep-subject",
// By default, git includes its own version number as a suffix, which makes patches unstable across git versions
"--no-signature",
])
.status()
.context(RunFormatMailSnafu)?;
let status = suspend_tracing_indicatif(|| {
raw_git_cmd(repo)
.arg("format-patch")
.arg(format!("{base_commit}..{leaf_commit}"))
.arg("-o")
.arg(patch_dir)
.args([
"--keep-subject",
// By default, git includes its own version number as a suffix, which makes patches unstable across git versions
"--no-signature",
])
.status()
})
.context(RunFormatMailSnafu)?;
if !status.success() {
return FormatMailFailedSnafu { status }.fail();
}
Expand Down
Loading
Loading