From 4356f4e8674ad0b49cf40de1b2c783589315db58 Mon Sep 17 00:00:00 2001 From: Sandrine Pataut Date: Tue, 19 Aug 2025 12:03:09 +0200 Subject: [PATCH 1/7] add colours to status subcommand --- src/subcommand/log_subcommand.cpp | 2 +- src/subcommand/status_subcommand.cpp | 85 +++++++++++++++------------- src/utils/common.hpp | 10 +++- 3 files changed, 56 insertions(+), 41 deletions(-) diff --git a/src/subcommand/log_subcommand.cpp b/src/subcommand/log_subcommand.cpp index c25e270..3811485 100644 --- a/src/subcommand/log_subcommand.cpp +++ b/src/subcommand/log_subcommand.cpp @@ -54,7 +54,7 @@ void print_commit(const commit_wrapper& commit, std::string m_format_flag) signature_wrapper author = signature_wrapper::get_commit_author(commit); signature_wrapper committer = signature_wrapper::get_commit_committer(commit); - std::cout << "\033[0;33m" << "commit " << buf << "\033[0m" << std::endl; + std::cout << message_colour.at("yellow") << "commit " << buf << message_colour.at("colour_close") << std::endl; if (m_format_flag=="fuller") { std::cout << "Author:\t " << author.name() << " " << author.email() << std::endl; diff --git a/src/subcommand/status_subcommand.cpp b/src/subcommand/status_subcommand.cpp index 83ebd6d..f07f53f 100644 --- a/src/subcommand/status_subcommand.cpp +++ b/src/subcommand/status_subcommand.cpp @@ -45,16 +45,16 @@ struct status_messages const std::map status_msg_map = //TODO : check spaces in short_mod { { GIT_STATUS_CURRENT, {"", ""} }, - { GIT_STATUS_INDEX_NEW, {"A ", "\t new file:"} }, - { GIT_STATUS_INDEX_MODIFIED, {"M ", "\t modified:"} }, - { GIT_STATUS_INDEX_DELETED, {"D ", "\t deleted:"} }, - { GIT_STATUS_INDEX_RENAMED, {"R ", "\t renamed:"} }, - { GIT_STATUS_INDEX_TYPECHANGE, {"T ", "\t typechange:"} }, + { GIT_STATUS_INDEX_NEW, {"A ", "\tnew file:"} }, + { GIT_STATUS_INDEX_MODIFIED, {"M ", "\tmodified:"} }, + { GIT_STATUS_INDEX_DELETED, {"D ", "\tdeleted:"} }, + { GIT_STATUS_INDEX_RENAMED, {"R ", "\trenamed:"} }, + { GIT_STATUS_INDEX_TYPECHANGE, {"T ", "\ttypechange:"} }, { GIT_STATUS_WT_NEW, {"?? ", ""} }, - { GIT_STATUS_WT_MODIFIED, {" M " , "\t modified:"} }, - { GIT_STATUS_WT_DELETED, {" D ", "\t deleted:"} }, - { GIT_STATUS_WT_TYPECHANGE, {" T ", "\t typechange:"} }, - { GIT_STATUS_WT_RENAMED, {" R ", "\t renamed:"} }, + { GIT_STATUS_WT_MODIFIED, {" M " , "\tmodified:"} }, + { GIT_STATUS_WT_DELETED, {" D ", "\tdeleted:"} }, + { GIT_STATUS_WT_TYPECHANGE, {" T ", "\ttypechange:"} }, + { GIT_STATUS_WT_RENAMED, {" R ", "\trenamed:"} }, { GIT_STATUS_WT_UNREADABLE, {"", ""} }, { GIT_STATUS_IGNORED, {"!! ", ""} }, { GIT_STATUS_CONFLICTED, {"", ""} }, @@ -73,7 +73,7 @@ struct print_entry std::string item; }; -std::string get_print_status(git_status_t status, output_format of) +std::string get_print_status(git_status_t status, output_format of) //TODO: add colours, but depends on the status, so needs another parameter { std::string entry_status; if ((of == output_format::DEFAULT) || (of == output_format::LONG)) @@ -100,7 +100,7 @@ void update_tracked_dir_set(const char* old_path, const char* new_path, std::set } } -std::string get_print_item(const char* old_path, const char* new_path) +std::string get_print_item(const char* old_path, const char* new_path) //TODO: add colours, but depends on the status, so needs another parameter { std::string entry_item; if (old_path && new_path && std::strcmp(old_path, new_path)) @@ -139,16 +139,19 @@ std::vector get_entries_to_print(git_status_t status, status_list_w return entries_to_print; } -void print_entries(std::vector entries_to_print) +void print_entries(std::vector entries_to_print, bool is_long, std::string colour) { for (auto e: entries_to_print) { - std::cout << e.status << e.item << std::endl; + if (is_long) + std::cout << colour << e.status << e.item << message_colour.at("colour_close") << std::endl; + else + std::cout << colour << e.status << message_colour.at("colour_close") << e.item << std::endl; } } void print_not_tracked(const std::vector& entries_to_print, const std::set& tracked_dir_set, - std::set& untracked_dir_set) + std::set& untracked_dir_set, bool is_long, std::string colour) { std::vector not_tracked_entries_to_print{}; for (auto e: entries_to_print) @@ -156,7 +159,7 @@ void print_not_tracked(const std::vector& entries_to_print, const s const size_t first_slash_idx = e.item.find('/'); if (std::string::npos != first_slash_idx) { - auto directory = e.item.substr(0, first_slash_idx); + auto directory = e.item.substr(0, first_slash_idx) + "/"; if (tracked_dir_set.contains(directory)) { not_tracked_entries_to_print.push_back(e); @@ -177,7 +180,7 @@ void print_not_tracked(const std::vector& entries_to_print, const s not_tracked_entries_to_print.push_back(e); } } - print_entries(not_tracked_entries_to_print); + print_entries(not_tracked_entries_to_print, is_long, colour); } void status_subcommand::run() @@ -220,17 +223,19 @@ void status_subcommand::run() std::cout << "## " << branch_name << std::endl; } } + if (sl.has_tobecommited_header()) { + std::string colour = message_colour.at("green"); if (is_long) { std::cout << tobecommited_header << std::endl; } - print_entries(get_entries_to_print(GIT_STATUS_INDEX_NEW, sl, true, of, &tracked_dir_set)); - print_entries(get_entries_to_print(GIT_STATUS_INDEX_MODIFIED, sl, true, of, &tracked_dir_set)); - print_entries(get_entries_to_print(GIT_STATUS_INDEX_DELETED, sl, true, of, &tracked_dir_set)); - print_entries(get_entries_to_print(GIT_STATUS_INDEX_RENAMED, sl, true, of, &tracked_dir_set)); - print_entries(get_entries_to_print(GIT_STATUS_INDEX_TYPECHANGE, sl, true, of, &tracked_dir_set)); + print_entries(get_entries_to_print(GIT_STATUS_INDEX_NEW, sl, true, of, &tracked_dir_set), is_long, colour); + print_entries(get_entries_to_print(GIT_STATUS_INDEX_MODIFIED, sl, true, of, &tracked_dir_set), is_long, colour); + print_entries(get_entries_to_print(GIT_STATUS_INDEX_DELETED, sl, true, of, &tracked_dir_set), is_long, colour); + print_entries(get_entries_to_print(GIT_STATUS_INDEX_RENAMED, sl, true, of, &tracked_dir_set), is_long, colour); + print_entries(get_entries_to_print(GIT_STATUS_INDEX_TYPECHANGE, sl, true, of, &tracked_dir_set), is_long, colour); if (is_long) { std::cout << std::endl; @@ -239,44 +244,46 @@ void status_subcommand::run() if (sl.has_notstagged_header()) { + std::string colour = message_colour.at("red"); if (is_long) { std::cout << notstagged_header << std::endl; } - print_entries(get_entries_to_print(GIT_STATUS_WT_MODIFIED, sl, false, of, &tracked_dir_set)); - print_entries(get_entries_to_print(GIT_STATUS_WT_DELETED, sl, false, of, &tracked_dir_set)); - print_entries(get_entries_to_print(GIT_STATUS_WT_TYPECHANGE, sl, false, of, &tracked_dir_set)); - print_entries(get_entries_to_print(GIT_STATUS_WT_RENAMED, sl, false, of, &tracked_dir_set)); + print_entries(get_entries_to_print(GIT_STATUS_WT_MODIFIED, sl, false, of, &tracked_dir_set), is_long, colour); + print_entries(get_entries_to_print(GIT_STATUS_WT_DELETED, sl, false, of, &tracked_dir_set), is_long, colour); + print_entries(get_entries_to_print(GIT_STATUS_WT_TYPECHANGE, sl, false, of, &tracked_dir_set), is_long, colour); + print_entries(get_entries_to_print(GIT_STATUS_WT_RENAMED, sl, false, of, &tracked_dir_set), is_long, colour); if (is_long) { std::cout << std::endl; } } - if (sl.has_untracked_header()) { + std::string colour = message_colour.at("red"); if (is_long) { std::cout << untracked_header << std::endl; } - print_not_tracked(get_entries_to_print(GIT_STATUS_WT_NEW, sl, false, of), tracked_dir_set, untracked_dir_set); + print_not_tracked(get_entries_to_print(GIT_STATUS_WT_NEW, sl, false, of), tracked_dir_set, untracked_dir_set, is_long, colour); if (is_long) { std::cout << std::endl; } } - if (sl.has_ignored_header()) - { - if (is_long) - { - std::cout << ignored_header << std::endl; - } - print_not_tracked(get_entries_to_print(GIT_STATUS_IGNORED, sl, false, of), tracked_dir_set, untracked_dir_set); - if (is_long) - { - std::cout << std::endl; - } - } + // if (sl.has_ignored_header()) + // { + // std::string colour = message_colour.at("red"); + // if (is_long) + // { + // std::cout << ignored_header << std::endl; + // } + // print_not_tracked(get_entries_to_print(GIT_STATUS_IGNORED, sl, false, of), tracked_dir_set, untracked_dir_set, is_long, colour); + // if (is_long) + // { + // std::cout << std::endl; + // } + // } } diff --git a/src/utils/common.hpp b/src/utils/common.hpp index 44667d8..715ded7 100644 --- a/src/utils/common.hpp +++ b/src/utils/common.hpp @@ -1,7 +1,7 @@ #pragma once +#include #include -#include #include #include @@ -27,6 +27,14 @@ class libgit2_object : private noncopyable_nonmovable ~libgit2_object(); }; +const std::map message_colour = +{ + {"red", "\033[0;31m"}, + {"green", "\033[0;32m"}, + {"yellow", "\033[0;33m"}, + {"colour_close","\033[0m"}, +}; + std::string get_current_git_path(); class git_strarray_wrapper From 3ba11a41b2b08d2d329dee5a1dab4cd9462ee68c Mon Sep 17 00:00:00 2001 From: Sandrine Pataut Date: Mon, 1 Sep 2025 17:35:43 +0200 Subject: [PATCH 2/7] address review comment --- src/subcommand/status_subcommand.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/subcommand/status_subcommand.cpp b/src/subcommand/status_subcommand.cpp index f07f53f..c1080b4 100644 --- a/src/subcommand/status_subcommand.cpp +++ b/src/subcommand/status_subcommand.cpp @@ -78,7 +78,7 @@ std::string get_print_status(git_status_t status, output_format of) //TODO: add std::string entry_status; if ((of == output_format::DEFAULT) || (of == output_format::LONG)) { - entry_status = status_msg_map.at(status).long_mod + "\t"; + entry_status = status_msg_map.at(status).long_mod + " "; } else if (of == output_format::SHORT) { @@ -144,9 +144,13 @@ void print_entries(std::vector entries_to_print, bool is_long, std: for (auto e: entries_to_print) { if (is_long) - std::cout << colour << e.status << e.item << message_colour.at("colour_close") << std::endl; + { + std::cout << colour << e.status << e.item << message_colour.at("colour_close") << std::endl; + } else - std::cout << colour << e.status << message_colour.at("colour_close") << e.item << std::endl; + { + std::cout << colour << e.status << message_colour.at("colour_close") << e.item << std::endl; + } } } From 533d0191f709627006bf1a0b5396201e6031fb50 Mon Sep 17 00:00:00 2001 From: Sandrine Pataut Date: Mon, 1 Sep 2025 17:41:45 +0200 Subject: [PATCH 3/7] remove useless comments --- src/subcommand/status_subcommand.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/subcommand/status_subcommand.cpp b/src/subcommand/status_subcommand.cpp index c1080b4..202f3c2 100644 --- a/src/subcommand/status_subcommand.cpp +++ b/src/subcommand/status_subcommand.cpp @@ -73,7 +73,7 @@ struct print_entry std::string item; }; -std::string get_print_status(git_status_t status, output_format of) //TODO: add colours, but depends on the status, so needs another parameter +std::string get_print_status(git_status_t status, output_format of) { std::string entry_status; if ((of == output_format::DEFAULT) || (of == output_format::LONG)) @@ -100,7 +100,7 @@ void update_tracked_dir_set(const char* old_path, const char* new_path, std::set } } -std::string get_print_item(const char* old_path, const char* new_path) //TODO: add colours, but depends on the status, so needs another parameter +std::string get_print_item(const char* old_path, const char* new_path) { std::string entry_item; if (old_path && new_path && std::strcmp(old_path, new_path)) From 7d2526f65cac7c18f42f686a9bc29ea8f62335b9 Mon Sep 17 00:00:00 2001 From: Sandrine Pataut Date: Thu, 4 Sep 2025 15:30:52 +0200 Subject: [PATCH 4/7] switch to use termcolor --- CMakeLists.txt | 3 ++- dev-environment.yml | 1 + src/subcommand/status_subcommand.cpp | 29 +++++++++++++++------------- src/utils/common.cpp | 2 ++ src/utils/common.hpp | 8 -------- 5 files changed, 21 insertions(+), 22 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2f5acdb..aa4a7ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,6 +33,7 @@ message(STATUS "Building git2cpp v${CMAKE_PROJECT_VERSION}") # ============ find_package(libgit2) +find_package(termcolor) # CLI11 is a single header, not packaged for cmake # Build @@ -86,4 +87,4 @@ set(GIT2CPP_SRC ) add_executable(git2cpp ${GIT2CPP_SRC}) -target_link_libraries(git2cpp PRIVATE libgit2::libgit2package) +target_link_libraries(git2cpp PRIVATE libgit2::libgit2package termcolor::termcolor) diff --git a/dev-environment.yml b/dev-environment.yml index 04f465e..c578ec0 100644 --- a/dev-environment.yml +++ b/dev-environment.yml @@ -8,5 +8,6 @@ dependencies: - pkg-config - python - pytest + - termcolor-cpp # Missing dependency from libgit2 - zlib diff --git a/src/subcommand/status_subcommand.cpp b/src/subcommand/status_subcommand.cpp index 202f3c2..de95b3b 100644 --- a/src/subcommand/status_subcommand.cpp +++ b/src/subcommand/status_subcommand.cpp @@ -4,6 +4,7 @@ #include #include +#include #include "status_subcommand.hpp" #include "../wrapper/status_wrapper.hpp" @@ -139,23 +140,25 @@ std::vector get_entries_to_print(git_status_t status, status_list_w return entries_to_print; } -void print_entries(std::vector entries_to_print, bool is_long, std::string colour) +using str_colour_fn = std::ostream& (*)(std::ostream&); + +void print_entries(std::vector entries_to_print, bool is_long, str_colour_fn colour) { for (auto e: entries_to_print) { if (is_long) { - std::cout << colour << e.status << e.item << message_colour.at("colour_close") << std::endl; + std::cout << colour << e.status << e.item << termcolor::reset << std::endl; } else { - std::cout << colour << e.status << message_colour.at("colour_close") << e.item << std::endl; + std::cout << colour << e.status << termcolor::reset << e.item << std::endl; } } } void print_not_tracked(const std::vector& entries_to_print, const std::set& tracked_dir_set, - std::set& untracked_dir_set, bool is_long, std::string colour) + std::set& untracked_dir_set, bool is_long, str_colour_fn colour) { std::vector not_tracked_entries_to_print{}; for (auto e: entries_to_print) @@ -163,7 +166,7 @@ void print_not_tracked(const std::vector& entries_to_print, const s const size_t first_slash_idx = e.item.find('/'); if (std::string::npos != first_slash_idx) { - auto directory = e.item.substr(0, first_slash_idx) + "/"; + auto directory = "\t" + e.item.substr(0, first_slash_idx) + "/"; if (tracked_dir_set.contains(directory)) { not_tracked_entries_to_print.push_back(e); @@ -230,10 +233,10 @@ void status_subcommand::run() if (sl.has_tobecommited_header()) { - std::string colour = message_colour.at("green"); + str_colour_fn colour = termcolor::green; if (is_long) { - std::cout << tobecommited_header << std::endl; + std::cout << tobecommited_header; } print_entries(get_entries_to_print(GIT_STATUS_INDEX_NEW, sl, true, of, &tracked_dir_set), is_long, colour); print_entries(get_entries_to_print(GIT_STATUS_INDEX_MODIFIED, sl, true, of, &tracked_dir_set), is_long, colour); @@ -248,10 +251,10 @@ void status_subcommand::run() if (sl.has_notstagged_header()) { - std::string colour = message_colour.at("red"); + str_colour_fn colour = termcolor::red; if (is_long) { - std::cout << notstagged_header << std::endl; + std::cout << notstagged_header; } print_entries(get_entries_to_print(GIT_STATUS_WT_MODIFIED, sl, false, of, &tracked_dir_set), is_long, colour); print_entries(get_entries_to_print(GIT_STATUS_WT_DELETED, sl, false, of, &tracked_dir_set), is_long, colour); @@ -265,10 +268,10 @@ void status_subcommand::run() if (sl.has_untracked_header()) { - std::string colour = message_colour.at("red"); + str_colour_fn colour = termcolor::red; if (is_long) { - std::cout << untracked_header << std::endl; + std::cout << untracked_header; } print_not_tracked(get_entries_to_print(GIT_STATUS_WT_NEW, sl, false, of), tracked_dir_set, untracked_dir_set, is_long, colour); if (is_long) @@ -279,10 +282,10 @@ void status_subcommand::run() // if (sl.has_ignored_header()) // { - // std::string colour = message_colour.at("red"); + // str_colour_fn colour = termcolor::red; // if (is_long) // { - // std::cout << ignored_header << std::endl; + // std::cout << ignored_header; // } // print_not_tracked(get_entries_to_print(GIT_STATUS_IGNORED, sl, false, of), tracked_dir_set, untracked_dir_set, is_long, colour); // if (is_long) diff --git a/src/utils/common.cpp b/src/utils/common.cpp index e5d97f4..9a5787c 100644 --- a/src/utils/common.cpp +++ b/src/utils/common.cpp @@ -1,4 +1,6 @@ #include +#include +#include #include diff --git a/src/utils/common.hpp b/src/utils/common.hpp index 715ded7..502deef 100644 --- a/src/utils/common.hpp +++ b/src/utils/common.hpp @@ -27,14 +27,6 @@ class libgit2_object : private noncopyable_nonmovable ~libgit2_object(); }; -const std::map message_colour = -{ - {"red", "\033[0;31m"}, - {"green", "\033[0;32m"}, - {"yellow", "\033[0;33m"}, - {"colour_close","\033[0m"}, -}; - std::string get_current_git_path(); class git_strarray_wrapper From d6855032d3dc572a1aac26f6abac4f0e8caf4250 Mon Sep 17 00:00:00 2001 From: Sandrine Pataut Date: Thu, 4 Sep 2025 15:39:49 +0200 Subject: [PATCH 5/7] fix log colour --- src/subcommand/log_subcommand.cpp | 5 ++++- src/subcommand/status_subcommand.cpp | 14 ++++++-------- src/utils/common.hpp | 2 ++ 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/subcommand/log_subcommand.cpp b/src/subcommand/log_subcommand.cpp index 3811485..3565228 100644 --- a/src/subcommand/log_subcommand.cpp +++ b/src/subcommand/log_subcommand.cpp @@ -4,6 +4,8 @@ #include #include +#include + #include "log_subcommand.hpp" #include "../wrapper/repository_wrapper.hpp" #include "../wrapper/commit_wrapper.hpp" @@ -54,7 +56,8 @@ void print_commit(const commit_wrapper& commit, std::string m_format_flag) signature_wrapper author = signature_wrapper::get_commit_author(commit); signature_wrapper committer = signature_wrapper::get_commit_committer(commit); - std::cout << message_colour.at("yellow") << "commit " << buf << message_colour.at("colour_close") << std::endl; + stream_colour_fn colour = termcolor::yellow; + std::cout << colour << "commit " << buf << termcolor::reset << std::endl; if (m_format_flag=="fuller") { std::cout << "Author:\t " << author.name() << " " << author.email() << std::endl; diff --git a/src/subcommand/status_subcommand.cpp b/src/subcommand/status_subcommand.cpp index de95b3b..9aadf7f 100644 --- a/src/subcommand/status_subcommand.cpp +++ b/src/subcommand/status_subcommand.cpp @@ -140,9 +140,7 @@ std::vector get_entries_to_print(git_status_t status, status_list_w return entries_to_print; } -using str_colour_fn = std::ostream& (*)(std::ostream&); - -void print_entries(std::vector entries_to_print, bool is_long, str_colour_fn colour) +void print_entries(std::vector entries_to_print, bool is_long, stream_colour_fn colour) { for (auto e: entries_to_print) { @@ -158,7 +156,7 @@ void print_entries(std::vector entries_to_print, bool is_long, str_ } void print_not_tracked(const std::vector& entries_to_print, const std::set& tracked_dir_set, - std::set& untracked_dir_set, bool is_long, str_colour_fn colour) + std::set& untracked_dir_set, bool is_long, stream_colour_fn colour) { std::vector not_tracked_entries_to_print{}; for (auto e: entries_to_print) @@ -233,7 +231,7 @@ void status_subcommand::run() if (sl.has_tobecommited_header()) { - str_colour_fn colour = termcolor::green; + stream_colour_fn colour = termcolor::green; if (is_long) { std::cout << tobecommited_header; @@ -251,7 +249,7 @@ void status_subcommand::run() if (sl.has_notstagged_header()) { - str_colour_fn colour = termcolor::red; + stream_colour_fn colour = termcolor::red; if (is_long) { std::cout << notstagged_header; @@ -268,7 +266,7 @@ void status_subcommand::run() if (sl.has_untracked_header()) { - str_colour_fn colour = termcolor::red; + stream_colour_fn colour = termcolor::red; if (is_long) { std::cout << untracked_header; @@ -282,7 +280,7 @@ void status_subcommand::run() // if (sl.has_ignored_header()) // { - // str_colour_fn colour = termcolor::red; + // stream_colour_fn colour = termcolor::red; // if (is_long) // { // std::cout << ignored_header; diff --git a/src/utils/common.hpp b/src/utils/common.hpp index 502deef..e3adaa4 100644 --- a/src/utils/common.hpp +++ b/src/utils/common.hpp @@ -29,6 +29,8 @@ class libgit2_object : private noncopyable_nonmovable std::string get_current_git_path(); +using stream_colour_fn = std::ostream& (*)(std::ostream&); + class git_strarray_wrapper { public: From 5734f5d4d7d9b06531d24cb3e71bed955abb8e17 Mon Sep 17 00:00:00 2001 From: Sandrine Pataut Date: Thu, 4 Sep 2025 15:54:52 +0200 Subject: [PATCH 6/7] remove useless include --- src/utils/common.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/utils/common.hpp b/src/utils/common.hpp index e3adaa4..e3b959c 100644 --- a/src/utils/common.hpp +++ b/src/utils/common.hpp @@ -1,6 +1,5 @@ #pragma once -#include #include #include From c9f599b2b70d4731d6930215ce01382cc5ba22ad Mon Sep 17 00:00:00 2001 From: Sandrine Pataut Date: Fri, 5 Sep 2025 09:26:06 +0200 Subject: [PATCH 7/7] remove useleess space --- src/subcommand/status_subcommand.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/subcommand/status_subcommand.cpp b/src/subcommand/status_subcommand.cpp index 9aadf7f..b51f50f 100644 --- a/src/subcommand/status_subcommand.cpp +++ b/src/subcommand/status_subcommand.cpp @@ -231,7 +231,7 @@ void status_subcommand::run() if (sl.has_tobecommited_header()) { - stream_colour_fn colour = termcolor::green; + stream_colour_fn colour = termcolor::green; if (is_long) { std::cout << tobecommited_header;