Why Nostr? What is Njump?
2024-07-03 00:49:25

npub1cy…uvxtu on Nostr: commit 27f086bd57d5028eba6110afc2355788d5d3d658 Author: randymcmillan ...

commit 27f086bd57d5028eba6110afc2355788d5d3d658
Author: randymcmillan <[email protected]>
Date: Tue May 14 18:38:28 2024 -0400

tui/vendor/git-version:part of gnostr monorepo

diff --git a/tui/vendor/git-version/COPYING b/tui/vendor/git-version/COPYING
new file mode 100644
index 000000000..97d76ca28
--- /dev/null
+++ b/tui/vendor/git-version/COPYING
@@ -0,0 +1,22 @@
+Copyright (c) 2017-2020
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/tui/vendor/git-version/Cargo.lock b/tui/vendor/git-version/Cargo.lock
new file mode 100644
index 000000000..699e10b6d
--- /dev/null
+++ b/tui/vendor/git-version/Cargo.lock
@@ -0,0 +1,277 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+version = 3
+
+[[package]]
+name = "assert2"
+version = "0.3.11"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "eaf98d1183406dcb8f8b545e1f24829d75c1a9d35eec4b86309a22aa8b6d8e95"
+dependencies = [
+ "assert2-macros",
+ "is-terminal",
+ "yansi",
+]
+
+[[package]]
+name = "assert2-macros"
+version = "0.3.11"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "6c55bdf3e6f792f8f1c750bb6886b7ca40fa5a354ddb7a4dee550b93985a9235"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "rustc_version",
+ "syn 1.0.109",
+]
+
+[[package]]
+name = "bitflags"
+version = "1.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
+
+[[package]]
+name = "bitflags"
+version = "2.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf"
+
+[[package]]
+name = "cfg-if"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
+
+[[package]]
+name = "errno"
+version = "0.3.8"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245"
+dependencies = [
+ "libc",
+ "windows-sys",
+]
+
+[[package]]
+name = "fastrand"
+version = "2.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5"
+
+[[package]]
+name = "git-version"
+version = "0.3.9"
+dependencies = [
+ "assert2",
+ "git-version-macro",
+ "tempfile",
+]
+
+[[package]]
+name = "git-version-macro"
+version = "0.3.9"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "53010ccb100b96a67bc32c0175f0ed1426b31b655d562898e57325f81c023ac0"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.48",
+]
+
+[[package]]
+name = "hermit-abi"
+version = "0.3.4"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f"
+
+[[package]]
+name = "is-terminal"
+version = "0.4.10"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455"
+dependencies = [
+ "hermit-abi",
+ "rustix",
+ "windows-sys",
+]
+
+[[package]]
+name = "libc"
+version = "0.2.152"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7"
+
+[[package]]
+name = "linux-raw-sys"
+version = "0.4.13"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c"
+
+[[package]]
+name = "proc-macro2"
+version = "1.0.78"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae"
+dependencies = [
+ "unicode-ident",
+]
+
+[[package]]
+name = "quote"
+version = "1.0.35"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
+dependencies = [
+ "proc-macro2",
+]
+
+[[package]]
+name = "redox_syscall"
+version = "0.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa"
+dependencies = [
+ "bitflags 1.3.2",
+]
+
+[[package]]
+name = "rustc_version"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366"
+dependencies = [
+ "semver",
+]
+
+[[package]]
+name = "rustix"
+version = "0.38.30"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca"
+dependencies = [
+ "bitflags 2.4.2",
+ "errno",
+ "libc",
+ "linux-raw-sys",
+ "windows-sys",
+]
+
+[[package]]
+name = "semver"
+version = "1.0.21"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0"
+
+[[package]]
+name = "syn"
+version = "1.0.109"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "unicode-ident",
+]
+
+[[package]]
+name = "syn"
+version = "2.0.48"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "unicode-ident",
+]
+
+[[package]]
+name = "tempfile"
+version = "3.9.0"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa"
+dependencies = [
+ "cfg-if",
+ "fastrand",
+ "redox_syscall",
+ "rustix",
+ "windows-sys",
+]
+
+[[package]]
+name = "unicode-ident"
+version = "1.0.12"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
+
+[[package]]
+name = "windows-sys"
+version = "0.52.0"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
+dependencies = [
+ "windows-targets",
+]
+
+[[package]]
+name = "windows-targets"
+version = "0.52.0"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd"
+dependencies = [
+ "windows_aarch64_gnullvm",
+ "windows_aarch64_msvc",
+ "windows_i686_gnu",
+ "windows_i686_msvc",
+ "windows_x86_64_gnu",
+ "windows_x86_64_gnullvm",
+ "windows_x86_64_msvc",
+]
+
+[[package]]
+name = "windows_aarch64_gnullvm"
+version = "0.52.0"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea"
+
+[[package]]
+name = "windows_aarch64_msvc"
+version = "0.52.0"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef"
+
+[[package]]
+name = "windows_i686_gnu"
+version = "0.52.0"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313"
+
+[[package]]
+name = "windows_i686_msvc"
+version = "0.52.0"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a"
+
+[[package]]
+name = "windows_x86_64_gnu"
+version = "0.52.0"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd"
+
+[[package]]
+name = "windows_x86_64_gnullvm"
+version = "0.52.0"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e"
+
+[[package]]
+name = "windows_x86_64_msvc"
+version = "0.52.0"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04"
+
+[[package]]
+name = "yansi"
+version = "0.5.1"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec"
diff --git a/tui/vendor/git-version/Cargo.toml b/tui/vendor/git-version/Cargo.toml
new file mode 100644
index 000000000..6b5c63911
--- /dev/null
+++ b/tui/vendor/git-version/Cargo.toml
@@ -0,0 +1,41 @@
+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
+#
+# When uploading crates to the registry Cargo will automatically
+# "normalize" Cargo.toml files for maximal compatibility
+# with all versions of Cargo and also rewrite `path` dependencies
+# to registry (e.g., crates.io) dependencies.
+#
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
+
+## [workspace]
+
+[package]
+name = "git-version"
+authors = [
+ "Mara Bos <[email protected]>",
+ "Maarten de Vries <[email protected]>",
+ "David Roundy <[email protected]>",
+]
+description = "Compile the git version (tag name, or hash otherwise) and dirty state into your program."
+readme = "README.md"
+version = { workspace = true }
+edition = { workspace = true }
+rust-version = { workspace = true }
+#license = { workspace = true }
+homepage = { workspace = true }
+repository = { workspace = true }
+documentation = { workspace = true }
+keywords = { workspace = true }
+
+
+
+[dependencies.git-version-macro]
+version = "=0.3.9"
+
+[dev-dependencies.assert2]
+version = "0.3.11"
+
+[dev-dependencies.tempfile]
+version = "3.8.1"
diff --git a/tui/vendor/git-version/README.md b/tui/vendor/git-version/README.md
new file mode 100644
index 000000000..54a958e0c
--- /dev/null
+++ b/tui/vendor/git-version/README.md
@@ -0,0 +1,26 @@
+# git-version
+
+Embed git information in your code at compile-time.
+
+```rust
+use git_version::git_version;
+const GIT_VERSION: &str = git_version!();
+```
+
+The version number will have a `-modified` suffix if your git worktree had
+untracked or changed files.
+
+These macros do not depend on libgit, but simply uses the `git` binary directly.
+So you must have `git` installed somewhere in your `PATH`.
+
+You can also get the version information for all submodules:
+```rust
+use git_version::git_submodule_versions;
+const GIT_SUBMODULE_VERSIONS: &[(&str, &str)] = &git_submodule_versions!();
+
+for (path, version) in GIT_SUBMODULE_VERSIONS {
+ println!("{path}: {version}");
+}
+```
+
+License: BSD-2-Clause
diff --git a/tui/vendor/git-version/src/lib.rs b/tui/vendor/git-version/src/lib.rs
new file mode 100644
index 000000000..b2a162e4d
--- /dev/null
+++ b/tui/vendor/git-version/src/lib.rs
@@ -0,0 +1,37 @@
+#![no_std]
+
+//! Embed git information in your code at compile-time.
+//!
+//! ```
+//! use git_version::git_version;
+//! const GIT_VERSION: &str = git_version!();
+//! ```
+//!
+//! The version number will have a `-modified` suffix if your git worktree had
+//! untracked or changed files.
+//!
+//! These macros do not depend on libgit, but simply uses the `git` binary directly.
+//! So you must have `git` installed somewhere in your `PATH`.
+//!
+//! You can also get the version information for all submodules:
+//! ```
+//! use git_version::git_submodule_versions;
+//! const GIT_SUBMODULE_VERSIONS: &[(&str, &str)] = &git_submodule_versions!();
+//!
+//! for (path, version) in GIT_SUBMODULE_VERSIONS {
+//! println!("{path}: {version}");
+//! }
+//! ```
+
+pub use git_version_macro::{git_submodule_versions, git_version};
+
+/// Run `git describe` at compile time with custom flags.
+///
+/// This is just a short-hand for `git_version!(args = [...])`,
+/// to be backwards compatible with earlier versions of this crate.
+#[macro_export]
+macro_rules! git_describe {
+ ($($args:tt)*) => {
+ $crate::git_version!(args = [$($args)*])
+ };
+}
diff --git a/tui/vendor/git-version/tests/version.rs b/tui/vendor/git-version/tests/version.rs
new file mode 100644
index 000000000..305fd6a35
--- /dev/null
+++ b/tui/vendor/git-version/tests/version.rs
@@ -0,0 +1,111 @@
+use std::path::Path;
+
+use assert2::{assert, let_assert};
+use git_version::{
+ git_describe, git_submodule_versions, git_version,
+};
+
+#[test]
+fn git_describe_is_right() {
+ let output = std::process::Command::new("git")
+ .args(["describe", "--always", "--dirty=-modified"])
+ .output()
+ .expect("failed to execute git")
+ .stdout;
+
+ let_assert!(Ok(name) = std::str::from_utf8(&output));
+ let name = name.trim();
+ assert!(
+ git_version!(args = ["--always", "--dirty=-modified"])
+ == name
+ );
+ assert!(git_describe!("--always", "--dirty=-modified") == name);
+ assert!(
+ git_version!(prefix = "[", suffix = "]")
+ == format!("[{}]", name)
+ );
+ assert!(git_submodule_versions!() == []);
+}
+
+#[test]
+fn test_in_external_clone() {
+ let_assert!(Ok(tempdir) = tempfile::tempdir());
+ let_assert!(
+ Some(lib_dir) = std::env::var_os("CARGO_MANIFEST_DIR")
+ );
+ let_assert!(Ok(lib_dir) = Path::new(&lib_dir).canonicalize());
+ let_assert!(
+ Ok(target_dir) =
+ Path::new(env!("CARGO_TARGET_TMPDIR")).canonicalize()
+ );
+ let target_dir = target_dir.join("tests_target");
+
+ let_assert!(
+ Ok(result) = std::process::Command::new("git")
+ .arg("clone")
+ .arg("--quiet")
+ .arg((lib_dir).join(".."))
+ .arg(tempdir.path())
+ .status()
+ );
+ assert!(result.success(), "git clone: {result}");
+
+ let_assert!(
+ Ok(result) = std::process::Command::new("git")
+ .current_dir(&tempdir)
+ .arg("-c")
+ .arg("protocol.file.allow=always")
+ .arg("fetch")
+ .arg("--quiet")
+ .arg("origin")
+ .arg("+refs/remotes/origin/test-*:refs/heads/test-*")
+ .status()
+ );
+ assert!(result.success(), "git fetch: {result}");
+
+ let_assert!(
+ Ok(result) = std::process::Command::new("git")
+ .current_dir(&tempdir)
+ .arg("switch")
+ .arg("--quiet")
+ .arg("test-root")
+ .status()
+ );
+ assert!(result.success(), "git fetch: {result}");
+
+ let_assert!(
+ Ok(result) = std::process::Command::new("git")
+ .current_dir(&tempdir)
+ .arg("-c")
+ .arg("protocol.file.allow=always")
+ .arg("submodule")
+ .arg("--quiet")
+ .arg("update")
+ .arg("--init")
+ .status()
+ );
+ assert!(
+ result.success(),
+ "git submodule update --init: {result}"
+ );
+
+ let_assert!(
+ Ok(result) = std::process::Command::new("cargo")
+ .current_dir(&tempdir)
+ .arg("add")
+ .arg("--path")
+ .arg(&(lib_dir))
+ .status()
+ );
+ assert!(result.success(), "cargo add: {result}");
+
+ let_assert!(
+ Ok(result) = std::process::Command::new("cargo")
+ .current_dir(&tempdir)
+ .arg("test")
+ .arg("--target-dir")
+ .arg(target_dir)
+ .status()
+ );
+ assert!(result.success(), "cargo test: {result}");
+}
Author Public Key
npub1cy4ask3r4ppzur6j030mvmjus8562629w2e3s7mzu508zfujphfqkuvxtu