mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 03:53:32 +01:00
scm.sh ls-files: Support -a (all files)
scm.sh ls-files by defaults does not list the VSC metadata files. Passing -a includes them in the output. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
016c1f4220
commit
e55793f61a
1 changed files with 17 additions and 1 deletions
|
|
@ -76,6 +76,13 @@ cmd_ls_files()
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
output_find()
|
||||||
|
{
|
||||||
|
local find_opts f
|
||||||
|
[ "$zero_terminate" = 1 ] && find_opts="-print0"
|
||||||
|
find "$@" $find_opts
|
||||||
|
}
|
||||||
|
|
||||||
output()
|
output()
|
||||||
{
|
{
|
||||||
if [ "$zero_terminate" = 1 ]; then
|
if [ "$zero_terminate" = 1 ]; then
|
||||||
|
|
@ -100,6 +107,9 @@ cmd_ls_files()
|
||||||
for f in $files; do
|
for f in $files; do
|
||||||
output "$1/$f"
|
output "$1/$f"
|
||||||
done
|
done
|
||||||
|
if [ "$include_vcs_files" = 1 -a -d CVS ]; then
|
||||||
|
output_find "$1/CVS"
|
||||||
|
fi
|
||||||
for d in $dirs; do
|
for d in $dirs; do
|
||||||
[ "$opt_only_regular_files" = 1 ] || output $1/$d
|
[ "$opt_only_regular_files" = 1 ] || output $1/$d
|
||||||
list_dirents_cvs $1/$d
|
list_dirents_cvs $1/$d
|
||||||
|
|
@ -112,6 +122,9 @@ cmd_ls_files()
|
||||||
git --version | grep -q "version *1" && opt_no_submodules=1
|
git --version | grep -q "version *1" && opt_no_submodules=1
|
||||||
[ "$opt_no_submodules" = 1 ] || opts="$opts --recurse-submodules"
|
[ "$opt_no_submodules" = 1 ] || opts="$opts --recurse-submodules"
|
||||||
git ls-files --recurse-submodules $opts $1
|
git ls-files --recurse-submodules $opts $1
|
||||||
|
if [ "$include_vcs_files" = 1 -a -d .git ]; then
|
||||||
|
output_find .git
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
list_dirents()
|
list_dirents()
|
||||||
|
|
@ -127,7 +140,7 @@ cmd_ls_files()
|
||||||
list_dirents_git $1
|
list_dirents_git $1
|
||||||
}
|
}
|
||||||
|
|
||||||
set -- `getopt fnzt "$@"`
|
set -- `getopt fnzta "$@"`
|
||||||
|
|
||||||
while [ "$1" != -- ]; do
|
while [ "$1" != -- ]; do
|
||||||
case $1 in
|
case $1 in
|
||||||
|
|
@ -145,6 +158,9 @@ cmd_ls_files()
|
||||||
-t)
|
-t)
|
||||||
text_files=1
|
text_files=1
|
||||||
;;
|
;;
|
||||||
|
-a)
|
||||||
|
include_vcs_files=1
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue