ooyala/barkeep — pull request #382 by michaelstorm (2013-01-12 22:11:11+00:00)
Title: Custom repo names

#### Patch contents

* Introduces a `Name` field next to the `Repo url` field on the repo admin page. A script sets the text in the `Name` field to a default name based on the URL. The `Name` field is updated every time the URL field value changes.
* Allows the "/" character in repo names. When the repo is cloned, the "/" characters are interpreted as directory separators on the target filesystem.
* Introduces a `base/test_git_repo` submodule in order to test this functionality.

In other words, if `REPOS_ROOT = "/home/michael/barkeep_repos"` and I clone a repo named `michaelstorm/barkeep`, then it will be cloned into `/home/michael/barkeep_repos/michaelstorm/barkeep.`

#### Rationale

As mentioned in #377, the proper name of a repo from a Barkeep user's point of view is not always the same as what the administrator hosting the repo thought it should be.

Additionally, namespacing repos in this way seems to be common practice today. GitHub and GitLab both do it, as do we at my company. (I don't speak for them, etc.) While changing the repo name from its origin is useful, so is fully preserving it, namespace and all.

#### Notes

`base/test_git_repo` is a clone of [michaelstorm/barkeep_compound_name_integration_tests](https://github.com/michaelstorm/barkeep_compound_name_integration_tests). It's identical to [ooyala/barkeep_integration_tests](https://github.com/ooyala/barkeep_integration_tests), but with the committer names and emails changed to refer to me. Therefore, the SHA commit hashes are different, and we get namespace collision testing for free.

The command-line client handles compound repo names if specified, but still uses the basename of whatever git repo the user is in if not. This could get confusing, but I decided to leave it for now.

`/api/add_repo` takes a new, optional `name` parameter. If it's not specified, `name` will default to the repo name that Barkeep would have chosen previously. If we're okay with breaking script compatibility, this parameter can become required.