Compare commits

...

5 Commits

Author SHA1 Message Date
dependabot[bot]
66e5ccf2af
Merge bf940404f3 into c384eed937 2024-09-16 15:55:39 +04:00
dvermd
c384eed937 Do not double panic in FakeParentArgs::drop
Signed-off-by: dvermd <315743+dvermd@users.noreply.github.com>
2024-09-15 10:42:35 +02:00
Dan Davison
7dd279284b Update release Makefile 2024-09-11 08:51:11 -04:00
Dan Davison
9b80e68904 Link to new binaries 2024-09-11 08:49:53 -04:00
dependabot[bot]
bf940404f3
Bump ctrlc from 3.4.2 to 3.4.5
Bumps [ctrlc](https://github.com/Detegr/rust-ctrlc) from 3.4.2 to 3.4.5.
- [Release notes](https://github.com/Detegr/rust-ctrlc/releases)
- [Commits](https://github.com/Detegr/rust-ctrlc/compare/3.4.2...3.4.5)

---
updated-dependencies:
- dependency-name: ctrlc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-14 06:32:26 +00:00
5 changed files with 102 additions and 56 deletions

83
Cargo.lock generated
View File

@ -236,6 +236,12 @@ version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "cfg_aliases"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
[[package]]
name = "chrono"
version = "0.4.31"
@ -366,12 +372,12 @@ dependencies = [
[[package]]
name = "ctrlc"
version = "3.4.2"
version = "3.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b467862cc8610ca6fc9a1532d7777cee0804e678ab45410897b9396495994a0b"
checksum = "90eeab0aa92f3f9b4e87f258c72b139c207d251f9cbc1080a0086b86a8870dd3"
dependencies = [
"nix",
"windows-sys 0.52.0",
"windows-sys 0.59.0",
]
[[package]]
@ -878,12 +884,13 @@ dependencies = [
[[package]]
name = "nix"
version = "0.27.1"
version = "0.29.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053"
checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46"
dependencies = [
"bitflags 2.4.1",
"cfg-if",
"cfg_aliases",
"libc",
]
@ -1708,7 +1715,7 @@ version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
dependencies = [
"windows-targets 0.52.0",
"windows-targets 0.52.6",
]
[[package]]
@ -1735,7 +1742,16 @@ version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
dependencies = [
"windows-targets 0.52.0",
"windows-targets 0.52.6",
]
[[package]]
name = "windows-sys"
version = "0.59.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
dependencies = [
"windows-targets 0.52.6",
]
[[package]]
@ -1770,17 +1786,18 @@ dependencies = [
[[package]]
name = "windows-targets"
version = "0.52.0"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd"
checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
dependencies = [
"windows_aarch64_gnullvm 0.52.0",
"windows_aarch64_msvc 0.52.0",
"windows_i686_gnu 0.52.0",
"windows_i686_msvc 0.52.0",
"windows_x86_64_gnu 0.52.0",
"windows_x86_64_gnullvm 0.52.0",
"windows_x86_64_msvc 0.52.0",
"windows_aarch64_gnullvm 0.52.6",
"windows_aarch64_msvc 0.52.6",
"windows_i686_gnu 0.52.6",
"windows_i686_gnullvm",
"windows_i686_msvc 0.52.6",
"windows_x86_64_gnu 0.52.6",
"windows_x86_64_gnullvm 0.52.6",
"windows_x86_64_msvc 0.52.6",
]
[[package]]
@ -1797,9 +1814,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.52.0"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea"
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
[[package]]
name = "windows_aarch64_msvc"
@ -1815,9 +1832,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
[[package]]
name = "windows_aarch64_msvc"
version = "0.52.0"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef"
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
[[package]]
name = "windows_i686_gnu"
@ -1833,9 +1850,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
[[package]]
name = "windows_i686_gnu"
version = "0.52.0"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313"
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
[[package]]
name = "windows_i686_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
[[package]]
name = "windows_i686_msvc"
@ -1851,9 +1874,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
[[package]]
name = "windows_i686_msvc"
version = "0.52.0"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a"
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
[[package]]
name = "windows_x86_64_gnu"
@ -1869,9 +1892,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
[[package]]
name = "windows_x86_64_gnu"
version = "0.52.0"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd"
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
[[package]]
name = "windows_x86_64_gnullvm"
@ -1887,9 +1910,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.52.0"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e"
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
[[package]]
name = "windows_x86_64_msvc"
@ -1905,9 +1928,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
[[package]]
name = "windows_x86_64_msvc"
version = "0.52.0"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04"
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
[[package]]
name = "winnow"

View File

@ -37,7 +37,7 @@ clap = { version = "4.3.14", features = [
"error-context",
] }
console = "0.15.0"
ctrlc = "3.2.5"
ctrlc = "3.4.5"
dirs = "5.0.1"
git2 = { version = "0.18.2", default-features = false, features = [] }
grep-cli = "0.1.8"

View File

@ -48,10 +48,9 @@ BUMP_VERSION_IN_DOCUMENTATION_LINKS_SENTINEL=.make-sentinels/bump-version-in-doc
bump-version-in-documentation-links: $(BUMP_VERSION_IN_DOCUMENTATION_LINKS_SENTINEL)
$(BUMP_VERSION_IN_DOCUMENTATION_LINKS_SENTINEL):
sed -i -E "s,$$DELTA_OLD_VERSION,$$DELTA_NEW_VERSION,g" manual/src/full---help-output.md manual/src/installation.md
rg -qF "$$DELTA_NEW_VERSION" manual/src/full---help-output.md
rg -qF "$$DELTA_NEW_VERSION" manual/src/installation.md
git add manual/src/full---help-output.md manual/src/installation.md
git commit -m "Bump version in links to executables"
git commit -m "Link to new binaries"
touch $(BUMP_VERSION_IN_DOCUMENTATION_LINKS_SENTINEL)

View File

@ -1,13 +1,13 @@
# Installation
You can download an executable for your system:
[Linux (glibc)](https://github.com/dandavison/delta/releases/download/0.18.1/delta-0.18.1-x86_64-unknown-linux-gnu.tar.gz)
[Linux (glibc)](https://github.com/dandavison/delta/releases/download/0.18.2/delta-0.18.2-x86_64-unknown-linux-gnu.tar.gz)
|
[Linux (musl)](https://github.com/dandavison/delta/releases/download/0.18.1/delta-0.18.1-x86_64-unknown-linux-musl.tar.gz)
[Linux (musl)](https://github.com/dandavison/delta/releases/download/0.18.2/delta-0.18.2-x86_64-unknown-linux-musl.tar.gz)
|
[MacOS](https://github.com/dandavison/delta/releases/download/0.18.1/delta-0.18.1-x86_64-apple-darwin.tar.gz)
[MacOS](https://github.com/dandavison/delta/releases/download/0.18.2/delta-0.18.2-x86_64-apple-darwin.tar.gz)
|
[Windows](https://github.com/dandavison/delta/releases/download/0.18.1/delta-0.18.1-x86_64-pc-windows-msvc.zip)
[Windows](https://github.com/dandavison/delta/releases/download/0.18.2/delta-0.18.2-x86_64-pc-windows-msvc.zip)
|
[All](https://github.com/dandavison/delta/releases)

View File

@ -598,6 +598,7 @@ pub mod tests {
With(usize, Rc<Vec<T>>),
None,
Invalid,
ErrorAlreadyHandled,
}
// When calling `FakeParentArgs::get()`, it can return `Some(values)` which were set earlier
@ -648,24 +649,39 @@ pub mod tests {
TlsState::With(n, args) => TlsState::With(*n + 1, Rc::clone(args)),
TlsState::None => TlsState::None,
TlsState::Invalid => TlsState::Invalid,
TlsState::ErrorAlreadyHandled => TlsState::ErrorAlreadyHandled,
});
match old_value {
TlsState::Once(args) | TlsState::Scope(args) => Some(args),
TlsState::With(n, args) if n < args.len() => Some(args[n].clone()),
TlsState::None => None,
TlsState::Invalid | TlsState::With(_, _) => Self::error("get"),
TlsState::Invalid | TlsState::With(_, _) | TlsState::ErrorAlreadyHandled => {
Self::error("get");
None
}
}
})
}
pub fn are_set() -> bool {
FAKE_ARGS.with(|a| *a.borrow() != TlsState::None)
FAKE_ARGS.with(|a| {
*a.borrow() != TlsState::None && *a.borrow() != TlsState::ErrorAlreadyHandled
})
}
fn error(where_: &str) -> ! {
panic!(
"test logic error (in {}): wrong FakeParentArgs scope?",
where_
);
fn error(where_: &str) {
FAKE_ARGS.with(|a| {
let old_value = a.replace(TlsState::ErrorAlreadyHandled);
match old_value {
TlsState::ErrorAlreadyHandled => (),
_ => {
panic!(
"test logic error (in {}): wrong FakeParentArgs scope?",
where_
);
}
}
});
}
}
impl Drop for FakeParentArgs {
@ -680,7 +696,7 @@ pub mod tests {
}
}
TlsState::Once(_) | TlsState::None => Self::error("drop"),
TlsState::Scope(_) | TlsState::Invalid => {}
TlsState::Scope(_) | TlsState::Invalid | TlsState::ErrorAlreadyHandled => {}
}
});
}
@ -838,7 +854,7 @@ pub mod tests {
}
#[test]
#[should_panic]
#[should_panic(expected = "test logic error (in get): wrong FakeParentArgs scope?")]
fn test_process_testing_assert() {
let _args = FakeParentArgs::once("git blame do.not.panic");
assert_eq!(
@ -850,13 +866,23 @@ pub mod tests {
}
#[test]
#[should_panic]
fn test_process_testing_assert_never_used() {
#[should_panic(expected = "test logic error (in drop): wrong FakeParentArgs scope?")]
fn test_process_testing_assert_once_never_used() {
let _args = FakeParentArgs::once("never used");
}
// causes a panic while panicking, so can't test:
// let _args = FakeParentArgs::for_scope(&"never used");
// let _args = FakeParentArgs::once(&"never used");
#[test]
#[should_panic(expected = "test logic error (in once): wrong FakeParentArgs scope?")]
fn test_process_testing_assert_for_scope_never_used() {
let _args = FakeParentArgs::for_scope(&"never used");
let _args = FakeParentArgs::once(&"never used");
}
#[test]
#[should_panic(expected = "test logic error (in for_scope): wrong FakeParentArgs scope?")]
fn test_process_testing_assert_once_never_used2() {
let _args = FakeParentArgs::once(&"never used");
let _args = FakeParentArgs::for_scope(&"never used");
}
#[test]
@ -879,13 +905,13 @@ pub mod tests {
}
#[test]
#[should_panic]
#[should_panic(expected = "test logic error (in drop with): wrong FakeParentArgs scope?")]
fn test_process_testing_n_times_unused() {
let _args = FakeParentArgs::with(&["git blame once", "git blame twice"]);
}
#[test]
#[should_panic]
#[should_panic(expected = "test logic error (in drop with): wrong FakeParentArgs scope?")]
fn test_process_testing_n_times_underused() {
let _args = FakeParentArgs::with(&["git blame once", "git blame twice"]);
assert_eq!(
@ -895,15 +921,13 @@ pub mod tests {
}
#[test]
#[should_panic]
#[ignore]
#[should_panic(expected = "test logic error (in get): wrong FakeParentArgs scope?")]
fn test_process_testing_n_times_overused() {
let _args = FakeParentArgs::with(&["git blame once"]);
assert_eq!(
calling_process_cmdline(ProcInfo::new(), guess_git_blame_filename),
Some("once".into())
);
// ignored: dropping causes a panic while panicking, so can't test
calling_process_cmdline(ProcInfo::new(), guess_git_blame_filename);
}