19 Commits

Author SHA1 Message Date
725414cc71 release-script: Fix missing newline 2022-12-12 13:43:34 +01:00
defb8fafca Merge branch 'develop' 2022-10-10 18:50:40 +02:00
f747c085c9 Release v0.7.10 2022-10-10 18:50:40 +02:00
85dd794b53 Cargo.lock: Updating tracing v0.1.36 -> v0.1.37 2022-10-10 18:06:27 +02:00
be8d85cb66 dependencies: Update serde_json to 1.0.86 2022-10-10 18:06:25 +02:00
0b7527fc7d dependencies: Update clap to 4.0.11 2022-10-10 18:06:25 +02:00
3a568a774a Remove init_worktree from sync config
It was currently unused and only confuses. The initialization of
worktrees can currently only be controlled via the `--init-worktree`
command line switch. This is unfortunate, but it's the only was to
handle it right now. Changing it would mean a restructure of the code,
mainly the `tree::sync_trees` function.
2022-10-06 12:59:56 +02:00
a6ecb66547 Merge branch 'develop' 2022-10-06 12:38:32 +02:00
8a04db8130 Release v0.7.9 2022-10-06 12:38:32 +02:00
d5bbbe6171 just: Use bash explicitly 2022-10-06 12:28:20 +02:00
c6a27525fd Remove unnecessary deref 2022-10-06 12:20:30 +02:00
5880066531 cli: Update code for clap v4 2022-10-06 12:17:26 +02:00
918b63047b Cargo.lock: Updating thiserror v1.0.35 -> v1.0.37 2022-10-06 11:36:53 +02:00
0fa2a65c81 Cargo.lock: Updating openssl-sys v0.9.75 -> v0.9.76 2022-10-06 11:36:52 +02:00
87d5b7ad85 Cargo.lock: Updating crossbeam-utils v0.8.11 -> v0.8.12 2022-10-06 11:36:50 +02:00
7db3596302 Cargo.lock: Updating smallvec v1.9.0 -> v1.10.0 2022-10-06 11:36:49 +02:00
e65c744f9c Cargo.lock: Updating jobserver v0.1.24 -> v0.1.25 2022-10-06 11:36:48 +02:00
bd79602d3a dependencies: Update console to 0.15.2 2022-10-06 11:36:47 +02:00
6e876aaefc dependencies: Update clap to 4.0.10 2022-10-06 11:36:47 +02:00
10 changed files with 77 additions and 93 deletions

89
Cargo.lock generated
View File

