From: Junio C Hamano Date: Fri, 10 Jun 2022 16:44:53 GMT Subject: Re: [PATCH v6+ 4/7] scalar: implement `scalar diagnose` Message-ID: In-Reply-To: <220610.86ilp9s1x7.gmgdl@evledraar.gmail.com> Ævar Arnfjörð Bjarmason writes: > On Sat, May 28 2022, Junio C Hamano wrote: > >> From: Johannes Schindelin >> [...] >> The `diagnose` command is the culmination of this hard-won knowledge: it >> gathers the installed hooks, the config, a couple statistics describing >> the data shape, among other pieces of information, and then wraps >> everything up in a tidy, neat `.zip` archive. >> [...] >> + if ((res = add_directory_to_archiver(&archiver_args, ".git", 0)) || >> + (res = add_directory_to_archiver(&archiver_args, ".git/hooks", 0)) || >> + (res = add_directory_to_archiver(&archiver_args, ".git/info", 0)) || >> + (res = add_directory_to_archiver(&archiver_args, ".git/logs", 1)) || >> + (res = add_directory_to_archiver(&archiver_args, ".git/objects/info", 0))) >> + goto diagnose_cleanup; > > Noticed on top of some local changes I have to not add a > .git/hooks (the --no-template topic), but this fails to diagnose > any repo that doesn't have these paths, which are optional, either > because a user could have manually removed them, or used > --template=. Quite honestly, if it lacks any directory that we traditionally created upon "git init", with our standard templates, we can and should call such a repository "broken" and move on.