git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: GIT_CEILING_DIRECTORY

From
Barry Warsaw <barry@python.org>
Date
Mar 9, 2016, 17:57 UTC
Message-ID
<20160309125704.162be49c@subdivisions.wooz.org>
In-Reply-To
<xmqqshzzimpo.fsf@gitster.mtv.corp.google.com>
On Mar 09, 2016, at 09:29 AM, Junio C Hamano wrote:
>Let me understand the use case.  You have $HOME/.git that governs
>everything under $HOME, but there are parts of $HOME/, such as
>$HOME/projects/*, that will never be controled by $HOME/.git?
Correct.
Show 5 quoted lines
>Two obvious reactions are:
>
> - hopefully $HOME/.gitignore covers these non-git parts by having
>   entries like '/projects/'; this should not affect the behaviour
>   of CEILING though.

Correct. In this case, $HOME/.gitignore has `projects` so `git status` etc. in $HOME does the right thing.

> - typing "git status" inside $HOME/projects/ does not make much
>   sense in the first place.

True, and normally I wouldn't do this explicitly, but it comes up because I have a bash prompt that shows me the status of the current directory ($GIT_PS_*) so even when I just cd to ~/projects I see status for $HOME.

>I _think_ the "are we in a Git-managed working tree and if so, then
>where is the .git directory?" discovery works like this:
[...]
>So setting $HOME/projects as one of the elements in the CEILING list
>would not stop us going up if you are actually at $HOME/projects,
>but we would stop if you started from $HOME/projects/python.
And indeed, that works great.
Show 10 quoted lines
>This somehow sounds a bit inconsistent to me, but I say "a bit
>inconsistent" because "Why do we give different answer to 'is
>$HOME/projects/python governed by $HOME/.git?' depending on where we
>start the discovery process?" is a non-argument (i.e. that is not
>the question CEILING is answering).
>
>I have a feeling that we must have done that for a reason.  It may
>be interesting to see what breaks in t1504 if the above logic is
>updated to stop when you start at a CEILING (unlike the current code
>where it stops only when you start below a CEILING).
That would be interesting; it seems like it would solve my use case.

Cheers, -Barry

Previous: Junio C Hamano
Message 3 of 3 in “GIT_CEILING_DIRECTORY”
  1. Barry WarsawMar 9, 2016
  2. Junio C HamanoMar 9, 2016
  3. Barry WarsawMar 9, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.