xxxrac / git-repo

Automatically exported from code.google.com/p/git-repo
Apache License 2.0
0 stars 0 forks source link

repo should provide a mean to retrieve root directory #198

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
repo lack a mechanism to retrieve the root directory of the projects.
git have such mean with git rev-parse --show-toplevel.

For some automated tools, it's useful to easily find such root directory.

repo should also have a command to retrieve the absolute path to .repo 
directory, like git with git rev-parse --git-dir.

For completeness, a command to report the path to the manifest work tree could 
be useful.

The proposed patch adds a repo directory command with following options

 -t for toplevel project directory.
 -r for .repo directory (<toplevel>/.repo).
 -m for manifests directory (<toplevel>/.repo/manifests).

An additional patch also add environment variables in repo forall so that the 
command executed by repo forall can benefit from such paths at no cost (without 
having to call repo directory):

 $REPO_TOPDIR for the absolute path to the project top directory.
 $REPO_REPO for the absolute path to the .repo directory.
 $REPO_MANIFESTS for the absolute path to the .repo/manifests directory.

Original issue reported on code.google.com by yann@droneaud.fr on 29 May 2015 at 7:49

Attachments: