summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMinijackson <minijackson@riseup.net>2023-02-04 15:00:00 +0100
committerMinijackson <minijackson@riseup.net>2023-02-04 15:00:00 +0100
commit19bbf44c673104a7fa5a8d912254e7dd7c993914 (patch)
tree91386d37b32bc7d9692fe7cb02fa85cb8bec618d
parent1be58044a9a17eca349652fcf9db7b0113f663dd (diff)
downloadnixos-config-reborn-19bbf44c673104a7fa5a8d912254e7dd7c993914.tar.gz
nixos-config-reborn-19bbf44c673104a7fa5a8d912254e7dd7c993914.zip
git: install branchless globally, fix `git sw`
-rw-r--r--common/commandline/git.nix7
-rw-r--r--dotfiles/git-branchless.zsh2
2 files changed, 5 insertions, 4 deletions
diff --git a/common/commandline/git.nix b/common/commandline/git.nix
index fb9bed2..7c387c2 100644
--- a/common/commandline/git.nix
+++ b/common/commandline/git.nix
@@ -3,9 +3,10 @@ inputs:
3{ config, pkgs, lib, ... }: 3{ config, pkgs, lib, ... }:
4 4
5{ 5{
6 users.users.minijackson.packages = [pkgs.git-branchless]; 6 environment = {
7 7 systemPackages = [pkgs.git-branchless];
8 environment.shellAliases.git = "git-branchless wrap --"; 8 shellAliases.git = "git-branchless wrap --";
9 };
9 10
10 programs.zsh.interactiveShellInit = '' 11 programs.zsh.interactiveShellInit = ''
11 source ${../../dotfiles/git-branchless.zsh} 12 source ${../../dotfiles/git-branchless.zsh}
diff --git a/dotfiles/git-branchless.zsh b/dotfiles/git-branchless.zsh
index c34b241..4fbf0a1 100644
--- a/dotfiles/git-branchless.zsh
+++ b/dotfiles/git-branchless.zsh
@@ -184,7 +184,7 @@ _git-branchless-switch() {
184 {-c,--create}"[When checking out the target commit, also create a branch with the provided name pointing to that commit]:branch name" \ 184 {-c,--create}"[When checking out the target commit, also create a branch with the provided name pointing to that commit]:branch name" \
185 {-f,--force}"[Forcibly switch commits, discarding any working copy changes if necessary]" \ 185 {-f,--force}"[Forcibly switch commits, discarding any working copy changes if necessary]" \
186 {-m,--merge}"[If the current working copy changes do not apply cleanly to the target commit, start merge conflict resolution instead of aborting]" \ 186 {-m,--merge}"[If the current working copy changes do not apply cleanly to the target commit, start merge conflict resolution instead of aborting]" \
187 "::target:__git_recent_commits" 187 "::target:__git_commits_prefer_recent"
188 return 0 188 return 0
189} 189}
190 190