git/list[1] front-page[2] threads[3] people[4] search[5] about
wed 2026-10-07 17:21 UTC

Re: [PATCH v6 0/6] repo info: add category/path keys and --path-format

From
K Jayatheerth <jayatheerthkulkarni2005@gmail.com>
Date
Mar 19, 2026, 03:36 UTC
Message-ID
<20260319033641.38458-1-jayatheerthkulkarni2005@gmail.com>
In-Reply-To
<20260318204438.40075-1-jerrywang183@yahoo.com>
Show 9 quoted lines
> While reading the current `git repo info` implementation, I noticed that
> `layout.bare` is still implemented via `is_bare_repository()` in
> `builtin/repo.c`.
>
> At first I thought this might be a small repository-awareness cleanup,
> since the `repo info` field callbacks already receive a `struct
> repository *`. But after tracing it further, it seems the current
> `is_bare_repository()` semantics are not equivalent to simply checking
> whether `repo_get_work_tree(repo)` is NULL.

Hmph, this was an idea I explored few days ago But I do agree the repo->worktree == NULL method has multiple flaws

For example
test_expect_success 'layout.bare is false even when run from inside .git' '
	git init nonbare-dot-git &&
	echo "layout.bare=false" >expect &&
	git -C nonbare-dot-git/.git repo info layout.bare >actual &&
	test_cmp expect actual
'

I cooked up a test like this and it failed I have since been exploring config.c and parse.c. specifically the if repo_config_get_bool()

I think there are few other checks we need to do on top of repo->worktree to be completely sure that the given repo is in fact bare. Also instead of using repo->worktree I think we can use repo_get_work_tree(repo) Why recreate the logic when we have a getter ;)

I am convinced that we need a helper repo_is_bare is a good name too.

