branchy recurses!
[feisty_meow.git] / scripts / rev_control / branchy.sh
1 #!/bin/bash
2
3 # branchy: lists the branches active on all of the paths provided on the command line.
4 # if no directory is specified, this defaults to operating on the current directory.
5
6 source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
7 source "$FEISTY_MEOW_SCRIPTS/rev_control/version_control.sh"
8
9 save_terminal_title
10
11 ##############
12
13 ## holding old implem:
14 #FULL_LIST="$@"
15 ## use the current directory if no paths were provided.
16 #if [ -z "$FULL_LIST" ]; then
17 #  FULL_LIST="."
18 #fi#
19 #show_active_branch $FULL_LIST
20 #exit_on_error "showing branches: $FULL_LIST"
21
22 dir="$1"; shift
23 if [ -z "$dir" ]; then
24   dir=.
25 fi
26
27 pushd "$dir" &>/dev/null
28 exit_on_error "changing to directory: $dir"
29 tempfile=$(generate_rev_ctrl_filelist)
30 popd &>/dev/null
31
32 perform_revctrl_action_on_file "$tempfile" show_active_branch
33 exit_on_error "performing revision control action show_active_branch on: $tempfile"
34
35 rm "$tempfile"
36
37 ##############
38
39 restore_terminal_title
40