From c5d24d8417503ff81a0670d41524799b4ed38e5e Mon Sep 17 00:00:00 2001 From: Jay Doane Date: Tue, 17 Dec 2019 23:05:43 -0800 Subject: Warn about orphan .git directories A .git directory found in src/ usually indicates that the code in the enclosing directory is managed from said .git directory. This can lead to confusion, and developers opening PRs against obsolete repos when, as happens frequently, a formerly separate repository becomes integrated into the primary repo. This patch changes the configure script to warn when it finds such .git directories. Example output: $ ./configure --dev --skip-deps ==> configuring couchdb in rel/couchdb.config WARNING unexpected .git directory src/couch_tests/.git WARNING unexpected .git directory src/rexi/.git WARNING unexpected .git directory src/mem3/.git WARNING unexpected .git directory src/smoosh/.git WARNING unexpected .git directory src/couch_mrview/.git WARNING unexpected .git directory src/couch/.git WARNING unexpected .git directory src/couch_replicator/.git WARNING unexpected .git directory src/ddoc_cache/.git WARNING unexpected .git directory src/couch_peruser/.git WARNING unexpected .git directory src/setup/.git WARNING unexpected .git directory src/couch_log/.git WARNING unexpected .git directory src/couch_epi/.git WARNING unexpected .git directory src/mango/.git WARNING unexpected .git directory src/chttpd/.git WARNING unexpected .git directory src/couch_stats/.git WARNING unexpected .git directory src/global_changes/.git WARNING unexpected .git directory src/couch_event/.git WARNING unexpected .git directory src/fabric/.git WARNING unexpected .git directory src/couch_plugins/.git WARNING unexpected .git directory src/ken/.git WARNING unexpected .git directory src/couch_index/.git You have configured Apache CouchDB, time to relax. Relax. --- configure | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/configure b/configure index bcd761903..defe145d0 100755 --- a/configure +++ b/configure @@ -237,4 +237,12 @@ if [ -d .git -a $SKIP_DEPS -ne 1 ]; then ${REBAR} get-deps update-deps fi +# External repos frequently become integrated with the primary repo, +# resulting in obsolete .git directories, and possible confusion. +# It is usually a good idea to delete these .git directories. +for path in $(find src -name .git -type d); do + git ls-files --error-unmatch $(dirname $path) > /dev/null 2>&1 && \ + echo "WARNING unexpected .git directory $path" +done + echo "You have configured Apache CouchDB, time to relax. Relax." -- cgit v1.2.1