about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2020-02-02 10:23:50 +0100
committerGitHub <noreply@github.com>2020-02-02 10:23:50 +0100
commit5de5d753bab7bac3e07003443e26766fde39b197 (patch)
tree7e1ba8a4f657fb5836e3494a9f17ffff81e0bfd6
parent3afa921423a5044591cfcef8caac9ef225e1c28e (diff)
parent4d67e30713972b7404f5a9fc29017c3c694ccc08 (diff)
downloadnixlib-5de5d753bab7bac3e07003443e26766fde39b197.tar
nixlib-5de5d753bab7bac3e07003443e26766fde39b197.tar.gz
nixlib-5de5d753bab7bac3e07003443e26766fde39b197.tar.bz2
nixlib-5de5d753bab7bac3e07003443e26766fde39b197.tar.lz
nixlib-5de5d753bab7bac3e07003443e26766fde39b197.tar.xz
nixlib-5de5d753bab7bac3e07003443e26766fde39b197.tar.zst
nixlib-5de5d753bab7bac3e07003443e26766fde39b197.zip
Merge pull request #79078 from masaeedu/git-interactive-rebase-tool
gitAndTools.git-interactive-rebase-tool: init
-rw-r--r--maintainers/maintainer-list.nix6
-rw-r--r--pkgs/applications/version-management/git-and-tools/default.nix2
-rw-r--r--pkgs/applications/version-management/git-and-tools/git-interactive-rebase-tool/01-terminaltests.patch169
-rw-r--r--pkgs/applications/version-management/git-and-tools/git-interactive-rebase-tool/default.nix27
4 files changed, 204 insertions, 0 deletions
diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix
index b55f44c1d612..fe887b9d7cee 100644
--- a/maintainers/maintainer-list.nix
+++ b/maintainers/maintainer-list.nix
@@ -8004,4 +8004,10 @@
     githubId = 56247270;
     name = "Foxit";
   };
+  masaeedu = {
+    email = "masaeedu@gmail.com";
+    github = "masaeedu";
+    githubId = 3674056;
+    name = "Asad Saeeduddin";
+  };
 }
diff --git a/pkgs/applications/version-management/git-and-tools/default.nix b/pkgs/applications/version-management/git-and-tools/default.nix
index c6e046ea45bc..3a68f7903822 100644
--- a/pkgs/applications/version-management/git-and-tools/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/default.nix
@@ -103,6 +103,8 @@ let
 
   git-imerge = callPackage ./git-imerge { };
 
+  git-interactive-rebase-tool = callPackage ./git-interactive-rebase-tool {};
+
   git-machete = python3Packages.callPackage ./git-machete { };
 
   git-octopus = callPackage ./git-octopus { };
diff --git a/pkgs/applications/version-management/git-and-tools/git-interactive-rebase-tool/01-terminaltests.patch b/pkgs/applications/version-management/git-and-tools/git-interactive-rebase-tool/01-terminaltests.patch
new file mode 100644
index 000000000000..1bbae6dc01a7
--- /dev/null
+++ b/pkgs/applications/version-management/git-and-tools/git-interactive-rebase-tool/01-terminaltests.patch
@@ -0,0 +1,169 @@
+--- a/src/display/utils.rs
++++ b/src/display/utils.rs
+@@ -53,166 +53,3 @@
+ 		_ => ColorMode::TwoTone,
+ 	}
+ }
+-
+-#[cfg(all(windows, test))]
+-mod tests {
+-	use crate::display::color_mode::ColorMode;
+-	use crate::display::utils::detect_color_mode;
+-
+-	#[test]
+-	fn detect_color_mode_windows() {
+-		assert_eq!(detect_color_mode(2), ColorMode::ThreeBit);
+-	}
+-}
+-
+-#[cfg(all(unix, test))]
+-mod tests {
+-	use crate::display::color_mode::ColorMode;
+-	use crate::display::utils::detect_color_mode;
+-	use std::env::{remove_var, set_var};
+-
+-	fn clear_env() {
+-		remove_var("COLORTERM");
+-		remove_var("VTE_VERSION");
+-		remove_var("TERM_PROGRAM");
+-		remove_var("TERM");
+-	}
+-
+-	#[test]
+-	fn detect_color_mode_no_env_2_colors() {
+-		clear_env();
+-		assert_eq!(detect_color_mode(2), ColorMode::TwoTone);
+-	}
+-
+-	#[test]
+-	fn detect_color_mode_no_env_8_colors() {
+-		clear_env();
+-		assert_eq!(detect_color_mode(8), ColorMode::ThreeBit);
+-	}
+-
+-	#[test]
+-	fn detect_color_mode_no_env_less_8_colors() {
+-		clear_env();
+-		assert_eq!(detect_color_mode(7), ColorMode::TwoTone);
+-	}
+-
+-	#[test]
+-	fn detect_color_mode_no_env_16_colors() {
+-		clear_env();
+-		assert_eq!(detect_color_mode(16), ColorMode::FourBit);
+-	}
+-
+-	#[test]
+-	fn detect_color_mode_no_env_less_16_colors() {
+-		clear_env();
+-		assert_eq!(detect_color_mode(15), ColorMode::ThreeBit);
+-	}
+-
+-	#[test]
+-	fn detect_color_mode_no_env_256_colors() {
+-		clear_env();
+-		assert_eq!(detect_color_mode(256), ColorMode::EightBit);
+-	}
+-
+-	#[test]
+-	fn detect_color_mode_no_env_less_256_colors() {
+-		clear_env();
+-		assert_eq!(detect_color_mode(255), ColorMode::FourBit);
+-	}
+-
+-	#[test]
+-	fn detect_color_mode_no_env_more_256_colors() {
+-		clear_env();
+-		assert_eq!(detect_color_mode(257), ColorMode::EightBit);
+-	}
+-
+-	#[test]
+-	fn detect_color_mode_term_env_no_256() {
+-		clear_env();
+-		set_var("TERM", "XTERM");
+-		assert_eq!(detect_color_mode(0), ColorMode::TwoTone);
+-	}
+-
+-	#[test]
+-	fn detect_color_mode_term_env_with_256() {
+-		clear_env();
+-		set_var("TERM", "XTERM-256");
+-		assert_eq!(detect_color_mode(0), ColorMode::EightBit);
+-	}
+-
+-	#[test]
+-	fn detect_color_mode_term_program_env_apple_terminal() {
+-		clear_env();
+-		set_var("TERM_PROGRAM", "Apple_Terminal");
+-		assert_eq!(detect_color_mode(0), ColorMode::EightBit);
+-	}
+-
+-	#[test]
+-	fn detect_color_mode_term_program_env_iterm() {
+-		clear_env();
+-		set_var("TERM_PROGRAM", "iTerm.app");
+-		assert_eq!(detect_color_mode(0), ColorMode::EightBit);
+-	}
+-
+-	#[test]
+-	fn detect_color_mode_term_program_env_other() {
+-		clear_env();
+-		set_var("TERM_PROGRAM", "other");
+-		assert_eq!(detect_color_mode(0), ColorMode::TwoTone);
+-	}
+-
+-	#[test]
+-	fn detect_color_mode_vte_version_0_36_00() {
+-		clear_env();
+-		set_var("VTE_VERSION", "3600");
+-		assert_eq!(detect_color_mode(0), ColorMode::TrueColor);
+-	}
+-
+-	#[test]
+-	fn detect_color_mode_vte_version_greater_0_36_00() {
+-		clear_env();
+-		set_var("VTE_VERSION", "3601");
+-		assert_eq!(detect_color_mode(0), ColorMode::TrueColor);
+-	}
+-
+-	#[test]
+-	fn detect_color_mode_vte_version_less_0_36_00() {
+-		clear_env();
+-		set_var("VTE_VERSION", "1");
+-		assert_eq!(detect_color_mode(0), ColorMode::EightBit);
+-	}
+-
+-	#[test]
+-	fn detect_color_mode_vte_version_0() {
+-		clear_env();
+-		set_var("VTE_VERSION", "0");
+-		assert_eq!(detect_color_mode(0), ColorMode::TwoTone);
+-	}
+-	#[test]
+-	fn detect_color_mode_vte_version_invalid() {
+-		clear_env();
+-		set_var("VTE_VERSION", "invalid");
+-		assert_eq!(detect_color_mode(0), ColorMode::TwoTone);
+-	}
+-
+-	#[test]
+-	fn detect_color_mode_colorterm_env_is_truecolor() {
+-		clear_env();
+-		set_var("COLORTERM", "truecolor");
+-		assert_eq!(detect_color_mode(0), ColorMode::TrueColor);
+-	}
+-
+-	#[test]
+-	fn detect_color_mode_colorterm_env_is_24bit() {
+-		clear_env();
+-		set_var("COLORTERM", "24bit");
+-		assert_eq!(detect_color_mode(0), ColorMode::TrueColor);
+-	}
+-
+-	#[test]
+-	fn detect_color_mode_colorterm_env_is_other() {
+-		clear_env();
+-		set_var("COLORTERM", "other");
+-		assert_eq!(detect_color_mode(0), ColorMode::TwoTone);
+-	}
+-}
diff --git a/pkgs/applications/version-management/git-and-tools/git-interactive-rebase-tool/default.nix b/pkgs/applications/version-management/git-and-tools/git-interactive-rebase-tool/default.nix
new file mode 100644
index 000000000000..81b4486d569f
--- /dev/null
+++ b/pkgs/applications/version-management/git-and-tools/git-interactive-rebase-tool/default.nix
@@ -0,0 +1,27 @@
+{ lib, ncurses5, fetchFromGitHub, rustPlatform }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "git-interactive-rebase-tool";
+  version = "1.2.1";
+
+  src = fetchFromGitHub {
+    owner = "MitMaro";
+    repo = pname;
+    rev = version;
+    sha256 = "10z3di2qypgsmg2z7xfs9nlrf9vng5i7l8dvqadv1l4lb9zz7i8q";
+  };
+
+  patches = [ ./01-terminaltests.patch ];
+
+  cargoSha256 = "002kr52vlpv1rhnxki29xflpmgk6bszrw0dsxcc34kyal0593ajk";
+
+  buildInputs = [ ncurses5 ];
+
+  meta = with lib; {
+    homepage = "https://github.com/MitMaro/git-interactive-rebase-tool";
+    description = "Native cross platform full feature terminal based sequence editor for git interactive rebase";
+    changelog = "https://github.com/MitMaro/git-interactive-rebase-tool/releases/tag/${version}";
+    license = licenses.mit;
+    maintainers = with maintainers; [ masaeedu ];
+  };
+}