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
192 changes: 73 additions & 119 deletions Cargo.lock

Large diffs are not rendered by default.

24 changes: 13 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "stc"
description = "[WIP] Easy stacking of dev branches in git repositories."
version = "0.1.2"
version = "0.2.1"
authors = ["Folke Behrens <folke@gmail.com>"]
edition = "2021"
repository = "https://github.com/cloneable/stc/"
Expand All @@ -11,25 +11,27 @@ keywords = ["git"]
exclude = [".gitignore", ".github", "target"]

[dependencies]
anyhow = "1.0.57"
const_format = "0.2.24"
serde = { version = "1.0.137", features = ["derive"] }
csv = "1.1.6"
thiserror = "1.0.31"
anyhow = "1"
const_format = "0.2"
serde = { version = "1", features = ["derive"] }
csv = "1"
thiserror = "1"

[dependencies.clap]
version = "3.1.18"
version = "3"
default-features = false
features = ["std", "derive"]

[dev-dependencies]
assert_cmd = "2.0.4"
assert_fs = "1.0.7"
phf = { version = "0.10.1", features = ["macros"] }
predicates = "2.1.1"
assert_cmd = "2"
assert_fs = "1"
phf = { version = "0.11", features = ["macros"] }
predicates = "2"

[profile.release]
lto = true
opt-level = 3
codegen-units = 1
panic = "abort"
debug = 1
strip = "none"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# stc

(Work in Progress)
(work in progress; very experimental)

Easy git rebasing of stacked feature branches

Expand Down
26 changes: 10 additions & 16 deletions src/git.rs
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
use ::anyhow::Result;
use ::const_format::concatcp;
use ::csv::ReaderBuilder;
use ::serde::Deserialize;
use ::std::{
self,
use anyhow::Result;
use const_format::concatcp;
use csv::ReaderBuilder;
use serde::Deserialize;
use std::{
borrow::{Cow, ToOwned},
clone::Clone,
collections::{BTreeSet, HashMap},
convert::{AsRef, Into},
iter::{IntoIterator, Iterator},
option::Option::{self, Some},
result::Result::{Err, Ok},
string::{String, ToString},
vec::Vec,
write,
};
use ::thiserror::Error;
use thiserror::Error;

pub const NON_EXISTANT_OBJECT: ObjectName<'static> =
ObjectName::new("0000000000000000000000000000000000000000");
Expand Down Expand Up @@ -285,7 +279,7 @@ impl<'a> RefName<'a> {
}
}

#[derive(Deserialize, PartialEq, PartialOrd, Clone, Debug)]
#[derive(Deserialize, PartialEq, Eq, PartialOrd, Clone, Debug)]
pub struct ObjectName<'a>(pub Cow<'a, str>);

impl<'a> ObjectName<'a> {
Expand All @@ -302,7 +296,7 @@ impl<'a> ObjectName<'a> {
}
}

#[derive(Deserialize, PartialEq, PartialOrd, Debug)]
#[derive(Deserialize, PartialEq, Eq, PartialOrd, Debug)]
pub struct RemoteName<'a>(Cow<'a, str>);

impl<'a> RemoteName<'a> {
Expand All @@ -319,7 +313,7 @@ impl<'a> RemoteName<'a> {
}
}

#[derive(Deserialize, PartialEq, Debug)]
#[derive(Deserialize, PartialEq, Eq, Debug)]
#[serde(rename_all = "lowercase")]
pub enum RefType {
Commit,
Expand All @@ -328,7 +322,7 @@ pub enum RefType {
Tag,
}

#[derive(Deserialize, PartialEq, Debug)]
#[derive(Deserialize, PartialEq, Eq, Debug)]
pub struct Ref<'a> {
pub name: RefName<'a>,
pub head: bool,
Expand Down
10 changes: 2 additions & 8 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
#![no_implicit_prelude]
#![allow(missing_docs)] // TODO: change to warn/deny
#![allow(dead_code)] // TODO: remove

use ::anyhow::Result;
use ::clap::{self, Parser, Subcommand};
use ::std::{
format,
option::Option::{self, None, Some},
string::String,
};
use anyhow::Result;
use clap::{self, Parser, Subcommand};

mod git;
mod runner;
Expand Down
7 changes: 2 additions & 5 deletions src/runner.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
use crate::git;
use ::anyhow::Result;
use ::std::{
use anyhow::Result;
use std::{
collections::HashMap,
convert::Into,
option::Option::Some,
path::PathBuf,
process::{Command, Stdio},
result::Result::{Err, Ok},
};

pub struct Runner<'a> {
Expand Down
13 changes: 3 additions & 10 deletions src/stc.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
use crate::git;
use ::anyhow::Result;
use ::std::{
self,
convert::Into,
option::Option::{self, Some},
result::Result::{Err, Ok},
string::{String, ToString},
write,
};
use ::thiserror::Error;
use anyhow::Result;
use std::write;
use thiserror::Error;

#[derive(Error, Debug)]
pub enum StcError {
Expand Down
8 changes: 4 additions & 4 deletions tests/integration_test.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use ::assert_fs::{assert::PathAssert, fixture::PathChild};
use ::phf::{phf_map, Map};
use ::predicates::prelude::*;
use ::std::{
use assert_fs::{assert::PathAssert, fixture::PathChild};
use phf::{phf_map, Map};
use predicates::prelude::*;
use std::{
env,
fs::File,
io::{Read, Write},
Expand Down