mirror of
https://github.com/tj/git-extras.git
synced 2026-09-13 00:46:26 -04:00
Allow to run git-extras within git-bulk (#1008)
Co-authored-by: guenthgr <guenther.grill@frauscher.com> Fix https://github.com/tj/git-extras/issues/1007
This commit is contained in:
parent
960ec8d2fd
commit
7c4152ce83
|
|
@ -133,12 +133,15 @@ function executBulkOp () {
|
|||
eval cd "\"$rwsdir\""
|
||||
local actual=$(pwd)
|
||||
[ "${quiet?}" != "false" ] && echo 1>&2 "Executing bulk operation in workspace ${inverse}$actual${reset}"
|
||||
eval find -L . -name ".git" | while read line; do
|
||||
|
||||
allGitFolders=( $(eval find -L . -name ".git") )
|
||||
|
||||
for line in ${allGitFolders[@]}; do
|
||||
local gitrepodir=${line::${#line}-5} # cut the .git part of find results to have the root git directory of that repository
|
||||
eval cd "\"$gitrepodir\"" # into git repo location
|
||||
local curdir=$(pwd)
|
||||
local leadingpath=${curdir#${actual}}
|
||||
[ "${quiet?}" != "false" ] && echo 1>&2 "Current repository: ${leadingpath%/*}/${bldred}${curdir##*/}${reset}"
|
||||
[ "${quiet?}" != "false" ] && echo 1>&2 "Current repository: ${leadingpath%/*}/${bldred}${curdir##*/}${reset}"
|
||||
guardedExecution "$@"
|
||||
eval cd "\"$rwsdir\"" # back to origin location of last find command
|
||||
done
|
||||
|
|
|
|||
|
|
@ -44,8 +44,8 @@ fi
|
|||
if [ -n "$SUMMARY_BY_LINE" ]; then
|
||||
paths=( "$@" )
|
||||
else
|
||||
commit=""
|
||||
test $# -ne 0 && commit=$*
|
||||
commit="HEAD"
|
||||
[ $# -ne 0 ] && commit=$*
|
||||
fi
|
||||
project=${PWD##*/}
|
||||
|
||||
|
|
@ -191,13 +191,14 @@ if [ -n "$SUMMARY_BY_LINE" ]; then
|
|||
echo " authors :"
|
||||
lines "${paths[@]}" | sort | uniq -c | sort -rn | format_authors
|
||||
else
|
||||
|
||||
echo " repo age : $(repository_age)"
|
||||
# shellcheck disable=SC2086
|
||||
echo " active : $(active_days $commit) days"
|
||||
# shellcheck disable=SC2086
|
||||
echo " commits : $(commit_count $commit)"
|
||||
if test "$commit" = ""; then
|
||||
|
||||
# The file count doesn't support passing a git ref so ignore it if a ref is given
|
||||
if [ "$commit" == "HEAD" ]; then
|
||||
echo " files : $(file_count)"
|
||||
fi
|
||||
echo " authors : "
|
||||
|
|
|
|||
Loading…
Reference in a new issue