From 682b6de6772f81749ce489e9996751d66da52185 Mon Sep 17 00:00:00 2001 From: Alexander Lutay Date: Thu, 15 Nov 2018 17:16:01 +0100 Subject: [PATCH] TT#47563 Use '-uall' for 'git status --porcelain' in scripts/services MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There was a fix for the similar issue in Mantis ticket #7577, see commit fc5af3bbb21ba37dc7b56c491decfb4561a969ca for more details. Unfortunately one corner case was missing there: "git status" doesn't show untracked files in untracked folders by default. It requires "-u" option with value "all": >> man git status > ... > -u[], --untracked-files[=] > Show untracked files. > > The mode parameter is used to specify the handling of untracked files. > It is optional: it defaults to all, and if specified, > it must be stuck to the option (e.g. -uno, but not -u no). > > The possible options are: > · no - Show no untracked files. > · normal - Shows untracked files and directories. > · all - Also shows individual files in untracked directories. The ngcpcfg need to see complete path and filename to untracked file to properly detect .services files and execute them (if configs were changed): > root@web01a:/etc# git status > On branch master > nothing to commit, working tree clean > root@web01a:/etc# git status --porcelain | sed 's/^...//' > root@web01a:/etc# touch test1 > root@web01a:/etc# git status --porcelain | sed 's/^...//' > test1 > root@web01a:/etc# mkdir test2 > root@web01a:/etc# touch test2/test2_file > root@web01a:/etc# git status --porcelain | sed 's/^...//' > test1 > test2/ > root@web01a:/etc# git status -uall --porcelain | sed 's/^...//' > test1 > test2/test2_file > root@web01a:/etc# Change-Id: I18286fd76c511061159f90e8aa9841a6e98c7199 --- scripts/services | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/services b/scripts/services index 4125459e..f896c7ea 100755 --- a/scripts/services +++ b/scripts/services @@ -156,7 +156,7 @@ find_all_changed_services() { log_debug "${FUNCNAME[0]}(): Working in ${dir}" pushd "${dir}" >/dev/null - for file in $(git status --porcelain | sed 's/^...//') ; do + for file in $(git status -uall --porcelain | sed 's/^...//') ; do if [[ -r "${file}" ]] && [[ -r "${SERVICES_POOL_BASE}/${dir}/${file}".services ]]; then log_debug "Storing ${SERVICES_POOL_BASE}/${dir}/${file}.services in '${TMPFILE}'" echo "${SERVICES_POOL_BASE}/${dir}/${file}".services