Thanks for exploring this :)
Regards,
- Jayatheerth
Previous: Jialong WangNext: Jerry Wang
Message 64 of 68 in “repo: extend info path reporting and structure statistics”
  1. 0/3 repo: extend info path reporting and structure statisticseslam reda via GitGitGadget, Feb 22, 2026
  2. 1/3 repo: extend info paths and structure statisticseslam-reda-div via GitGitGadget, Feb 22, 2026
  3. 2/3 t1900,t1901: make repo tests hash-agnostic and wc-portableEslam reda ragheb via GitGitGadget, Feb 22, 2026
  4. 3/3 t1900,t1901: fix test portability issuesEslam reda ragheb via GitGitGadget, Feb 22, 2026
  5. Lucas Seiki OshiroFeb 22, 2026
  6. Lucas Seiki OshiroFeb 22, 2026
  7. Junio C HamanoFeb 22, 2026
  8. Justin ToblerFeb 23, 2026
  9. 0/9 repo: extend info path reporting and structure statisticseslam reda via GitGitGadget, Feb 23, 2026
  10. 1/9 repo: teach info context and category keysEslam reda ragheb via GitGitGadget, Feb 23, 2026
  11. 2/9 repo: add path keys to repo infoEslam reda ragheb via GitGitGadget, Feb 23, 2026
  12. 4/9 repo: add structure max object size metricsEslam reda ragheb via GitGitGadget, Feb 23, 2026
  13. 5/9 repo: add structure topology and path-depth metricsEslam reda ragheb via GitGitGadget, Feb 23, 2026
  14. 6/9 repo: add aggregate structure totals to keyvalue outputEslam reda ragheb via GitGitGadget, Feb 23, 2026
  15. 7/9 t1900: cover repo info path keys and path-formatEslam reda ragheb via GitGitGadget, Feb 23, 2026
  16. 8/9 t1901: extend structure metric coverage and portabilityEslam reda ragheb via GitGitGadget, Feb 23, 2026
  17. 9/9 docs: describe repo info path keys and structure metricsEslam reda ragheb via GitGitGadget, Feb 23, 2026
  18. 0/5 repo: extend info path reporting and structure statisticseslam reda via GitGitGadget, Feb 23, 2026
  19. 1/5 repo: teach info context and category keysEslam reda ragheb via GitGitGadget, Feb 23, 2026
  20. 2/5 repo: add path keys to repo infoEslam reda ragheb via GitGitGadget, Feb 23, 2026
  21. 3/5 repo: add --path-format for info path outputEslam reda ragheb via GitGitGadget, Feb 23, 2026
  22. 4/5 t1900: cover repo info path keys and path-formatEslam reda ragheb via GitGitGadget, Feb 23, 2026
  23. 5/5 docs: describe repo info path keysEslam reda ragheb via GitGitGadget, Feb 23, 2026
  24. 00/10 repo info: add category/path keys and --path-formateslam reda via GitGitGadget, Feb 26, 2026
  25. 01/10 repo: teach info context and category keysEslam reda ragheb via GitGitGadget, Feb 26, 2026
  26. 02/10 repo: add path keys to repo infoEslam reda ragheb via GitGitGadget, Feb 26, 2026
  27. 03/10 repo: add --path-format for info path outputEslam reda ragheb via GitGitGadget, Feb 26, 2026
  28. 04/10 repo: add structure max object size metricsEslam reda ragheb via GitGitGadget, Feb 26, 2026
  29. 05/10 repo: add structure topology and path-depth metricsEslam reda ragheb via GitGitGadget, Feb 26, 2026
  30. 06/10 repo: add aggregate structure totals to keyvalue outputEslam reda ragheb via GitGitGadget, Feb 26, 2026
  31. 07/10 t1900: cover repo info path keys and path-formatEslam reda ragheb via GitGitGadget, Feb 26, 2026
  32. 08/10 t1901: extend structure metric coverage and portabilityEslam reda ragheb via GitGitGadget, Feb 26, 2026
  33. 09/10 docs: describe repo info path keys and structure metricsEslam reda ragheb via GitGitGadget, Feb 26, 2026
  34. 10/10 repo: reduce repetition in structure keyvalue outputEslam reda ragheb via GitGitGadget, Feb 26, 2026
  35. Junio C HamanoFeb 26, 2026
  36. Junio C HamanoFeb 26, 2026
  37. Phillip WoodFeb 27, 2026
  38. 00/11 repo info: add category/path keys and --path-formateslam reda via GitGitGadget, Feb 27, 2026
  39. 01/11 repo: teach info context and category keysEslam reda ragheb via GitGitGadget, Feb 27, 2026
  40. 02/11 repo: add path keys to repo infoEslam reda ragheb via GitGitGadget, Feb 27, 2026
  41. 03/11 repo: add --path-format for info path outputEslam reda ragheb via GitGitGadget, Feb 27, 2026
  42. 04/11 repo: add structure max object size metricsEslam reda ragheb via GitGitGadget, Feb 27, 2026
  43. 05/11 repo: add structure topology and path-depth metricsEslam reda ragheb via GitGitGadget, Feb 27, 2026
  44. 06/11 repo: add aggregate structure totals to keyvalue outputEslam reda ragheb via GitGitGadget, Feb 27, 2026
  45. 07/11 t1900: cover repo info path keys and path-formatEslam reda ragheb via GitGitGadget, Feb 27, 2026
  46. 08/11 t1901: extend structure metric coverage and portabilityEslam reda ragheb via GitGitGadget, Feb 27, 2026
  47. 09/11 docs: describe repo info path keys and structure metricsEslam reda ragheb via GitGitGadget, Feb 27, 2026
  48. 10/11 repo: reduce repetition in structure keyvalue outputEslam reda ragheb via GitGitGadget, Feb 27, 2026
  49. 11/11 repo: refine path keys for repo infoEslam reda ragheb via GitGitGadget, Feb 27, 2026
  50. Junio C HamanoFeb 27, 2026
  51. Lucas Seiki OshiroFeb 27, 2026
  52. Lucas Seiki OshiroFeb 27, 2026
  53. Phillip WoodMar 1, 2026
  54. Phillip WoodMar 1, 2026
  55. 0/6 repo info: add category/path keys and --path-formateslam reda via GitGitGadget, Mar 2, 2026
  56. 1/6 repo: introduce repo_info context plumbingEslam reda ragheb via GitGitGadget, Mar 2, 2026
  57. 2/6 repo: support category requests in repo infoEslam reda ragheb via GitGitGadget, Mar 2, 2026
  58. 3/6 repo: add path keys to repo infoEslam reda ragheb via GitGitGadget, Mar 2, 2026
  59. 4/6 repo: add --path-format for info path outputEslam reda ragheb via GitGitGadget, Mar 2, 2026
  60. 5/6 t1900: cover repo info path keys and path-formatEslam reda ragheb via GitGitGadget, Mar 2, 2026
  61. 6/6 docs: describe repo info path keysEslam reda ragheb via GitGitGadget, Mar 2, 2026
  62. Junio C HamanoMar 2, 2026
  63. Jialong WangMar 18, 2026
  64. K JayatheerthMar 19, 2026
  65. Jerry WangMar 19, 2026
  66. t1900: cover repo info path keys in non-default layoutsJialong Wang, Mar 19, 2026
  67. Jialong WangMar 19, 2026
  68. K JayatheerthMar 20, 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.