Andromeda Documentation Release 1.0.0-Beta
Total Page:16
File Type:pdf, Size:1020Kb
Andromeda Documentation Release 1.0.0-beta Mike Lloyd August 05, 2015 Contents 1 Contents 3 1.1 Quickstart................................................3 1.2 Commands................................................3 1.3 Andromeda Manifest Format......................................9 1.4 Local Manifest.............................................. 12 1.5 OpenStack Manifest........................................... 12 i ii Andromeda Documentation, Release 1.0.0-beta Andromeda is a Python-based repository management tool for the OpenStack repositories. This is a refactor of the repo project for Android, but with some differences. While it is mostly identical for most intents and purposes, there are some differences: • Works in Python 2.6-2.7, migration to Python 3.x will be complete soon. • More PEP 8 compliant. • It is configured for the OpenStack Gerrit instance, not Google’s. • Andromeda does not assume Gerrit user name is the first part of your email address...it must be set in the Git global configuration. • This is an actual package instead of running curl http://... > file. • Better documentation. Contents 1 Andromeda Documentation, Release 1.0.0-beta 2 Contents CHAPTER 1 Contents 1.1 Quickstart For the impatient or those that want to figure it out independently, here is the quick start variant with the OpenStack Sandbox repository: git config --global gitreview.username yourgerritusername andromeda init -u https://github.com/mynameismevin/andromeda-sandbox --config-name andromeda sync -j8 andromeda start test-branch-01 sandbox cd sandbox && touch "test-file-01" && echo "Andromeda is awesome!" > test-file-01 && git add . && git commit -m "Andromeda still rocks!" && cd .." andromeda upload 1.1.1 Quickstart Explained Here is a quick and dirty explanation of what just happened. 1. Your Gerrit user name was configured globally for OpenStack. 2. Andromeda was initialised in the current directory and verified your information. 3. Andromeda pulled the remote repositories locally with 8 threads. 4. Andromeda initialised a new branch, test-branch-01, in the sandbox repository. 5. Added a new file to the sandbox and committed it. 6. Created a review in the OpenStack Review board. For more information on specific commands, please read the rest of the documentation. If you’ve ever used repo by Android, then you’ll be fine, just replace repo with andromeda. 1.2 Commands Here is a list of the current commands that Andromeda supports: abandon, branch, branches, checkout, diff, download, grep, init, prune, rebase, smartsync, stage, start, status, sync, upload 3 Andromeda Documentation, Release 1.0.0-beta 1.2.1 Abandon andromeda abandon permanently abandons a development branch by deleting it (and all its history) from your local repository. It is equivalent to git branch -D <branchname>. 1.2.2 Branch/Branches Summarizes the currently available topic branches. Branch Display The branch display output by this command is organized into four columns of information; for example: *P nocolor | in repo repo2 | The first column contains a * if the branch is the currently checked out branch in any of the specified projects, or a blank if no project has the branch checked out. The second column contains either blank, p or P, depending upon the upload status of the branch: (blank): branch not yet published by andromeda upload P: all commits were published by andromeda upload p: only some commits were published by andromeda upload The third column contains the branch name. The fourth column (after the | separator) lists the projects that the branch appears in, or does not appear in. If no project list is shown, then the branch appears in all projects. 1.2.3 Checkout andromeda checkout checks out an existing branch that was previously created by ‘andromeda start’. The command is equivalent to: andromeda forall [<project>...] -c git checkout <branchname> 1.2.4 Diff andromeda diff shows the differences between the latest commit and your working tree. 1.2.5 Download andromeda download downloads a change from the OpenStack Review system and makes it available in your project’s local working directory. 4 Chapter 1. Contents Andromeda Documentation, Release 1.0.0-beta 1.2.6 Forall Executes the same shell command in each project. Output Formatting The -p option causes Andromeda to bind pipes to the command’s stdin, stdout and stderr streams, and pipe all output into a continuous stream that is displayed in a single pager session. Project headings are inserted before the output of each command is displayed. If the command produces no output in a project, no heading is displayed. The formatting convention used by -p is very suitable for some types of searching, e.g. andromeda forall -p -c git log -SFoo will print all commits that add or remove references to Foo. The -v option causes Andromeda to display stderr messages if a command produces output only on stderr. Normally the -p option causes command output to be suppressed until the command produces at least one byte of output on stdout. Environment The pwd variable is the project’s working directory. If the current client is a mirror client, then pwd is the Git repository. ANDROMEDA_PROJECT is set to the unique name of the project. ANDROMEDA_PATH is the path relative the the root of the client. ANDROMEDA_REMOTE is the name of the remote system from the manifest. ANDROMEDA_LREV is the name of the revision from the manifest, translated to a local tracking branch. If you need to pass the manifest revision to a locally executed git command, use ANDROMEDA_LREV. ANDROMEDA_RREV is the name of the revision from the manifest, exactly as written in the manifest. Shell positional arguments ($1 $2 .. $#) are set to any arguments following <command>. Unless -p is used, stdin, stdout, stderr are inherited from the terminal and are not redirected. 1.2.7 Grep Search for the specified patterns in all project files. Boolean Options The following options can appear as often as necessary to express the pattern to locate: -e PATTERN --and, --or, --not, -(, -) Further, the -r/--revision option may be specified multiple times in order to scan multiple trees. If the same file matches in more than one tree, only the first result is reported, prefixed by the revision name it was found under. Examples Look for a line that has ’#define’ and either ’MAX_PATH or ’PATH_MAX’: 1.2. Commands 5 Andromeda Documentation, Release 1.0.0-beta andromeda grep -e '#define' --and -\\( -e MAX_PATH -e PATH_MAX \\) Look for a line that has ’NODE’ or ’Unexpected’ in files that contain a line that matches both expressions: andromeda grep --all-match -e NODE -e Unexpected 1.2.8 Init Initialize andromeda in the current directory. The andromeda init command is run once to install and initialize andromeda. The latest andromeda source code and manifest collection is downloaded from the server and is installed in the .andromeda/ directory. The optional -b argument can be used to select the manifest branch to checkout and use. If no branch is specified, master is assumed. The optional -m argument can be used to specify an alternate manifest to be used. If no manifest is specified, the manifest default.xml will be used. The --reference option can be used to point to a directory that has the content of a --mirror sync. This will make the working directory use as much data as possible from the local reference directory when fetching from the server. This will make the sync go a lot faster by reducing data traffic on the network. Switching Manifest Branches To switch to another manifest branch, andromeda init -b otherbranch may be used in an existing client. However, as this only updates the manifest, a subsequent andromeda sync (or andromeda sync -d) is nec- essary to update the working directory files. 1.2.9 Prune Prune (delete) already merged topics. 1.2.10 Rebase Rebase local branches on upstream branch. andromeda rebase uses git rebase to move local changes in the current topic branch to the HEAD of the up- stream history, useful when you have made commits in a topic branch but need to incorporate new upstream changes “underneath” them. 1.2.11 Smartsync andromeda smartsync is a shortcut for sync -s. 1.2.12 Stage andromeda stage stages files to prepare the next commit. 6 Chapter 1. Contents Andromeda Documentation, Release 1.0.0-beta 1.2.13 Start Start a new branch for development. andromeda start begins a new branch of development, starting from the revision specified in the manifest. 1.2.14 Status Show the working tree status. andromeda status compares the working tree to the staging area (aka the index), and the most recent commit on this branch (HEAD), in each project specified. A summary is displayed, one line per file where there is a difference between these three states. The -j/--jobs option can be used to run multiple status queries in parallel. The -o/--orphans option can be used to show objects that are in the working directory, but not associated with an andromeda project. This includes unmanaged top-level files and directories, but also includes deepe items. For example, if dir/subdir/proj1 and dir/subdir/proj2 are andromeda projects, dir/subdir/proj3 will be shown if it is not known to andromeda. 1.2.15 Status Display The status display is organized into three columns of information, for example if the file ‘subcmds/status.py’ is modi- fied in the project ‘devstack’ on branch ‘devwork’: project devstack/ branch devwork -m subcmds/status.py The first column explains how the staging area (index) differs from the last commit (HEAD). Its values are always displayed in upper case and have the following meanings: -: no difference A: added (not in HEAD, in index ) M: modified ( in HEAD, in index, different content ) D: deleted ( in HEAD, not in index ) R: renamed (not in HEAD, in index, path changed ) C: copied (not in HEAD, in index, copied from another) T: mode changed ( in HEAD, in index, same content ) U: unmerged; conflict resolution required The second column explains how the working directory differs from the index.