summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Doane <jaydoane@apache.org>2019-12-17 23:05:43 -0800
committerJay Doane <jaydoane@apache.org>2019-12-17 23:05:43 -0800
commitc5d24d8417503ff81a0670d41524799b4ed38e5e (patch)
tree680dce808bd23f6b139a655982b39f6fa85af05b
parent98c474598cef1e90b0892e53be1ce324959a13f8 (diff)
downloadcouchdb-c5d24d8417503ff81a0670d41524799b4ed38e5e.tar.gz
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.
-rwxr-xr-xconfigure8
1 files changed, 8 insertions, 0 deletions
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."