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

Re: [PATCH] Don't create the $GIT_DIR/branches directory on init

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 31, 2009, 18:15 UTC
Message-ID
<7vr5sj8m5f.fsf@alter.siamese.dyndns.org>
In-Reply-To
<200910311011.31189.trast@student.ethz.ch>
Thomas Rast <trast@student.ethz.ch> writes:
> Robin Rosenberg wrote:
>> Git itself does not even look at this directory.

Modern git Porcelains write remote definitions solely to .git/config, but still reads from .git/{branches,remotes}. What we do not do is to update these locations, and we do not need to have these locations to operate.

So "not even look at" is too strong; it just "not touch".

I do not think there is reason to change that part of the equation. For people who need to fetch and merge hundreds of random places, it is a lot handier to be able to do

	echo "$url#$branch" >.git/branch/$nickname
        rm .git/branch/$nickname

to manage the set of locations added to and deleted from the daily compose. Andrew Morton explicitly asked for this to be kept a few years ago and I do not see a reason to deprecate this.

Now, not installing an empty .git/branch directory does break the above workflow. You would need to mkdir _once_ yourself, but I do not think that is such a big deal.

On the other hand, I do not think it is such a big deal to have otherwise unused .git/branches/ directory, either. Robin wrote:

    Shawn and other wants to stop JGit from creating this directory on
    init with the motivation that newer Git version doesn't create it
    anymore. This patch would make that assertion true.

and after re-reading it, I realize "the motivation" is not a motivation at all---it is merely an excuse ("after this patch is applied, git wouldn't create it anymore"---so JGit will have an excuse not to do so). It does not say _why_ it shouldn't be there in the first place. IOW, we need to fill in the blank in: "JGit is merely following suit; the reason git stopped creating the directory is ________").

This patch alone breaks tests in the t55?? series quite a lot, and I am tempted to revert it. My time is more valuable than fixing the fallouts from this change, when the real purpose of the change is not yet stated.

Previous: Shawn O. PearceNext: Shawn O. Pearce
Message 6 of 8 in “Don't create the $GIT_DIR/branches directory on init”
  1. Don't create the $GIT_DIR/branches directory on initRobin Rosenberg, Oct 30, 2009
  2. Junio C HamanoOct 30, 2009
  3. Thomas RastOct 31, 2009
  4. Robin RosenbergOct 31, 2009
  5. Shawn O. PearceOct 31, 2009
  6. Junio C HamanoOct 31, 2009
  7. Shawn O. PearceOct 31, 2009
  8. Junio C HamanoOct 31, 2009

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.