From acc699a567b108db337335d25c5595aa5bad1677 Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Wed, 23 Oct 2024 19:11:38 +0300 Subject: [PATCH] Git: Add search. --- home/program/bash/module/Git.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/home/program/bash/module/Git.nix b/home/program/bash/module/Git.nix index 0151f1e5..1c6b75f0 100644 --- a/home/program/bash/module/Git.nix +++ b/home/program/bash/module/Git.nix @@ -224,6 +224,19 @@ open "''${url}" } + # Search for string in whole git history. + # Usage: git_search + function git_search() { + local target="''${*}" + + if [[ "''${target}" = "" ]]; then + help git_search + return 2 + fi + + git log -p -S "''${target}" + } + # Sign the old commits. 0 to resign from root. # Usage: git_sign [COMMIT_COUNT] function git_sign() {