public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>
Cc: Ayush Jha <kumarayushjha123@gmail.com>,
	 git@vger.kernel.org,
	 Christian Couder <christian.couder@gmail.com>,
	 Karthik Nayak <karthik.188@gmail.com>,
	 Justin Tobler <jltobler@gmail.com>,
	 Ayush Chandekar <ayu.chandekar@gmail.com>,
	 Siddharth Asthana <siddharthasthana31@gmail.com>
Subject: Re: [PATCH] [RFC][GSoC][PATCH] attr: use local repository state in read_attr
Date: Sat, 07 Feb 2026 13:41:07 -0800	[thread overview]
Message-ID: <xmqqbji0b5ak.fsf@gitster.g> (raw)
In-Reply-To: <E605A7F6-AF4D-463F-8316-6BE69AFE0369@gmail.com> (Lucas Seiki Oshiro's message of "Sat, 7 Feb 2026 18:02:46 -0300")

Lucas Seiki Oshiro <lucasseikioshiro@gmail.com> writes:

>> 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.

  reply	other threads:[~2026-02-07 21:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-07 11:40 [PATCH] [RFC][GSoC][PATCH] attr: use local repository state in read_attr Ayush Jha
2026-02-07 19:12 ` Tian Yuchen
2026-02-07 21:02 ` Lucas Seiki Oshiro
2026-02-07 21:41   ` Junio C Hamano [this message]
2026-02-08  4:42 ` Tian Yuchen
2026-02-10 14:05   ` Ayush Jha
2026-02-14  0:04     ` Lucas Seiki Oshiro
2026-02-14  6:47       ` Ayush Jha
2026-02-10 23:37   ` Junio C Hamano
2026-02-11 16:43     ` Tian Yuchen

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=xmqqbji0b5ak.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=ayu.chandekar@gmail.com \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jltobler@gmail.com \
    --cc=karthik.188@gmail.com \
    --cc=kumarayushjha123@gmail.com \
    --cc=lucasseikioshiro@gmail.com \
    --cc=siddharthasthana31@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox