From d0e1480958985bb8d84cba626076f8f8a3c85344 Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Wed, 25 May 2022 19:16:45 -0400 Subject: [PATCH] branchy recurses! yeah! now a more expected behavior is exhibited if current directory has several repositories under it; each repo below or at current dir will be found (subject to depth limit). --- scripts/files/safedel.pl | 2 +- scripts/rev_control/branchy.sh | 32 ++++++++++++++++++++++--------- scripts/rev_control/diff_repos.sh | 2 ++ 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/scripts/files/safedel.pl b/scripts/files/safedel.pl index ef4ffcb4..010cd959 100644 --- a/scripts/files/safedel.pl +++ b/scripts/files/safedel.pl @@ -63,7 +63,7 @@ exit 0; sub safedel { # get the list of files and directories to whack. local(@to_delete) = &glob_list(@_); -# print "final list of whackees: @to_delete\n"; +print "list of whackees: @to_delete\n"; # we store the deleted files in a directory under the temporary directory. if (! -d $TMP) { diff --git a/scripts/rev_control/branchy.sh b/scripts/rev_control/branchy.sh index 15ec7702..98e21387 100644 --- a/scripts/rev_control/branchy.sh +++ b/scripts/rev_control/branchy.sh @@ -1,7 +1,7 @@ #!/bin/bash -# branchy: lists the branches active on all of the folders present in the -# REPOSITORY_LIST variable or in paths provided on the command line. +# branchy: lists the branches active on all of the paths provided on the command line. +# if no directory is specified, this defaults to operating on the current directory. source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh" source "$FEISTY_MEOW_SCRIPTS/rev_control/version_control.sh" @@ -10,15 +10,29 @@ save_terminal_title ############## -FULL_LIST="$@" - -# use the current directory if no paths were provided. -if [ -z "$FULL_LIST" ]; then - FULL_LIST="." +## holding old implem: +#FULL_LIST="$@" +## use the current directory if no paths were provided. +#if [ -z "$FULL_LIST" ]; then +# FULL_LIST="." +#fi# +#show_active_branch $FULL_LIST +#exit_on_error "showing branches: $FULL_LIST" + +dir="$1"; shift +if [ -z "$dir" ]; then + dir=. fi -show_active_branch $FULL_LIST -exit_on_error "showing branches: $FULL_LIST" +pushd "$dir" &>/dev/null +exit_on_error "changing to directory: $dir" +tempfile=$(generate_rev_ctrl_filelist) +popd &>/dev/null + +perform_revctrl_action_on_file "$tempfile" show_active_branch +exit_on_error "performing revision control action show_active_branch on: $tempfile" + +rm "$tempfile" ############## diff --git a/scripts/rev_control/diff_repos.sh b/scripts/rev_control/diff_repos.sh index 5a6cf750..340a5105 100644 --- a/scripts/rev_control/diff_repos.sh +++ b/scripts/rev_control/diff_repos.sh @@ -27,5 +27,7 @@ exit_on_error "performing revision control action do_revctrl_diff on: $tempfile" rm "$tempfile" +############## + restore_terminal_title -- 2.34.1