💾 Archived View for tilde.team › ~michel › 2022-03-28-myrepos-utils.gmi captured on 2024-05-10 at 11:57:55. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2022-04-28)
-=-=-=-=-=-=-
I've been using myrepos[1] for a while - as someone who juggles a lot of repositories, both for personal projects and as a Fedora and CentOS packager, a `~/.mrconfig` synced via Nextcloud really makes checking out repositories consistently, on different computers, straightforward.
1: https://myrepos.branchable.com/
As the number of tracked repos grow, however, trying to remember where each repo is checked out gets a bit time consuming -- and also, keeping the configuration file organized as well; `mr register` on an existing repo would add the entry for that repo at the end of the file, and I was previously resorting to editing the file by hand to get it sorted - with a varying degree of success.
Here's a *very* simplified version of how my repositories are organized:
tree ~/src/ /home/michel/src ├── fedora │ └── folly ├── github │ └── folly ├── gitlab │ └── blog └── sourcehut └── ansible
Note that there are **two** repositories named `folly`: one for the upstream source code, and one for the Fedora `dist-git` repo that controls its packaging.
After one too many times finding myself doing `grep repo ~/.mrconfig`, I decided to write a tool to help. It's reasonably simple, thanks to `myrepos` using an INI file for its configuration that Python's `configparser` handles perfectly fine.
Behold myrepos-utils[2]; it currently provides two commands:
2: https://pypi.org/project/myrepos-utils/
So with our example layout,
$ mr-utils find folly /home/michel/src/fedora/folly /home/michel/src/github/folly $ mr-utils find fed folly /home/michel/src/fedora/folly $ cd $(mr-utils find git folly) $ pwd /home/michel/src/github/folly
Hey presto!
Chain-loading multiple `.mrconfig` files not supported yet, and conversely, filtering out repositories that are not checked out yet is also not supported yet (but trivial to add). But so far this has really simplified my daily workflows!
Coming soon[3] to a Fedora mirror near you.
3: https://bodhi.fedoraproject.org/updates/?packages=python-myrepos-utils
Have a comment on one of my posts? Start a discussion in my public inbox by sending an email to ~michel-slm/public-inbox@lists.sr.ht[5] [mailing list etiquette[6]]
5: mailto:~michel-slm/public-inbox@lists.sr.ht