Skip to main content

Mr. Repo - A simple repo management system

Project description

Author:

Ryan McGowan

Introduction

Mr. Repo is a repo management script written in python. It’s very simple. Basically, it turns whatever directory Mr. Repo is initialized into a configurable repository of Git repositories. It creates two files to keep track of its state.

  • A YAML file (.mr_repo.yml) which keeps extended information on repositories that may appear in the directory

  • Another file, (.this_repo) file keeps track of what repositories are currently available in the directory

…but why?

I have have a repo folder on several of my computers. This folder contains mostly Git repositories that I want to be avaialble on multiple computers. I use Dropbox to sync lots of files between my computers, but not the repo folder for several reasons. However, I still want to manage what I have in my repo folders across my computers. So, I’ll be syncing the .mr_repo.yml file with Dropbox and letting Mr. Repo do the rest of the work.

Usage

Run the init command to get to set up the two files by automatically interpreting subdirectories.

mr_repo init [--clean]

The --clean option causes the init command create blank tracking files and to not automatically interpret subdirectories.

Once you have the files setup you can add and remove repos by their directory names with the add and remove commands.

mr_repo add <repo/direcotry name>
# Or to remove a repo
mr_repo rm <repo/direcotry name>

You can also automatically reinterpret the current directory with the update command.

mr_repo update

That’s all the boring stuff. The part of Mr. Repo that’s actually useful is its ability to pull repos you’ve added from other places, but aren’t available in your current directory.

To determine what repos you have just use the list command. By default the list command outputs a list of currently available repos. Using the -a flag also displays information about unavailable repos (i.e. repos that are not currently set up in the CWD). As you might expect the -n flag can be used to display repos that are not currently available.

mr_repo list [-a | --all] [-n | --not-available]

Once you know what repos are or are not currently available you can get/unget them.

mr_repo get <not currently available repo name>
mr_repo unget [-f | --force] <currently available repo name>

The unget command removes the repo if all changes have been fully committed and also updates the .this_repo file. In the case where a there are uncomitted changes an error is thrown and the command fails. If the user wants to remove it anyways then the user can add the -f flag to force the removal.

TO DO

  • Update this file.

  • Add depth parameter to update to allow search none repositories recursively.

  • Create a MrRepoRepo wrapper class for use in MrRepo instead of calling git.Repo directly

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Mr-Repo-0.2.8.tar.gz (7.7 kB view details)

Uploaded Source

File details

Details for the file Mr-Repo-0.2.8.tar.gz.

File metadata

  • Download URL: Mr-Repo-0.2.8.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for Mr-Repo-0.2.8.tar.gz
Algorithm Hash digest
SHA256 8a4c003bfeb4b8ca23d0b2306b16e3d44e4bc7845a28d4c1e14e239953ef13b1
MD5 a6f2dc8d5053afd9d97fcc6697317e0b
BLAKE2b-256 f4834ba0f0c0b260ee2c152f53f4ef780569aa74d7bf057545ad2e2baeb61e34

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page