From aca39219fb6bc5ff7a5932e2dbd00bc98c6c6d52 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Sat, 13 Jan 2018 03:26:55 +0000 Subject: [PATCH] bin/nb-update --- bin/nb-update | 15 +++++++++++++++ etc/profile.d/git.sh | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/bin/nb-update b/bin/nb-update index afc8c20d..385d2fd4 100755 --- a/bin/nb-update +++ b/bin/nb-update @@ -28,15 +28,30 @@ export GIT_SSH="$TMP" # # Repos # +filter_name="$@" for repo in $(nb_repos); do [ -d "$repo/.git" ] || continue cd "$repo" || continue + # name from git not from path name=$(git_name) || continue [ -z "$name" ] && continue #name="$(basename $repo)" + + # args filter on name + if [ -n "$filter_name" ]; then + match=0 + for i in $@; do + case "$name" in + $i) match=1; break ;; + #*) echo ">$i!=$name" ;; + esac + done + [ "$match" = "1" ] || continue + fi + branch=$(git_branch) || continue [ -z "$branch" ] && continue diff --git a/etc/profile.d/git.sh b/etc/profile.d/git.sh index 1f3a7073..7ea9cdce 100644 --- a/etc/profile.d/git.sh +++ b/etc/profile.d/git.sh @@ -8,7 +8,7 @@ unset -f git_create_branch 2>&1 | true alias git_grep="git grep --color=auto" alias git_ls_tree="git ls-tree --full-tree -r HEAD" -alias git_ls_files="git ls-files" +alias git_ls_files="git ls-files --full-name" git_new_branch() { git checkout -b "$1" -- 2.47.3