@@ -80,26 +80,24 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "clap"
version = "3.2.22"
version = "4.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "86447ad904c7fb335a790c9d7fe3d0d971dc523b8ccd1561a520de9a85302750"
checksum = "4ed45cc2c62a3eff523e718d8576ba762c83a3146151093283ac62ae11933a73"
dependencies = [
"atty",
"bitflags",
"clap_derive",
"clap_lex",
"indexmap",
"once_cell",
"strsim",
"termcolor",
"textwrap",
]
[[package]]
name = "clap_derive"
version = "3.2.18"
version = "4.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65"
checksum = "db342ce9fda24fb191e2ed4e102055a4d381c1086a06630174cd8da8d5d917ce"
dependencies = [
"heck",
"proc-macro-error",
@@ -110,9 +108,9 @@ dependencies = [
[[package]]
name = "clap_lex"
version = "0.2.4"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5"
checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8"
dependencies = [
"os_str_bytes",
]
@@ -140,13 +138,13 @@ dependencies = [
[[package]]
name = "console"
version = "0.15.1"
version = "0.15.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "89eab4d20ce20cea182308bca13088fecea9c05f6776cf287205d41a0ed3c847"
checksum = "c050367d967ced717c04b65d8c619d863ef9292ce0c5760028655a2fb298718c"
dependencies = [
"encode_unicode",
"lazy_static",
"libc",
"once_cell",
"terminal_size",
"unicode-width",
"winapi",
@@ -154,12 +152,11 @@ dependencies = [
[[package]]
name = "crossbeam-utils"
version = "0.8.11"
version = "0.8.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "51887d4adc7b564537b15adcfb307936f8075dfcd5f00dde9a9f1d29383682bc"
checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac"
dependencies = [
"cfg-if",
"once_cell",
]
[[package]]
@@ -329,7 +326,7 @@ dependencies = [
[[package]]
name = "git-repo-manager"
version = "0.7.8"
version = "0.7.10"
dependencies = [
"clap",
"comfy-table",
@@ -454,15 +451,15 @@ dependencies = [
[[package]]
name = "itoa"
version = "1.0.3"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754"
checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc"
[[package]]
name = "jobserver"
version = "0.1.24"
version = "0.1.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa"
checksum = "068b1ee6743e4d11fb9c6a1e6064b3693a1b600e7f5f5988047d98b3dc9fb90b"
dependencies = [
"libc",
]
@@ -475,9 +472,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]]
name = "libc"
version = "0.2.133"
version = "0.2.135"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c0f80d65747a3e43d1596c7c5492d95d5edddaabd45a7fcdb02b95f644164966"
checksum = "68783febc7782c6c5cb401fbda4de5a9898be1762314da0bb2c10ced61f18b0c"
[[package]]
name = "libgit2-sys"
@@ -595,9 +592,9 @@ dependencies = [
[[package]]
name = "openssl-sys"
version = "0.9.75"
version = "0.9.76"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5f9bd0c2710541a3cda73d6f9ac4f1b240de4ae261065d309dbe73d9dceb42f"
checksum = "5230151e44c0f05157effb743e8d517472843121cf9243e8b81393edb5acd9ce"
dependencies = [
"autocfg",
"cc",
@@ -731,9 +728,9 @@ dependencies = [
[[package]]
name = "proc-macro2"
version = "1.0.43"
version = "1.0.46"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab"
checksum = "94e2ef8dbfc347b10c094890f778ee2e36ca9bb4262e86dc99cd217e35f3470b"
dependencies = [
"unicode-ident",
]
@@ -880,9 +877,9 @@ dependencies = [
[[package]]
name = "serde_json"
version = "1.0.85"
version = "1.0.86"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44"
checksum = "41feea4228a6f1cd09ec7a3593a682276702cd67b5273544757dae23c096f074"
dependencies = [
"itoa",
"ryu",
@@ -963,9 +960,9 @@ dependencies = [
[[package]]
name = "smallvec"
version = "1.9.0"
version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1"
checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0"
[[package]]
name = "socket2"
@@ -1004,9 +1001,9 @@ dependencies = [
[[package]]
name = "syn"
version = "1.0.100"
version = "1.0.102"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52205623b1b0f064a4e71182c3b18ae902267282930c6d5462c91b859668426e"
checksum = "3fcd952facd492f9be3ef0d0b7032a6e442ee9b361d4acc2b1d0c4aaa5f613a1"
dependencies = [
"proc-macro2",
"quote",
@@ -1042,26 +1039,20 @@ dependencies = [
"winapi",
]
[[package]]
name = "textwrap"
version = "0.15.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "949517c0cf1bf4ee812e2e07e08ab448e3ae0d23472aee8a06c985f0c8815b16"
[[package]]
name = "thiserror"
version = "1.0.35"
version = "1.0.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c53f98874615aea268107765aa1ed8f6116782501d18e53d08b471733bea6c85"
checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
version = "1.0.35"
version = "1.0.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8b463991b4eab2d801e724172285ec4195c650e8ec79b149e6c2a8e6dd3f783"
checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb"
dependencies = [
"proc-macro2",
"quote",
@@ -1094,9 +1085,9 @@ dependencies = [
[[package]]
name = "tracing"
version = "0.1.36"
version = "0.1.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2fce9567bd60a67d08a16488756721ba392f24f29006402881e43b19aac64307"
checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8"
dependencies = [
"cfg-if",
"log",
@@ -1107,9 +1098,9 @@ dependencies = [
[[package]]
name = "tracing-attributes"
version = "0.1.22"
version = "0.1.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "11c75893af559bc8e10716548bdef5cb2b983f8e637db9d0e15126b61b484ee2"
checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a"
dependencies = [
"proc-macro2",
"quote",
@@ -1118,9 +1109,9 @@ dependencies = [
[[package]]
name = "tracing-core"
version = "0.1.29"
version = "0.1.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5aeea4303076558a00714b823f9ad67d58a3bbda1df83d8827d21193156e22f7"
checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a"
dependencies = [
"once_cell",
]
@@ -1143,9 +1134,9 @@ checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992"
[[package]]
name = "unicode-ident"
version = "1.0.4"
version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dcc811dc4066ac62f84f11307873c4850cb653bfa9b1719cee2bd2204a4bc5dd"
checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3"
[[package]]
name = "unicode-normalization"

View File

@@ -1,6 +1,6 @@
[package]
name = "git-repo-manager"
version = "0.7.8"
version = "0.7.10"
edition = "2021"
authors = [
@@ -54,11 +54,11 @@ version = "=0.15.0"
version = "=2.1.2"
[dependencies.clap]
version = "=3.2.22"
version = "=4.0.11"
features = ["derive", "cargo"]
[dependencies.console]
version = "=0.15.1"
version = "=0.15.2"
[dependencies.regex]
version = "=1.6.0"
@@ -70,7 +70,7 @@ version = "=6.1.0"
version = "=0.9.13"
[dependencies.serde_json]
version = "=1.0.85"
version = "=1.0.86"
[dependencies.isahc]
version = "=1.7.2"

View File

@@ -1,5 +1,7 @@
set positional-arguments
set shell := ["/bin/bash", "-c"]
static_target := "x86_64-unknown-linux-musl"
check: fmt-check lint test

View File

@@ -28,7 +28,7 @@ def get_temporary_directory(dir=None):
def grm(args, cwd=None, is_invalid=False):
cmd = subprocess.run([binary] + args, cwd=cwd, capture_output=True, text=True)
if not is_invalid:
assert "USAGE" not in cmd.stderr
assert "usage" not in cmd.stderr.lower()
print(f"grmcmd: {args}")
print(f"stdout:\n{cmd.stdout}")
print(f"stderr:\n{cmd.stderr}")

View File

@@ -5,9 +5,9 @@ from helpers import *
def test_invalid_command():
cmd = grm(["whatever"], is_invalid=True)
assert "USAGE" in cmd.stderr
assert "usage" in cmd.stderr.lower()
def test_help():
cmd = grm(["--help"])
assert "USAGE" in cmd.stdout
assert "usage" in cmd.stdout.lower()

View File

@@ -67,7 +67,7 @@ fi
for remote in $(git remote); do
if git ls-remote --tags "${remote}" | grep -q "refs/tags/v${new_version}$"; then
printf 'Tag %s already exists on %s' "v${new_version}" "${remote}" >&2
printf 'Tag %s already exists on %s\n' "v${new_version}" "${remote}" >&2
exit 1
fi
done

View File

@@ -52,7 +52,6 @@ pub struct ConfigProvider {
pub api_url: Option<String>,
pub worktree: Option<bool>,
pub init_worktree: Option<bool>,
pub remote_name: Option<String>,
}

View File

@@ -1,4 +1,4 @@
use clap::{AppSettings, Parser};
use clap::Parser;
#[derive(Parser)]
#[clap(
@@ -7,7 +7,6 @@ use clap::{AppSettings, Parser};
author = clap::crate_authors!("\n"),
about = clap::crate_description!(),
long_version = clap::crate_version!(),
global_setting(AppSettings::DeriveDisplayOrder),
propagate_version = true,
)]
pub struct Opts {
@@ -65,7 +64,7 @@ pub struct FindLocalArgs {
pub path: String,
#[clap(
arg_enum,
value_enum,
short,
long,
help = "Format to produce",
@@ -85,7 +84,7 @@ pub struct FindConfigArgs {
pub config: String,
#[clap(
arg_enum,
value_enum,
short,
long,
help = "Format to produce",
@@ -100,14 +99,14 @@ pub struct FindRemoteArgs {
#[clap(short, long, help = "Path to the configuration file")]
pub config: Option<String>,
#[clap(arg_enum, short, long, help = "Remote provider to use")]
#[clap(value_enum, short, long, help = "Remote provider to use")]
pub provider: RemoteProvider,
#[clap(short, long, help = "Name of the remote to use")]
pub remote_name: Option<String>,
#[clap(
multiple_occurrences = true,
action = clap::ArgAction::Append,
name = "user",
long,
help = "Users to get repositories from"
@@ -115,7 +114,7 @@ pub struct FindRemoteArgs {
pub users: Vec<String>,
#[clap(
multiple_occurrences = true,
action = clap::ArgAction::Append,
name = "group",
long,
help = "Groups to get repositories from"
@@ -138,7 +137,7 @@ pub struct FindRemoteArgs {
pub root: String,
#[clap(
arg_enum,
value_enum,
short,
long,
help = "Format to produce",
@@ -149,11 +148,10 @@ pub struct FindRemoteArgs {
#[clap(
long,
help = "Use worktree setup for repositories",
possible_values = &["true", "false"],
value_parser = ["true", "false"],
default_value = "false",
default_missing_value = "true",
min_values = 0,
max_values = 1,
num_args = 0..=1,
)]
pub worktree: String,
@@ -174,12 +172,11 @@ pub struct Config {
#[clap(
long,
value_parser = ["true", "false"],
help = "Check out the default worktree after clone",
possible_values = &["true", "false"],
default_value = "true",
default_missing_value = "true",
min_values = 0,
max_values = 1,
num_args = 0..=1,
)]
pub init_worktree: String,
}
@@ -189,14 +186,14 @@ pub type RemoteProvider = super::provider::RemoteProvider;
#[derive(Parser)]
#[clap()]
pub struct SyncRemoteArgs {
#[clap(arg_enum, short, long, help = "Remote provider to use")]
#[clap(value_enum, short, long, help = "Remote provider to use")]
pub provider: RemoteProvider,
#[clap(short, long, help = "Name of the remote to use")]
pub remote_name: Option<String>,
#[clap(
multiple_occurrences = true,
action = clap::ArgAction::Append,
name = "user",
long,
help = "Users to get repositories from"
@@ -204,7 +201,7 @@ pub struct SyncRemoteArgs {
pub users: Vec<String>,
#[clap(
multiple_occurrences = true,
action = clap::ArgAction::Append,
name = "group",
long,
help = "Groups to get repositories from"
@@ -229,11 +226,10 @@ pub struct SyncRemoteArgs {
#[clap(
long,
help = "Use worktree setup for repositories",
possible_values = &["true", "false"],
value_parser = ["true", "false"],
default_value = "false",
default_missing_value = "true",
min_values = 0,
max_values = 1,
num_args = 0..=1,
)]
pub worktree: String,
@@ -243,11 +239,10 @@ pub struct SyncRemoteArgs {
#[clap(
long,
help = "Check out the default worktree after clone",
possible_values = &["true", "false"],
value_parser = ["true", "false"],
default_value = "true",
default_missing_value = "true",
min_values = 0,
max_values = 1,
num_args = 0..=1,
)]
pub init_worktree: String,
}
@@ -259,7 +254,7 @@ pub struct OptionalConfig {
pub config: Option<String>,
}
#[derive(clap::ArgEnum, Clone)]
#[derive(clap::ValueEnum, Clone)]
pub enum ConfigFormat {
Yaml,
Toml,
@@ -299,7 +294,7 @@ pub struct WorktreeAddArgs {
#[clap(short = 't', long = "track", help = "Remote branch to track")]
pub track: Option<String>,
#[clap(long = "--no-track", help = "Disable tracking")]
#[clap(long = "no-track", help = "Disable tracking")]
pub no_track: bool,
}
#[derive(Parser)]
@@ -328,22 +323,19 @@ pub struct WorktreeFetchArgs {}
#[derive(Parser)]
pub struct WorktreePullArgs {
#[clap(long = "--rebase", help = "Perform a rebase instead of a fast-forward")]
#[clap(long = "rebase", help = "Perform a rebase instead of a fast-forward")]
pub rebase: bool,
#[clap(long = "--stash", help = "Stash & unstash changes before & after pull")]
#[clap(long = "stash", help = "Stash & unstash changes before & after pull")]
pub stash: bool,
}
#[derive(Parser)]
pub struct WorktreeRebaseArgs {
#[clap(long = "--pull", help = "Perform a pull before rebasing")]
#[clap(long = "pull", help = "Perform a pull before rebasing")]
pub pull: bool,
#[clap(long = "--rebase", help = "Perform a rebase when doing a pull")]
#[clap(long = "rebase", help = "Perform a rebase when doing a pull")]
pub rebase: bool,
#[clap(
long = "--stash",
help = "Stash & unstash changes before & after rebase"
)]
#[clap(long = "stash", help = "Stash & unstash changes before & after rebase")]
pub stash: bool,
}

View File

@@ -16,7 +16,7 @@ use std::collections::HashMap;
const DEFAULT_REMOTE_NAME: &str = "origin";
#[derive(Debug, Deserialize, Serialize, clap::ArgEnum, Clone)]
#[derive(Debug, Deserialize, Serialize, clap::ValueEnum, Clone)]
pub enum RemoteProvider {
#[serde(alias = "github", alias = "GitHub")]
Github,

View File

@@ -372,7 +372,7 @@ impl<'a> Worktree<'a, WithRemoteTrackingBranch<'a>> {
// TECHDEBT
// We must not call this with `Some()` without a valid target.
// I'm sure this can be improved, just not sure how.
&*self.extra.target_commit.unwrap(),
&self.extra.target_commit.unwrap(),
)?
};