* Bug: Git Maintenance does not register multiple repos
@ 2024-06-20 13:15 Shubham Kanodia
2024-06-20 13:54 ` Kristoffer Haugsbakk
0 siblings, 1 reply; 4+ messages in thread
From: Shubham Kanodia @ 2024-06-20 13:15 UTC (permalink / raw)
To: git
When I run — `git maintenance register` to register a particular
repository for maintenance,
it appends a new entry to `~/.gitconfig` with the repo name.
```
[maintenance]
repo = /path/to/repo-1
repo = /path/to/repo-2
```
Now, since git uses the INI format for these files, this would imply that
repo-2 actually overrides repo 1 for maintenance.
This implies that a user can only register a single repository on
their system for
maintenance.
What did you expect to happen? (Expected behavior)
I expected that multiple repositories on the system could be setup for
maintenance using this command.
Which would mean, the `repo` filed would be an array.
```
[maintenance]
repo[] = /path/to/repo-1
repo[] = /path/to/repo-2
```
What happened instead? (Actual behavior)
It appended an entry with the same key, which would mean only the last
key wins, and a user cannot have
multiple repos as a part of maintenance.
What's different between what you expected and what actually happened?
Mentioned earlier.
Anything else you want to add:
No.
Please review the rest of the bug report below.
You can delete any lines you don't wish to share.
[System Info]
git version:
git version 2.39.3 (Apple Git-146)
cpu: arm64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
uname: Darwin 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:12:58
PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 arm64
compiler info: clang: 15.0.0 (clang-1500.3.9.4)
libc info: no libc information available
$SHELL (typically, interactive shell): /opt/homebrew/bin/fish
[Enabled Hooks]
post-checkout
post-commit
post-merge
pre-push
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: Bug: Git Maintenance does not register multiple repos
2024-06-20 13:15 Bug: Git Maintenance does not register multiple repos Shubham Kanodia
@ 2024-06-20 13:54 ` Kristoffer Haugsbakk
[not found] ` <CAG=Um+1EyB08n7oH6rgqPmmn0OWndUdv4vEsY5Hcv3aaf-BHxg@mail.gmail.com>
0 siblings, 1 reply; 4+ messages in thread
From: Kristoffer Haugsbakk @ 2024-06-20 13:54 UTC (permalink / raw)
To: Shubham Kanodia; +Cc: git
Hi
On Thu, Jun 20, 2024, at 15:15, Shubham Kanodia wrote:
> When I run — `git maintenance register` to register a particular
> repository for maintenance,
> it appends a new entry to `~/.gitconfig` with the repo name.
>
> ```
> [maintenance]
> repo = /path/to/repo-1
> repo = /path/to/repo-2
> ```
>
> Now, since git uses the INI format for these files, this would imply that
> repo-2 actually overrides repo 1 for maintenance.
>
> This implies that a user can only register a single repository on
> their system for
> maintenance.
Imply? Did you test this? From memory this is a multi-valued config, and
multi-valued configs are sometimes listed by using `=` multiple times
for the same config variable. That’s also what [this] email says:
“ The 'git maintenance [un]register' commands set or unset the multi-
valued maintenance.repo config key with the absolute path of the
current repository. These are set in the global config file.
🔗 this: https://lore.kernel.org/git/5aa9cc1d6b93b5ad3d66ac01a4518a91ced39bcb.1664287021.git.gitgitgadget@gmail.com/
I’ve never seen that git config uses the INI format. I’ve had the
impression that it is a bespoke format that simply looks like the INI
format. (But is the INI format even standardized?)
I have two repositories registered. When I run this:
```
git for-each-repo --config=maintenance.repo maintenance run
```
Well, it doesn’t tell me what repositories are being manipulated, but I do get two of these lines:
```
Enumerating objects: […]
```
So I surmise that this command is being run twice.
--
Kristoffer Haugsbakk
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-06-21 10:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-20 13:15 Bug: Git Maintenance does not register multiple repos Shubham Kanodia
2024-06-20 13:54 ` Kristoffer Haugsbakk
[not found] ` <CAG=Um+1EyB08n7oH6rgqPmmn0OWndUdv4vEsY5Hcv3aaf-BHxg@mail.gmail.com>
2024-06-21 6:58 ` Kristoffer Haugsbakk
2024-06-21 10:10 ` Phillip Wood
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).