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

Re: [PATCH] [RFC][GSoC][PATCH] attr: use local repository state in read_attr

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 7, 2026, 21:41 UTC
Message-ID
<xmqqbji0b5ak.fsf@gitster.g>
In-Reply-To
<E605A7F6-AF4D-463F-8316-6BE69AFE0369@gmail.com>
Lucas Seiki Oshiro <lucasseikioshiro@gmail.com> writes:
Show 5 quoted lines
>> read_attr() currently relies on is_bare_repository(), which
>> implicitly depends on the global the_repository.
>
> So, wouldn't it be better to make is_bare_repository depend
> on a `struct repository *repo` instead of `the_repository`?

The codepath read_attr() is in is usually not that hot but it is not cheap.

The repository object should have a boolean that says "I am bare", perhaps initialized lazily, and your version of is_bare_repository that takes a repository object would be a good entry point to it.

Also, IIRC, there is another releated effort to allow attribute data source to become per repository. This change may want to coordinate with it.

Thanks.
Previous: Lucas Seiki OshiroNext: Tian Yuchen
Message 4 of 10 in “attr: use local repository state in read_attr”
  1. [RFC][GSoC][PATCH] attr: use local repository state in read_attrAyush Jha, Feb 7, 2026
  2. Tian YuchenFeb 7, 2026
  3. Lucas Seiki OshiroFeb 7, 2026
  4. Junio C HamanoFeb 7, 2026
  5. Tian YuchenFeb 8, 2026
  6. Ayush JhaFeb 10, 2026
  7. Lucas Seiki OshiroFeb 14, 2026
  8. Ayush JhaFeb 14, 2026
  9. Junio C HamanoFeb 10, 2026
  10. Tian YuchenFeb 11, 2026

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.