Re: [PATCH v6+ 4/7] scalar: implement `scalar diagnose`
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 10, 2022, 16:44 UTC
- Message-ID
- <xmqqpmjgfoxm.fsf@gitster.g>
- In-Reply-To
- <220610.86ilp9s1x7.gmgdl@evledraar.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 21 quoted lines
> On Sat, May 28 2022, Junio C Hamano wrote: > >> From: Johannes Schindelin <johannes.schindelin@gmx.de> >> [...] >> 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.