Thread (178 messages) 178 messages, 10 authors, 2025-08-16
STALE320d
Revisions (6)
  1. v4 current
  2. v5 [diff vs current]
  3. v5 [diff vs current]
  4. v7 [diff vs current]
  5. v8 [diff vs current]
  6. v9 [diff vs current]

[GSoC RFC PATCH v4 0/4] repo: add new command for retrieving repository info

From: Lucas Seiki Oshiro <hidden>
Date: 2025-07-14 23:52:40

Hi again!

This fourth version is basically a re-write after the discussion with Patrick,
Karthik and Justin about a future plan of making git-repo-info and git-survey
[1] a single command with two subcommands.

The main difference between repo-info and survey is that repo-info retrieves
metadata while survey returns metrics about the repository. This means that
repo-info is really light compared to survey.

This patch, then:

- Renames the command to `repo` instead of `repo-info`. All the functionality
  of `repo-info` will now be under `repo info`. The functionality of `survey`
  will be moved to another subcommand of `git repo`.

- Removes the JSON support. Given that after the previous feedback we already
  have a nice machine-readable format for outputting this data, JSON would not
  be so useful as it seemed to be at first (when the "other format" was just
  returning the values without the keys). This makes the code far more simpler,
  as we don't need to deal with the details of both formats.

- Uses a simpler representation of the fields, based in their keys instead of
  declaring multiple enums and using nested switches. This new solution is
  based in a table mapping the keys and the callbacks for retrieving the data.

- Provide a simple infrastructure for extending with the second command.

Given that this v4 is almost a rewrite, I think it isn't worth to send a
range-diff.

Thanks!

[1] https://gitlab.com/gitlab-org/git/-/merge_requests/369

Lucas Seiki Oshiro (4):
  repo: declare the repo command
  repo: add the field references.format
  repo: add field layout.bare
  repo: add field layout.shallow

 .gitignore                  |   1 +
 Documentation/git-repo.adoc |  63 ++++++++++++++++
 Documentation/meson.build   |   1 +
 Makefile                    |   1 +
 builtin.h                   |   1 +
 builtin/repo.c              | 146 ++++++++++++++++++++++++++++++++++++
 command-list.txt            |   1 +
 git.c                       |   1 +
 meson.build                 |   1 +
 t/meson.build               |   1 +
 t/t1900-repo.sh             |  75 ++++++++++++++++++
 11 files changed, 292 insertions(+)
 create mode 100644 Documentation/git-repo.adoc
 create mode 100644 builtin/repo.c
 create mode 100755 t/t1900-repo.sh

-- 
2.39.5 (Apple Git-154)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help