azzurris / git-repo

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

repo scriptability #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Reported by Shawn Pearce <sop@google.com> on Mon Feb 09 10:54:29 PST 2009
Source: JIRA REPO-8

repo should return useful exit codes and use stdout/stderr in a consistent way
in case someone wants to write a script that calls repo.

In Git we split commands into two different groups:

- plumbing:  These are scriptable commands that offer very small building
blocks of the Git system.  The command line options are usually only
--long-gnu-style and the input/output streams are formatted for easy machine
parsing, not human readability.  The commands, their options and their
stream formats are frozen in stone.

- porcelain: These are commands the human can invoke.  We can change their
options, use short options, have prettier output formats that are less
regular (and more difficult to parse).  These aren't meant to be invoked by
script writers.

We should consider doing the same thing with repo.  Especially since the
repo user interface may change and evolve a bit as we learn more about the
general Android workflow.

In terms of repo (since its all one big Python script) the plumbing commands
may just be small wrappers that convert command line arguments into
parameters for an internal "library" function.  Thus one can script repo by
either importing its library and calling the function directly in Python, or
by executing repo's plumbing command to get to the same function.  Human
commands might call multiple functions, and have a different entry point
that parses the command line arguments differently.

Original issue reported on code.google.com by code-rev...@gtempaccount.com on 24 Sep 2009 at 9:09

GoogleCodeExporter commented 9 years ago

Original comment by sop+code@google.com on 24 Sep 2009 at 11:11

GoogleCodeExporter commented 9 years ago
Basically we are ensuring the tool is stable for scripts by just never changing 
it.

:-)

Original comment by sop+code@google.com on 24 Sep 2009 at 11:15