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

[GSoC PATCH v9 0/5] repo: add new command for retrieving repository info

From: Lucas Seiki Oshiro <hidden>
Date: 2025-08-07 15:03:58

Hi!

Thank you all for your time reviewing and helping me with this patchset!

This v9 only solve tiny nitpicks pointed by Karthik and Patrick in v8,
just to make clear that everything is ok!

Junio, would you mind to replace v8 by this v9 as lo/repo-info in seen?

Here's the range-diff:

1:  3c2ede66be = 1:  3c2ede66be repo: declare the repo command
2:  396bee171a ! 2:  b18e74763d repo: add the field references.format
    @@ t/t1900-repo.sh (new)
     +	git init --ref-format=reftable' 'format-reftable' 'references.format' 'reftable'
     +
     +test_expect_success 'git-repo-info fails if an invalid key is requested' '
    -+	echo "error: key '\'foo\'' not found" >expected_err &&
    ++	echo "error: key ${SQ}foo${SQ} not found" >expected_err &&
     +	test_must_fail git repo info foo 2>actual_err &&
     +	test_cmp expected_err actual_err
     +'
3:  4dbc83c64c ! 3:  35916b210e repo: add the field layout.bare
    @@ t/t1900-repo.sh: test_repo_info 'ref format files is retrieved correctly' '
     +	'git init --bare' 'bare' 'layout.bare' 'true'
     +
      test_expect_success 'git-repo-info fails if an invalid key is requested' '
    - 	echo "error: key '\'foo\'' not found" >expected_err &&
    + 	echo "error: key ${SQ}foo${SQ} not found" >expected_err &&
      	test_must_fail git repo info foo 2>actual_err &&
     @@ t/t1900-repo.sh: test_expect_success 'only one value is returned if the same key is requested twi
      	test_cmp expect actual
    @@ t/t1900-repo.sh: test_expect_success 'only one value is returned if the same key
     +	references.format=files
     +	EOF
     +	git init --ref-format=files two-keys &&
    -+	git -C two-keys repo info layout.bare references.format > actual &&
    ++	git -C two-keys repo info layout.bare references.format >actual &&
     +	test_cmp expected actual
     +'
     +
4:  5c65a24df4 ! 4:  91fc5c4e50 repo: add the field layout.shallow
    @@ t/t1900-repo.sh: test_repo_info 'bare repository = false is retrieved correctly'
     +	git clone --depth 1 "file://$PWD/remote"' 'shallow' 'layout.shallow' 'true'
     +
      test_expect_success 'git-repo-info fails if an invalid key is requested' '
    - 	echo "error: key '\'foo\'' not found" >expected_err &&
    + 	echo "error: key ${SQ}foo${SQ} not found" >expected_err &&
      	test_must_fail git repo info foo 2>actual_err &&
5:  923b491324 ! 5:  8af32d7066 repo: add the --format flag
    @@ builtin/repo.c: static int print_fields(int argc, const char **argv, struct repo
     +			printf("%s\n%s%c", key, valbuf.buf, '\0');
     +			break;
     +		default:
    -+			BUG("%d: not a valid output format", format);
    ++			BUG("not a valid output format: %d", format);
     +		}
      	}

    @@ t/t1900-repo.sh: test_repo_info 'bare repository = true is retrieved correctly'
     +	'git clone --depth 1 "file://$PWD/remote"' 'shallow' 'layout.shallow' 'true'

      test_expect_success 'git-repo-info fails if an invalid key is requested' '
    - 	echo "error: key '\'foo\'' not found" >expected_err &&
    + 	echo "error: key ${SQ}foo${SQ} not found" >expected_err &&
     @@ t/t1900-repo.sh: test_expect_success 'output is returned correctly when two keys are requested' '
      	test_cmp expected actual
      '

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

 .gitignore                  |   1 +
 Documentation/git-repo.adoc |  81 ++++++++++++++++++
 Documentation/meson.build   |   1 +
 Makefile                    |   1 +
 builtin.h                   |   1 +
 builtin/repo.c              | 165 ++++++++++++++++++++++++++++++++++++
 command-list.txt            |   1 +
 git.c                       |   1 +
 meson.build                 |   1 +
 t/meson.build               |   1 +
 t/t1900-repo.sh             | 102 ++++++++++++++++++++++
 11 files changed, 356 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