From d2353fe435702a8b2ff40d8f32600031c12917c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christina=20S=C3=B8rensen?= Date: Sun, 2 Jul 2023 10:45:39 +0200 Subject: [PATCH 1/7] doc(git-cliff): added git cliff config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Just done using git cliff init. Does not introduce a dependency for users. Signed-off-by: Christina Sørensen --- cliff.toml | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 cliff.toml diff --git a/cliff.toml b/cliff.toml new file mode 100644 index 0000000..0a88218 --- /dev/null +++ b/cliff.toml @@ -0,0 +1,75 @@ +# git-cliff ~ default configuration file +# https://git-cliff.org/docs/configuration +# +# Lines starting with "#" are comments. +# Configuration options are organized into tables and keys. +# See documentation for more information on available options. + +[changelog] +# changelog header +header = """ +# Changelog\n +All notable changes to this project will be documented in this file.\n +""" +# template for the changelog body +# https://tera.netlify.app/docs +body = """ +{% if version %}\ + ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} +{% else %}\ + ## [unreleased] +{% endif %}\ +{% for group, commits in commits | group_by(attribute="group") %} + ### {{ group | upper_first }} + {% for commit in commits %} + - {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }}\ + {% endfor %} +{% endfor %}\n +""" +# remove the leading and trailing whitespace from the template +trim = true +# changelog footer +footer = """ + +""" + +[git] +# parse the commits based on https://www.conventionalcommits.org +conventional_commits = true +# filter out the commits that are not conventional +filter_unconventional = true +# process each line of a commit as an individual commit +split_commits = false +# regex for preprocessing the commit messages +commit_preprocessors = [ + # { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/orhun/git-cliff/issues/${2}))"}, # replace issue numbers +] +# regex for parsing and grouping commits +commit_parsers = [ + { message = "^feat", group = "Features" }, + { message = "^fix", group = "Bug Fixes" }, + { message = "^doc", group = "Documentation" }, + { message = "^perf", group = "Performance" }, + { message = "^refactor", group = "Refactor" }, + { message = "^style", group = "Styling" }, + { message = "^test", group = "Testing" }, + { message = "^chore\\(release\\): prepare for", skip = true }, + { message = "^chore", group = "Miscellaneous Tasks" }, + { body = ".*security", group = "Security" }, +] +# protect breaking changes from being skipped due to matching a skipping commit_parser +protect_breaking_commits = false +# filter out the commits that are not matched by commit parsers +filter_commits = false +# glob pattern for matching git tags +tag_pattern = "v[0-9]*" +# regex for skipping tags +skip_tags = "v0.1.0-beta.1" +# regex for ignoring tags +ignore_tags = "" +# sort the tags topologically +topo_order = false +# sort the commits inside sections by oldest/newest order +sort_commits = "oldest" +# limit the number of commits included in the changelog. +# limit_commits = 42 -- 2.46.0 From e6f597e08bd6feec8c5461eb6ffab6ff46030307 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christina=20S=C3=B8rensen?= Date: Sun, 2 Jul 2023 10:52:23 +0200 Subject: [PATCH 2/7] feat(git): add Commit, Add flags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This also fixes behaviour of all flags. Signed-off-by: Christina Sørensen --- doc/roadmap.org | 2 +- src/git.rs | 14 +++++++++----- src/test/test.yaml | 40 ++++++++++++++++++++-------------------- 3 files changed, 30 insertions(+), 26 deletions(-) diff --git a/doc/roadmap.org b/doc/roadmap.org index 8b6665a..8126d17 100644 --- a/doc/roadmap.org +++ b/doc/roadmap.org @@ -9,7 +9,7 @@ - [X] No functionality regressions - [X] commit works in quick, fast - [X] commit with edit works -- [ ] Repo Flags Finished +- [-] Repo Flags Finished - [ ] Category Flags Finished - [ ] Optional Fields - [ ] Subcommands diff --git a/src/git.rs b/src/git.rs index 4bb0e65..ae3c35f 100644 --- a/src/git.rs +++ b/src/git.rs @@ -28,12 +28,16 @@ use std::{fs, process::Command}; /// An enum containing flags that change behaviour of repos and categories #[derive(PartialOrd, Ord, PartialEq, Eq, Serialize, Deserialize, Debug)] pub enum RepoFlags { - /// If push is set, the repository should respond to the push subcommand - Push, /// If clone is set, the repository should respond to the clone subcommand Clone, /// If pull is set, the repository should respond to the pull subcommand Pull, + /// If add is set, the repository should respond to the add subcommand + Add, + /// If commit is set, the repository should respond to the commit subcommand + Commit, + /// If push is set, the repository should respond to the push subcommand + Push, } /// Represents the config.toml file. @@ -174,7 +178,7 @@ impl GitRepo { } /// Adds all files in the repository. fn add_all(&self) -> bool { - if self.flags.contains(&RepoFlags::Push) { + if self.flags.contains(&RepoFlags::Add) { let output = Command::new("git") .current_dir(format!("{}{}", &self.path, &self.name)) .arg("add") @@ -196,7 +200,7 @@ impl GitRepo { /// easy #[allow(dead_code)] fn commit(&self) -> bool { - if self.flags.contains(&RepoFlags::Push) { + if self.flags.contains(&RepoFlags::Commit) { let status = Command::new("git") .current_dir(format!("{}{}", &self.path, &self.name)) .arg("commit") @@ -210,7 +214,7 @@ impl GitRepo { } /// Tries to commit changes with a message argument. fn commit_with_msg(&self, msg: &str) -> bool { - if self.flags.contains(&RepoFlags::Push) { + if self.flags.contains(&RepoFlags::Commit) { let output = Command::new("git") .current_dir(format!("{}{}", &self.path, &self.name)) .arg("commit") diff --git a/src/test/test.yaml b/src/test/test.yaml index ca79c57..47a5899 100644 --- a/src/test/test.yaml +++ b/src/test/test.yaml @@ -1,24 +1,14 @@ categories: - utils: - flags: [] - repos: - li: - name: li - path: /home/ces/org/src/git/ - url: git@github.com:cafkafk/li.git - flags: - - Clone - - Push - gg: - name: gg - path: /home/ces/.dots/ - url: git@github.com:cafkafk/gg.git - flags: - - Clone - - Push config: flags: [] repos: + starship: + name: starship + path: /home/ces/org/src/git/ + url: https://github.com/starship/starship.git + flags: + - Clone + - Push qmk_firmware: name: qmk_firmware path: /home/ces/org/src/git/ @@ -26,10 +16,20 @@ categories: flags: - Clone - Push - starship: - name: starship + utils: + flags: [] + repos: + gg: + name: gg + path: /home/ces/.dots/ + url: git@github.com:cafkafk/gg.git + flags: + - Clone + - Push + li: + name: li path: /home/ces/org/src/git/ - url: https://github.com/starship/starship.git + url: git@github.com:cafkafk/li.git flags: - Clone - Push -- 2.46.0 From ec49c90a0e818e78eda0f970e8679486d1c4f964 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christina=20S=C3=B8rensen?= Date: Sun, 2 Jul 2023 11:05:14 +0200 Subject: [PATCH 3/7] feat(git)!: added Quick, Fast flags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Quick and Fast are shortcut flags that essentially give all flags nescesarry for Quick and Fast subcommand. Signed-off-by: Christina Sørensen --- doc/roadmap.org | 4 ++-- src/git.rs | 38 +++++++++++++++++++++++++++++++++----- src/test/test.yaml | 28 ++++++++++++++-------------- 3 files changed, 49 insertions(+), 21 deletions(-) diff --git a/doc/roadmap.org b/doc/roadmap.org index 8126d17..ed169b8 100644 --- a/doc/roadmap.org +++ b/doc/roadmap.org @@ -5,11 +5,11 @@ - [ ] Generic repositories - [ ] Version pinning - [ ] libgit2 (maybe) -* 0.1.0 [20%] [1/5] +* 0.1.0 [40%] [2/5] - [X] No functionality regressions - [X] commit works in quick, fast - [X] commit with edit works -- [-] Repo Flags Finished +- [X] Repo Flags Finished - [ ] Category Flags Finished - [ ] Optional Fields - [ ] Subcommands diff --git a/src/git.rs b/src/git.rs index ae3c35f..f806c08 100644 --- a/src/git.rs +++ b/src/git.rs @@ -38,6 +38,14 @@ pub enum RepoFlags { Commit, /// If push is set, the repository should respond to the push subcommand Push, + /// If push is set, the repository should respond to the Qucik subcommand + /// + /// This is a shortcut for Add, Commit, Push + Quick, + /// If push is set, the repository should respond to the Fast and Qucik subcommand + /// + /// This is a shortcut for Pull, Add, Commit, Push + Fast, } /// Represents the config.toml file. @@ -164,7 +172,11 @@ impl GitRepo { } /// Pulls the repository if able. fn pull(&self) -> bool { - if self.flags.contains(&RepoFlags::Pull) { + if self + .flags + .iter() + .any(|s| s == &RepoFlags::Pull || s == &RepoFlags::Fast) + { let output = Command::new("git") .current_dir(format!("{}{}", &self.path, &self.name)) .arg("pull") @@ -178,7 +190,11 @@ impl GitRepo { } /// Adds all files in the repository. fn add_all(&self) -> bool { - if self.flags.contains(&RepoFlags::Add) { + if self + .flags + .iter() + .any(|s| s == &RepoFlags::Add || s == &RepoFlags::Quick || s == &RepoFlags::Fast) + { let output = Command::new("git") .current_dir(format!("{}{}", &self.path, &self.name)) .arg("add") @@ -200,7 +216,11 @@ impl GitRepo { /// easy #[allow(dead_code)] fn commit(&self) -> bool { - if self.flags.contains(&RepoFlags::Commit) { + if self + .flags + .iter() + .any(|s| s == &RepoFlags::Commit || s == &RepoFlags::Quick || s == &RepoFlags::Fast) + { let status = Command::new("git") .current_dir(format!("{}{}", &self.path, &self.name)) .arg("commit") @@ -214,7 +234,11 @@ impl GitRepo { } /// Tries to commit changes with a message argument. fn commit_with_msg(&self, msg: &str) -> bool { - if self.flags.contains(&RepoFlags::Commit) { + if self + .flags + .iter() + .any(|s| s == &RepoFlags::Commit || s == &RepoFlags::Quick || s == &RepoFlags::Fast) + { let output = Command::new("git") .current_dir(format!("{}{}", &self.path, &self.name)) .arg("commit") @@ -230,7 +254,11 @@ impl GitRepo { } /// Attempts to push the repository. fn push(&self) -> bool { - if self.flags.contains(&RepoFlags::Push) { + if self + .flags + .iter() + .any(|s| s == &RepoFlags::Push || s == &RepoFlags::Quick || s == &RepoFlags::Fast) + { let output = Command::new("git") .current_dir(format!("{}{}", &self.path, &self.name)) .arg("push") diff --git a/src/test/test.yaml b/src/test/test.yaml index 47a5899..b8dd2eb 100644 --- a/src/test/test.yaml +++ b/src/test/test.yaml @@ -2,13 +2,6 @@ categories: config: flags: [] repos: - starship: - name: starship - path: /home/ces/org/src/git/ - url: https://github.com/starship/starship.git - flags: - - Clone - - Push qmk_firmware: name: qmk_firmware path: /home/ces/org/src/git/ @@ -16,16 +9,16 @@ categories: flags: - Clone - Push - utils: - flags: [] - repos: - gg: - name: gg - path: /home/ces/.dots/ - url: git@github.com:cafkafk/gg.git + starship: + name: starship + path: /home/ces/org/src/git/ + url: https://github.com/starship/starship.git flags: - Clone - Push + utils: + flags: [] + repos: li: name: li path: /home/ces/org/src/git/ @@ -33,6 +26,13 @@ categories: flags: - Clone - Push + gg: + name: gg + path: /home/ces/.dots/ + url: git@github.com:cafkafk/gg.git + flags: + - Clone + - Push links: - name: gg rx: /home/ces/.config/gg -- 2.46.0 From a000d37b7229dc0e2ae1e71f9f21f209c7bbe79f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christina=20S=C3=B8rensen?= Date: Sun, 2 Jul 2023 11:23:00 +0200 Subject: [PATCH 4/7] feat(git): made category flags optional MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christina Sørensen --- doc/roadmap.org | 2 +- src/git.rs | 3 ++- src/main.rs | 2 +- src/test/config.yaml | 1 - src/test/test.yaml | 33 ++++++++++++++++----------------- 5 files changed, 20 insertions(+), 21 deletions(-) diff --git a/doc/roadmap.org b/doc/roadmap.org index ed169b8..eba028b 100644 --- a/doc/roadmap.org +++ b/doc/roadmap.org @@ -11,5 +11,5 @@ - [X] commit with edit works - [X] Repo Flags Finished - [ ] Category Flags Finished -- [ ] Optional Fields +- [-] Optional Fields - [ ] Subcommands diff --git a/src/git.rs b/src/git.rs index f806c08..620a658 100644 --- a/src/git.rs +++ b/src/git.rs @@ -68,7 +68,8 @@ pub struct Config { /// This allows you to organize your repositories into categories #[derive(PartialEq, Debug, Serialize, Deserialize)] pub struct Category { - pub flags: Vec, // FIXME: not implemented + #[serde(skip_serializing_if = "Option::is_none")] + pub flags: Option>, // FIXME: not implemented /// map of all categories /// /// Key should conceptually be seen as the name of the category. diff --git a/src/main.rs b/src/main.rs index 68d6816..087e4fe 100644 --- a/src/main.rs +++ b/src/main.rs @@ -126,7 +126,7 @@ mod config { #[test] fn init_config_populate() { let default_category = Category { - flags: vec![], + flags: Some(vec![]), repos: HashMap::new(), }; let mut config = Config { diff --git a/src/test/config.yaml b/src/test/config.yaml index c53665b..91aa884 100644 --- a/src/test/config.yaml +++ b/src/test/config.yaml @@ -13,7 +13,6 @@ categories: url: https://github.com/starship/starship.git flags: [Clone, Push] utils: - flags: [] repos: gg: name: gg diff --git a/src/test/test.yaml b/src/test/test.yaml index b8dd2eb..89fb77d 100644 --- a/src/test/test.yaml +++ b/src/test/test.yaml @@ -1,4 +1,20 @@ categories: + utils: + repos: + gg: + name: gg + path: /home/ces/.dots/ + url: git@github.com:cafkafk/gg.git + flags: + - Clone + - Push + li: + name: li + path: /home/ces/org/src/git/ + url: git@github.com:cafkafk/li.git + flags: + - Clone + - Push config: flags: [] repos: @@ -16,23 +32,6 @@ categories: flags: - Clone - Push - utils: - flags: [] - repos: - li: - name: li - path: /home/ces/org/src/git/ - url: git@github.com:cafkafk/li.git - flags: - - Clone - - Push - gg: - name: gg - path: /home/ces/.dots/ - url: git@github.com:cafkafk/gg.git - flags: - - Clone - - Push links: - name: gg rx: /home/ces/.config/gg -- 2.46.0 From 1c6793f8e441193971575b3a5d06219c64170d25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christina=20S=C3=B8rensen?= Date: Sun, 2 Jul 2023 11:29:16 +0200 Subject: [PATCH 5/7] feat(git): made categories.repo optional MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is nice because it sets us up for the future, when we eventually implement link categories, so we can share categories for both repos, links, neither or either. Signed-off-by: Christina Sørensen --- src/git.rs | 11 ++++++----- src/main.rs | 6 +++++- src/test/config.yaml | 1 + src/test/test.yaml | 33 +++++++++++++++++---------------- 4 files changed, 29 insertions(+), 22 deletions(-) diff --git a/src/git.rs b/src/git.rs index 620a658..a5c86e2 100644 --- a/src/git.rs +++ b/src/git.rs @@ -73,7 +73,8 @@ pub struct Category { /// map of all categories /// /// Key should conceptually be seen as the name of the category. - pub repos: HashMap, + #[serde(skip_serializing_if = "Option::is_none")] + pub repos: Option>, } /// Contain fields for a single link. @@ -311,7 +312,7 @@ impl Config { F: Fn(&GitRepo), { for (_, category) in self.categories.iter() { - for (_, repo) in category.repos.iter() { + for (_, repo) in category.repos.as_ref().expect("failed to get repos").iter() { f(repo); } } @@ -326,7 +327,7 @@ impl Config { F: Fn(&GitRepo) -> bool, { for (_, category) in self.categories.iter() { - for (_, repo) in category.repos.iter() { + for (_, repo) in category.repos.as_ref().expect("failed to get repos").iter() { let mut sp = Spinner::new(Spinners::Dots10, format!("{}: {}", repo.name, op).into()); if f(repo) { @@ -380,7 +381,7 @@ impl Config { /// ``` pub fn series_on_all(&self, closures: Vec) { for (_, category) in self.categories.iter() { - for (_, repo) in category.repos.iter() { + for (_, repo) in category.repos.as_ref().expect("failed to get repos").iter() { for instruction in closures.iter() { let f = &instruction.closure; let op = instruction.operation; @@ -427,7 +428,7 @@ impl Config { /// ``` pub fn all_on_all(&self, closures: Vec) { for (_, category) in self.categories.iter() { - for (_, repo) in category.repos.iter() { + for (_, repo) in category.repos.as_ref().expect("failed to get repos").iter() { for instruction in closures.iter() { let f = &instruction.closure; let op = instruction.operation; diff --git a/src/main.rs b/src/main.rs index 087e4fe..c886a5f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -127,7 +127,7 @@ mod config { fn init_config_populate() { let default_category = Category { flags: Some(vec![]), - repos: HashMap::new(), + repos: Some(HashMap::new()), }; let mut config = Config { categories: HashMap::new(), @@ -142,6 +142,8 @@ mod config { .get_mut(&format!("{}", 0).to_string()) .expect("category not found") .repos + .as_mut() + .expect("failed to get repo") .insert( format!("{}", i).to_string(), GitRepo { @@ -196,6 +198,8 @@ mod config { .get(cat_name) .expect("failed to get category") .repos + .as_ref() + .expect("failed to get repo") .get(repo_name) .expect("failed to get category")) } diff --git a/src/test/config.yaml b/src/test/config.yaml index 91aa884..dc7960d 100644 --- a/src/test/config.yaml +++ b/src/test/config.yaml @@ -24,6 +24,7 @@ categories: path: /home/ces/org/src/git/ url: git@github.com:cafkafk/li.git flags: [Clone, Push] + empty: links: - name: gg rx: /home/ces/.config/gg diff --git a/src/test/test.yaml b/src/test/test.yaml index 89fb77d..369371d 100644 --- a/src/test/test.yaml +++ b/src/test/test.yaml @@ -1,20 +1,5 @@ categories: - utils: - repos: - gg: - name: gg - path: /home/ces/.dots/ - url: git@github.com:cafkafk/gg.git - flags: - - Clone - - Push - li: - name: li - path: /home/ces/org/src/git/ - url: git@github.com:cafkafk/li.git - flags: - - Clone - - Push + empty: {} config: flags: [] repos: @@ -32,6 +17,22 @@ categories: flags: - Clone - Push + utils: + repos: + li: + name: li + path: /home/ces/org/src/git/ + url: git@github.com:cafkafk/li.git + flags: + - Clone + - Push + gg: + name: gg + path: /home/ces/.dots/ + url: git@github.com:cafkafk/gg.git + flags: + - Clone + - Push links: - name: gg rx: /home/ces/.config/gg -- 2.46.0 From ee8e546b22c620bc3b3f8820be6bcc5bae5a6a97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christina=20S=C3=B8rensen?= Date: Sun, 2 Jul 2023 11:37:23 +0200 Subject: [PATCH 6/7] feat(git): made repo flags optional MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This finalizes the roadmap item of making certain fields optional. Very nice! Signed-off-by: Christina Sørensen --- Cargo.toml | 2 +- doc/roadmap.org | 4 ++-- src/git.rs | 20 ++++++++++++++++++-- src/main.rs | 2 +- src/test/config.yaml | 11 +++++++++++ src/test/test.yaml | 45 +++++++++++++++++++++++++++----------------- 6 files changed, 61 insertions(+), 23 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4536876..3000428 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "gg" version = "0.0.6" edition = "2021" -authors = ["Christina Sørensen "] +authors = ["Christina Sørensen"] repository = "https://github.com/cafkafk/gg" license = "GPL-3.0-only" diff --git a/doc/roadmap.org b/doc/roadmap.org index eba028b..438ad75 100644 --- a/doc/roadmap.org +++ b/doc/roadmap.org @@ -5,11 +5,11 @@ - [ ] Generic repositories - [ ] Version pinning - [ ] libgit2 (maybe) -* 0.1.0 [40%] [2/5] +* 0.1.0 [60%] [3/5] - [X] No functionality regressions - [X] commit works in quick, fast - [X] commit with edit works - [X] Repo Flags Finished - [ ] Category Flags Finished -- [-] Optional Fields +- [X] Optional Fields - [ ] Subcommands diff --git a/src/git.rs b/src/git.rs index a5c86e2..53e093c 100644 --- a/src/git.rs +++ b/src/git.rs @@ -92,7 +92,8 @@ pub struct GitRepo { pub name: String, pub path: String, pub url: String, - pub flags: Vec, + #[serde(skip_serializing_if = "Option::is_none")] + pub flags: Option>, } //////////////////////////////////// @@ -157,7 +158,12 @@ impl Links { impl GitRepo { /// Clones the repository to its specified folder. fn clone(&self) -> bool { - if self.flags.contains(&RepoFlags::Clone) { + if self + .flags + .as_ref() + .expect("failed to unwrap flags") + .contains(&RepoFlags::Clone) + { // TODO: check if &self.name already exists in dir let output = Command::new("git") .current_dir(&self.path) @@ -176,6 +182,8 @@ impl GitRepo { fn pull(&self) -> bool { if self .flags + .as_ref() + .expect("failed to unwrap flags") .iter() .any(|s| s == &RepoFlags::Pull || s == &RepoFlags::Fast) { @@ -194,6 +202,8 @@ impl GitRepo { fn add_all(&self) -> bool { if self .flags + .as_ref() + .expect("failed to unwrap flags") .iter() .any(|s| s == &RepoFlags::Add || s == &RepoFlags::Quick || s == &RepoFlags::Fast) { @@ -220,6 +230,8 @@ impl GitRepo { fn commit(&self) -> bool { if self .flags + .as_ref() + .expect("failed to unwrap flags") .iter() .any(|s| s == &RepoFlags::Commit || s == &RepoFlags::Quick || s == &RepoFlags::Fast) { @@ -238,6 +250,8 @@ impl GitRepo { fn commit_with_msg(&self, msg: &str) -> bool { if self .flags + .as_ref() + .expect("failed to unwrap flags") .iter() .any(|s| s == &RepoFlags::Commit || s == &RepoFlags::Quick || s == &RepoFlags::Fast) { @@ -258,6 +272,8 @@ impl GitRepo { fn push(&self) -> bool { if self .flags + .as_ref() + .expect("failed to unwrap flags") .iter() .any(|s| s == &RepoFlags::Push || s == &RepoFlags::Quick || s == &RepoFlags::Fast) { diff --git a/src/main.rs b/src/main.rs index c886a5f..6012201 100644 --- a/src/main.rs +++ b/src/main.rs @@ -150,7 +150,7 @@ mod config { name: "test repo".to_string(), path: "/tmp".to_string(), url: "https://github.com/cafkafk/gg".to_string(), - flags: vec![Clone, Push], + flags: Some(vec![Clone, Push]), }, ); } diff --git a/src/test/config.yaml b/src/test/config.yaml index dc7960d..54dcaac 100644 --- a/src/test/config.yaml +++ b/src/test/config.yaml @@ -25,6 +25,17 @@ categories: url: git@github.com:cafkafk/li.git flags: [Clone, Push] empty: + stuff: + flags: [] + repos: + gg: + name: gg + path: /home/ces/.dots/ + url: git@github.com:cafkafk/gg.git + li: + name: li + path: /home/ces/org/src/git/ + url: git@github.com:cafkafk/li.git links: - name: gg rx: /home/ces/.config/gg diff --git a/src/test/test.yaml b/src/test/test.yaml index 369371d..b5b3327 100644 --- a/src/test/test.yaml +++ b/src/test/test.yaml @@ -1,5 +1,31 @@ categories: - empty: {} + utils: + repos: + li: + name: li + path: /home/ces/org/src/git/ + url: git@github.com:cafkafk/li.git + flags: + - Clone + - Push + gg: + name: gg + path: /home/ces/.dots/ + url: git@github.com:cafkafk/gg.git + flags: + - Clone + - Push + stuff: + flags: [] + repos: + li: + name: li + path: /home/ces/org/src/git/ + url: git@github.com:cafkafk/li.git + gg: + name: gg + path: /home/ces/.dots/ + url: git@github.com:cafkafk/gg.git config: flags: [] repos: @@ -17,22 +43,7 @@ categories: flags: - Clone - Push - utils: - repos: - li: - name: li - path: /home/ces/org/src/git/ - url: git@github.com:cafkafk/li.git - flags: - - Clone - - Push - gg: - name: gg - path: /home/ces/.dots/ - url: git@github.com:cafkafk/gg.git - flags: - - Clone - - Push + empty: {} links: - name: gg rx: /home/ces/.config/gg -- 2.46.0 From d5b4a03f940140c525e09c6cf25e010ac833a9fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christina=20S=C3=B8rensen?= Date: Sun, 2 Jul 2023 12:02:35 +0200 Subject: [PATCH 7/7] chore(version): bump to 0.0.7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - made certain fields optional in config - added CHANGELOG.md - started tagging versions Signed-off-by: Christina Sørensen --- CHANGELOG.md | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++ Cargo.toml | 2 +- 2 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..68c6505 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,77 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +## [0.0.7] - 2023-07-02 + +### Bug Fixes + +- Changed config.yaml location +- Increased scope of push field +- Remove potentially destructive operaton +- Fixed mini-license typos +- Fixed testing with hashmap arch +- Spinner on all repoactions +- Fixed commit in quick +- [**breaking**] Fixed quick, fast messages +- Fixed commit with editor regression + +### Documentation + +- Architectural Overview +- Moved charts to doc/img +- Update image locations +- Moved ARCHITECTURE.md to doc/ +- Added some documentation +- Added roadmap +- Added git cliff config + +### Features + +- Started flakification +- Added nix flake #5 +- [**breaking**] Add push field +- [**breaking**] Add repo flags +- [**breaking**] Implemented naive categories +- Started work on using spinners +- Added pull flag +- React to exit code of git +- Started adding multi instruction logic +- Added fast subcommand +- Add Commit, Add flags +- [**breaking**] Added Quick, Fast flags +- Made category flags optional +- Made categories.repo optional +- Made repo flags optional + +### Miscellaneous Tasks + +- Version bump to v0.0.3 +- Moved install scripts to ./bin +- Merge 0.0.6 +- Bump to 0.0.7 + +### Refactor + +- Fixed various clippy errors +- Removed unused code from flake +- Improved GitRepo assoc. function debug +- Removed redundant line in Cargo.toml +- Created on_all for config struct +- Naive nested hashmap +- Generic refactor + +### Security + +- Removed atty dependency +- Removed atty dependency + +### Testing + +- Removed unused ./test dir + +### WIP + +- Mvp flake working + + diff --git a/Cargo.toml b/Cargo.toml index 3000428..6212798 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "gg" -version = "0.0.6" +version = "0.0.7" edition = "2021" authors = ["Christina Sørensen"] repository = "https://github.com/cafkafk/gg" -- 2.46.0