From: Junio C Hamano <gitster@pobox.com>
To: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
Cc: Git mailing list <git@vger.kernel.org>, Patrick Steinhardt <ps@pks.im>
Subject: Re: [PATCH v3 4/5] setup: provide hint about auto-discovery boundaries
Date: Wed, 28 Oct 2026 11:57:27 -0700 [thread overview]
Message-ID: <xmqqa4nxac14.fsf@gitster.g> (raw)
In-Reply-To: <20261028115412.169748-5-kaartic.sivaraam@gmail.com> (Kaartic Sivaraam's message of "Wed, 28 Oct 2026 17:24:02 +0530")
Kaartic Sivaraam <kaartic.sivaraam@gmail.com> writes:
> In the same spirit as the previous commit, we want to improve the UX
> of the Git repository discovery case when the GIT_CEILING_DIRECTORIES
> environment varaible is set. For instance, consider the following
> scenario:
>
> $ cd ~ && git init # dotfiles repo at ~/.git
> $ echo 'export GIT_CEILING_DIRECTORIES=$HOME' >> ~/.bashrc
> # stop ~/.git swallowing every
> # non-repo directory under ~
> ...weeks later...
> $ cd ~/.config/nvim
> $ vim init.lua
> $ git status
> fatal: not a git repository (or any of the parent directories): .git
>
> The error message is a bit unhelpful as the gut reaction of the user
> would be to wonder why their ~/.git directory was not discovered even
> though the message says it checked the parent directories. We can't
> really blame the user for not remembering that they had
> GIT_CEILING_DIRECTORIES configured in their ~/.bashrc.
>
> Improve this error reporting UX by giving an additional hint about the
> ceiling that auto-discovery was bounded by and also mention what
> GIT_CEILING_DIRECTORIES was configured to. With this, the user would
> see the following:
>
> ...
> $ git status
> fatal: not a git repository (or any of the parent directories): .git
> searched from '/home/user/.config/nvim' up to '/home/user/.config'
> $GIT_CEILING_DIRECTORIES is set to '/home/user'
The second line of the output gives a much better information than
before. Stepping back a bit, the "(or any of the ...)" was a weak
and ineffective attempt to say that ".git" we claim is not a valid
repository is not necessarily in the current directory. But would
it be still needed with the more explicit "we looked for it from
here to there"? Can we combine both into a single statement somehow
to make it more concise and understandable?
Here is my attempt. Would this
fatal: no valid repository ".git" found in "/home/user/.config/nvim"
or any of its parent directories up to "/home/user/.config".
or something like that be easier to read?
Of course, such a change would break scripts that attempt to parse
this error message, so even if it is easier for humans, there could
be downside.
> - test_grep "not a git repository (or any of the parent directories)" stderr
> + test_grep "not a git repository (or any of the parent directories)" stderr &&
> + test_grep "searched from .*ceil/sub.*up to.*ceil." stderr &&
> + test_grep "GIT_CEILING_DIRECTORIES is set to" stderr
> )
> '
next prev parent reply other threads:[~2026-10-28 18:57 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-24 12:02 [RFC PATCH 0/3] Improve error reporting to mention "why" a directory is not a repository Kaartic Sivaraam
2026-09-24 12:02 ` [RFC PATCH 1/3] t0009: add tests to cover more error reporting scenarios Kaartic Sivaraam
2026-09-24 22:08 ` Junio C Hamano
2026-09-25 13:46 ` Kaartic Sivaraam
2026-09-24 12:02 ` [RFC PATCH 2/3] setup: introduce new helper 'is_git_directory_verbose' Kaartic Sivaraam
2026-09-24 22:11 ` Junio C Hamano
2026-09-25 17:51 ` Kaartic Sivaraam
2026-09-24 12:02 ` [RFC PATCH 3/3] setup: communicate why a directory is not a valid git directory Kaartic Sivaraam
2026-09-24 22:16 ` Junio C Hamano
2026-09-25 14:33 ` Kaartic Sivaraam
2026-09-29 10:25 ` [RFC PATCH v2 0/4] Improve error reporting to mention "why" a directory is not a repository Kaartic Sivaraam
2026-09-29 10:25 ` [RFC PATCH v2 1/4] setup: normalize an if-else to follow our convention Kaartic Sivaraam
2026-09-29 10:25 ` [RFC PATCH v2 2/4] t0009: add tests to cover more error reporting scenarios Kaartic Sivaraam
2026-09-29 10:25 ` [RFC PATCH v2 3/4] setup: introduce new helper 'is_git_directory_verbose' Kaartic Sivaraam
2026-09-30 16:03 ` Patrick Steinhardt
2026-10-05 12:14 ` Kaartic Sivaraam
2026-09-30 18:32 ` Junio C Hamano
2026-10-28 11:57 ` Kaartic Sivaraam
2026-09-29 10:25 ` [RFC PATCH v2 4/4] setup: communicate why a directory is not a valid git directory Kaartic Sivaraam
2026-09-30 16:03 ` Patrick Steinhardt
2026-10-05 12:29 ` Kaartic Sivaraam
2026-10-28 11:53 ` [PATCH v3 0/5] Improve error reporting to mention how a Git repository is discovered Kaartic Sivaraam
2026-10-28 11:53 ` [PATCH v3 1/5] setup: normalize an if-else to follow our convention Kaartic Sivaraam
2026-10-28 11:54 ` [PATCH v3 2/5] t0009: add tests to cover more repository discovery scenarios Kaartic Sivaraam
2026-10-28 11:54 ` [PATCH v3 3/5] setup: provide hint about the source of the explicit git directory Kaartic Sivaraam
2026-10-28 11:54 ` [PATCH v3 4/5] setup: provide hint about auto-discovery boundaries Kaartic Sivaraam
2026-10-28 18:57 ` Junio C Hamano [this message]
2026-10-28 11:54 ` [PATCH v3 5/5] setup: report when GIT_OBJECT_DIRECTORY is what we could not use Kaartic Sivaraam
2026-10-28 19:27 ` Junio C Hamano
2026-10-28 19:28 ` [PATCH v3 0/5] Improve error reporting to mention how a Git repository is discovered Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqa4nxac14.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=kaartic.sivaraam@gmail.com \
--cc=ps@pks.im \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.