From: SoutrikDas <valusoutrik@gmail.com>
To: lucasseikioshiro@gmail.com
Cc: ayu.chandekar@gmail.com, christian.couder@gmail.com,
git@vger.kernel.org, jltobler@gmail.com, karthik.188@gmail.com,
siddharthasthana31@gmail.com, valusoutrik@gmail.com
Subject: Re: [GSOC RFC PATCH] builtin/repo: add path.in-worktree field
Date: Fri, 27 Feb 2026 01:46:43 +0530 [thread overview]
Message-ID: <20260226201643.5152-1-valusoutrik@gmail.com> (raw)
In-Reply-To: <05C28DD8-251A-4990-BBB2-26C144CAD982@gmail.com>
> Makes sense, but this way you're re-writing `is_inside_work_tree`
> inside `get_path_in_worktree` but without using the is_inside_work_tree
> variable. I don't know what's the cost of doing this.
I also dont know for sure, but the is_inside_work_tree in setup.c has a
lazy cache ie a 'static int inside_work_tree' ... but this lazy cache
as far as I understood, does not survive after a command run.
> I'm not sure if it should be in git-repo-info. I mean, this information
> is more related to the current directory than the repository itself.
I see. Very well, I was searching for something small enough to count
as a microproject. If I may ask, can you give some directions ?
I though about doing the group key thing :
> Use the category as key (e.g., git repo info layout would return all
> layout-related values)
But its already on the SoC 2026 Ideas , and I dont know if I should do
it.
> Something that I would question here if isn't it possible to make
> is_inside_work_tree accept a repository as parameter and then use it
> here.
Like change the function in setup.c ? wouldnt that break every call of
is_inside_work_tree ? Or make a similar function , along with a lazy cache
just for repo.c ?
> I think 'path.is-in-worktree' would be better.
Got it.
> Also, I did run t1900-repo.sh and it was failing one test case,
> which also ran with an ok when I added the new field to REPO_INFO_KEYS.
>
> [1] : https://git.github.io/SoC-2026-Ideas/
> Everything above is not meant to be a commit message. This way, it
> should be placed after the scissors mark (---) or in a cover letter.
Got it.
> Test missing here.
Yeah ... I missed that. Suppose we were adding this path.is-in-worktree
to repo.c , then would the below test be sufficient ?
1: cd .git and then checking if path.is-in-worktree is false
2: cd .. and then checking if path.is-in-worktree is true
> Thanks for your interest in contributing to git-repo-info!
Thank you for the feedback and all the encouragement in the other thread
as well.
next prev parent reply other threads:[~2026-02-26 20:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-25 19:03 [GSOC RFC PATCH] builtin/repo: add path.in-worktree field SoutrikDas
2026-02-25 19:37 ` Lucas Seiki Oshiro
2026-02-26 20:16 ` SoutrikDas [this message]
2026-02-26 21:26 ` Lucas Seiki Oshiro
2026-02-26 22:33 ` Junio C Hamano
2026-02-26 22:38 ` Lucas Seiki Oshiro
2026-03-02 18:08 ` Kaartic Sivaraam
2026-02-27 3:51 ` SoutrikDas
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=20260226201643.5152-1-valusoutrik@gmail.com \
--to=valusoutrik@gmail.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=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