go.fuchsia.dev/jiri@v0.0.0-20240502161911-b66513b29486/cmd/jiri/doc.go (about)

     1  // Copyright 2015 The Vanadium Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // This file was auto-generated via go generate.
     6  // DO NOT UPDATE MANUALLY
     7  
     8  /*
     9  Command jiri is a multi-purpose tool for multi-repo development.
    10  
    11  Usage:
    12     jiri [flags] <command>
    13  
    14  The jiri commands are:
    15     cl          Manage changelists for multiple projects
    16     import      Adds imports to .jiri_manifest file
    17     project     Manage the jiri projects
    18     snapshot    Manage project snapshots
    19     update      Update all jiri projects
    20     which       Show path to the jiri tool
    21     runp        Run a command in parallel across jiri projects
    22     help        Display help for commands or topics
    23  
    24  The jiri additional help topics are:
    25     filesystem  Description of jiri file system layout
    26     manifest    Description of manifest files
    27  
    28  The jiri flags are:
    29   -color=true
    30     Use color to format output.
    31   -v=false
    32     Print verbose output.
    33  
    34  The global flags are:
    35   -metadata=<just specify -metadata to activate>
    36     Displays metadata for the program and exits.
    37   -time=false
    38     Dump timing information to stderr before exiting the program.
    39  
    40  Jiri cl - Manage changelists for multiple projects
    41  
    42  Manage changelists for multiple projects.
    43  
    44  Usage:
    45     jiri cl [flags] <command>
    46  
    47  The jiri cl commands are:
    48     cleanup     Clean up changelists that have been merged
    49     upload      Upload a changelist for review
    50     new         Create a new local branch for a changelist
    51     sync        Bring a changelist up to date
    52  
    53  The jiri cl flags are:
    54   -color=true
    55     Use color to format output.
    56   -v=false
    57     Print verbose output.
    58  
    59  Jiri cl cleanup - Clean up changelists that have been merged
    60  
    61  Command "cleanup" checks that the given branches have been merged into the
    62  corresponding remote branch. If a branch differs from the corresponding remote
    63  branch, the command reports the difference and stops. Otherwise, it deletes the
    64  given branches.
    65  
    66  Usage:
    67     jiri cl cleanup [flags] <branches>
    68  
    69  <branches> is a list of branches to cleanup.
    70  
    71  The jiri cl cleanup flags are:
    72   -f=false
    73     Ignore unmerged changes.
    74   -remote-branch=main
    75     Name of the remote branch the CL pertains to, without the leading "origin/".
    76  
    77   -color=true
    78     Use color to format output.
    79   -v=false
    80     Print verbose output.
    81  
    82  Jiri cl upload - Upload a changelist for review
    83  
    84  Command "upload" squashes all commits of a local branch into a single "changelist"
    85  and uploads this changelist to Gerrit as a single commit. First time the command
    86  is invoked, it generates a Change-Id for the changelist, which is appended to
    87  the commit message. Consecutive invocations of the command use the same
    88  Change-Id by default, informing Gerrit that the incomming commit is an update of
    89  an existing changelist.
    90  
    91  Usage:
    92     jiri cl upload [flags]
    93  
    94  The jiri cl upload flags are:
    95   -autosubmit=false
    96     Automatically submit the changelist when feasible.
    97   -cc=
    98     Comma-seperated list of emails or LDAPs to cc.
    99   -check-uncommitted=true
   100     Check that no uncommitted changes exist.
   101   -clean-multipart-metadata=false
   102     Cleanup the metadata associated with multipart CLs pertaining the MultiPart:
   103     x/y message without uploading any CLs.
   104   -commit-message-body-file=
   105     file containing the body of the CL description, that is, text without a
   106     ChangeID, MultiPart etc.
   107   -current-project-only=false
   108     Run upload in the current project only.
   109   -d=false
   110     Send a draft changelist.
   111   -edit=true
   112     Open an editor to edit the CL description.
   113   -host=
   114     Gerrit host to use.  Defaults to gerrit host specified in manifest.
   115   -m=
   116     CL description.
   117   -presubmit=all
   118     The type of presubmit tests to run. Valid values: none,all.
   119   -r=
   120     Comma-seperated list of emails or LDAPs to request review.
   121   -remote-branch=main
   122     Name of the remote branch the CL pertains to, without the leading "origin/".
   123   -set-topic=true
   124     Set Gerrit CL topic.
   125   -topic=
   126     CL topic, defaults to <username>-<branchname>.
   127   -verify=true
   128     Run pre-push git hooks.
   129  
   130   -color=true
   131     Use color to format output.
   132   -v=false
   133     Print verbose output.
   134  
   135  Jiri cl new - Create a new local branch for a changelist
   136  
   137  Command "new" creates a new local branch for a changelist. In particular, it
   138  forks a new branch with the given name from the current branch and records the
   139  relationship between the current branch and the new branch in the .jiri metadata
   140  directory. The information recorded in the .jiri metadata directory tracks
   141  dependencies between CLs and is used by the "jiri cl sync" and "jiri cl upload"
   142  commands.
   143  
   144  Usage:
   145     jiri cl new [flags] <name>
   146  
   147  <name> is the changelist name.
   148  
   149  The jiri cl new flags are:
   150   -color=true
   151     Use color to format output.
   152   -v=false
   153     Print verbose output.
   154  
   155  Jiri cl sync - Bring a changelist up to date
   156  
   157  Command "sync" brings the CL identified by the current branch up to date with
   158  the branch tracking the remote branch this CL pertains to. To do that, the
   159  command uses the information recorded in the .jiri metadata directory to
   160  identify the sequence of dependent CLs leading to the current branch. The
   161  command then iterates over this sequence bringing each of the CLs up to date
   162  with its ancestor. The end result of this process is that all CLs in the
   163  sequence are up to date with the branch that tracks the remote branch this CL
   164  pertains to.
   165  
   166  NOTE: It is possible that the command cannot automatically merge changes in an
   167  ancestor into its dependent. When that occurs, the command is aborted and prints
   168  instructions that need to be followed before the command can be retried.
   169  
   170  Usage:
   171     jiri cl sync [flags]
   172  
   173  The jiri cl sync flags are:
   174   -remote-branch=main
   175     Name of the remote branch the CL pertains to, without the leading "origin/".
   176  
   177   -color=true
   178     Use color to format output.
   179   -v=false
   180     Print verbose output.
   181  
   182  Jiri import
   183  
   184  Command "import" adds imports to the [root]/.jiri_manifest file, which specifies
   185  manifest information for the jiri tool.  The file is created if it doesn't
   186  already exist, otherwise additional imports are added to the existing file.
   187  
   188  An <import> element is added to the manifest representing a remote manifest
   189  import.  The manifest file path is relative to the root directory of the remote
   190  import repository.
   191  
   192  Example:
   193    $ jiri import myfile https://foo.com/bar.git
   194  
   195  Run "jiri help manifest" for details on manifests.
   196  
   197  Usage:
   198     jiri import [flags] <manifest> <remote>
   199  
   200  <manifest> specifies the manifest file to use.
   201  
   202  <remote> specifies the remote manifest repository.
   203  
   204  The jiri import flags are:
   205   -name=manifest
   206     The name of the remote manifest project.
   207   -out=
   208     The output file.  Uses [root]/.jiri_manifest if unspecified.  Uses stdout
   209     if set to "-".
   210   -overwrite=false
   211     Write a new .jiri_manifest file with the given specification.  If it already
   212     exists, the existing content will be ignored and the file will be
   213     overwritten.
   214   -protocol=git
   215     The version control protocol used by the remote manifest project.
   216   -remote-branch=main
   217     The branch of the remote manifest project to track, without the leading
   218     "origin/".
   219   -root=
   220     Root to store the manifest project locally.
   221  
   222   -color=true
   223     Use color to format output.
   224   -v=false
   225     Print verbose output.
   226  
   227  Jiri patch - Patch in the existing change
   228  
   229  Command "patch" applies the existing changelist to the current project. The
   230  change can be identified either using change ID, in which case the latest
   231  patchset will be used, or the the full reference.
   232  
   233  A new branch will be created to apply the patch to. The default name of this
   234  branch is "change/<changeset>/<patchset>", but this can be overriden using the
   235  -branch flag. The command will fail if the branch already exists. The -delete
   236  flag will delete the branch if already exists. Use the -force flag to force
   237  deleting the branch even if it contains unmerged changes).
   238  
   239  Usage:
   240     jiri patch <change>
   241  
   242  <change> is a change ID or a full reference.
   243  
   244  The jiri project info flags are:
   245   -branch=
   246     Name of the branch the patch will be applied to
   247   -delete=false
   248     Delete the existing branch if already exists
   249   -force=false
   250     Use force when deleting the existing branch
   251   -host=
   252     Gerrit host to use.  Defaults to gerrit host specified in manifest.
   253  
   254   -color=true
   255     Use color to format output.
   256   -v=false
   257     Print verbose output.
   258  
   259  Jiri project - Manage the jiri projects
   260  
   261  Manage the jiri projects.
   262  
   263  Usage:
   264     jiri project [flags] <command>
   265  
   266  The jiri project commands are:
   267     clean        Restore jiri projects to their pristine state
   268     info         Provided structured input for existing jiri projects and
   269                  branches
   270     list         List existing jiri projects and branches
   271     shell-prompt Print a succinct status of projects suitable for shell prompts
   272  
   273  The jiri project flags are:
   274   -color=true
   275     Use color to format output.
   276   -v=false
   277     Print verbose output.
   278  
   279  Jiri project clean - Restore jiri projects to their pristine state
   280  
   281  Restore jiri projects back to their main branches and get rid of all the local
   282  branches and changes.
   283  
   284  Usage:
   285     jiri project clean [flags] <project ...>
   286  
   287  <project ...> is a list of projects to clean up.
   288  
   289  The jiri project clean flags are:
   290   -branches=false
   291     Delete all non-main branches.
   292  
   293   -color=true
   294     Use color to format output.
   295   -v=false
   296     Print verbose output.
   297  
   298  Jiri project info - Provided structured input for existing jiri projects and branches
   299  
   300  Inspect the local filesystem and provide structured info on the existing
   301  projects and branches. Projects are specified using either names or regular
   302  expressions that are matched against project names. If no command line
   303  arguments are provided the project that the contains the current directory is
   304  used, or if run from outside of a given project, all projects will be used. The
   305  information to be displayed can be specified using a Go template, supplied via
   306  the -template flag.
   307  
   308  Usage:
   309     jiri project info [flags] <project-names>...
   310  
   311  <project-names>... a list of project names
   312  
   313  The jiri project info flags are:
   314   -json-output=
   315     Path to write operation results to.
   316   -regexp=false
   317     Use argument as regular expression.
   318   -template=
   319     The template for the fields to display.
   320  
   321   -color=true
   322     Use color to format output.
   323   -v=false
   324     Print verbose output.
   325  
   326  Jiri project list - List existing jiri projects and branches
   327  
   328  Inspect the local filesystem and list the existing projects and branches.
   329  
   330  Usage:
   331     jiri project list [flags]
   332  
   333  The jiri project list flags are:
   334   -branches=false
   335     Show project branches.
   336   -nopristine=false
   337     If true, omit pristine projects, i.e. projects with a clean main branch and
   338     no other branches.
   339  
   340   -color=true
   341     Use color to format output.
   342   -v=false
   343     Print verbose output.
   344  
   345  Jiri project shell-prompt - Print a succinct status of projects suitable for shell prompts
   346  
   347  Reports current branches of jiri projects (repositories) as well as an
   348  indication of each project's status:
   349    *  indicates that a repository contains uncommitted changes
   350    %  indicates that a repository contains untracked files
   351  
   352  Usage:
   353     jiri project shell-prompt [flags]
   354  
   355  The jiri project shell-prompt flags are:
   356   -check-dirty=true
   357     If false, don't check for uncommitted changes or untracked files. Setting
   358     this option to false is dangerous: dirty main branches will not appear in
   359     the output.
   360   -show-name=false
   361     Show the name of the current repo.
   362  
   363   -color=true
   364     Use color to format output.
   365   -v=false
   366     Print verbose output.
   367  
   368  Jiri snapshot - Create a new project snapshot
   369  
   370  The "jiri snapshot <snapshot>" command captures the current project state
   371  in a manifest.
   372  
   373  Usage:
   374     jiri snapshot [flags] <snapshot>
   375  
   376  <snapshot> is the snapshot manifest file.
   377  
   378  The jiri snapshot create flags are:
   379   -time-format=2006-01-02T15:04:05Z07:00
   380     Time format for snapshot file name.
   381  
   382   -color=true
   383     Use color to format output.
   384   -v=false
   385     Print verbose output.
   386  
   387  Jiri update - Update all jiri projects
   388  
   389  Updates all projects. The sequence in which the individual updates happen
   390  guarantees that we end up with a consistent workspace. The set of projects
   391  to update is described in the manifest.
   392  
   393  Run "jiri help manifest" for details on manifests.
   394  
   395  Usage:
   396     jiri update [flags] <snapshot>
   397  
   398  <snapshot> is the snapshot manifest file.
   399  
   400  The jiri update flags are:
   401   -attempts=1
   402     Number of attempts before failing.
   403   -gc=false
   404     Garbage collect obsolete repositories.
   405   -manifest=
   406     Name of the project manifest.
   407  
   408   -color=true
   409     Use color to format output.
   410   -v=false
   411     Print verbose output.
   412  
   413  Jiri runp - Run a command in parallel across jiri projects
   414  
   415  Run a command in parallel across one or more jiri projects. Commands are run
   416  using the shell specified by the users $SHELL environment variable, or "sh"
   417  if that's not set. Thus commands are run as $SHELL -c "args..."
   418  
   419  Usage:
   420     jiri runp [flags] <command line>
   421  
   422  A command line to be run in each project specified by the supplied command line
   423  flags. Any environment variables intended to be evaluated when the command line
   424  is run must be quoted to avoid expansion before being passed to runp by the
   425  shell.
   426  
   427  The jiri runp flags are:
   428   -collate-stdout=true
   429     Collate all stdout output from each parallel invocation and display it as if
   430     had been generated sequentially. This flag cannot be used with
   431     -show-name-prefix, -show-key-prefix or -interactive.
   432   -env=
   433     specify an environment variable in the form: <var>=[<val>],...
   434   -exit-on-error=false
   435     If set, all commands will killed as soon as one reports an error, otherwise,
   436     each will run to completion.
   437   -has-branch=
   438     A regular expression specifying branch names to use in matching projects. A
   439     project will match if the specified branch exists, even if it is not checked
   440     out.
   441   -has-gerrit-message=false
   442     If specified, match branches that have, or have no, gerrit message
   443   -has-uncommitted=false
   444     If specified, match projects that have, or have no, uncommitted changes
   445   -has-untracked=false
   446     If specified, match projects that have, or have no, untracked files
   447   -interactive=true
   448     If set, the command to be run is interactive and should not have its
   449     stdout/stderr manipulated. This flag cannot be used with -show-name-prefix,
   450     -show-key-prefix or -collate-stdout.
   451   -merge-policies=+CCFLAGS,+CGO_CFLAGS,+CGO_CXXFLAGS,+CGO_LDFLAGS,+CXXFLAGS,GOARCH,GOOS,GOPATH:,^GOROOT*,+LDFLAGS,:PATH,VDLPATH:
   452     specify policies for merging environment variables
   453   -projects=
   454     A Regular expression specifying project keys to run commands in. By default,
   455     runp will use projects that have the same branch checked as the current
   456     project unless it is run from outside of a project in which case it will
   457     default to using all projects.
   458   -show-key-prefix=false
   459     If set, each line of output from each project will begin with the key of the
   460     project followed by a colon. This is intended for use with long running
   461     commands where the output needs to be streamed. Stdout and stderr are spliced
   462     apart. This flag cannot be used with -interactive, -show-name-prefix or
   463     -collate-stdout
   464   -show-name-prefix=false
   465     If set, each line of output from each project will begin with the name of the
   466     project followed by a colon. This is intended for use with long running
   467     commands where the output needs to be streamed. Stdout and stderr are spliced
   468     apart. This flag cannot be used with -interactive, -show-key-prefix or
   469     -collate-stdout.
   470   -v=false
   471     Print verbose logging information
   472  
   473   -color=true
   474     Use color to format output.
   475  
   476  Jiri help - Display help for commands or topics
   477  
   478  Help with no args displays the usage of the parent command.
   479  
   480  Help with args displays the usage of the specified sub-command or help topic.
   481  
   482  "help ..." recursively displays help for all commands and topics.
   483  
   484  Usage:
   485     jiri help [flags] [command/topic ...]
   486  
   487  [command/topic ...] optionally identifies a specific sub-command or help topic.
   488  
   489  The jiri help flags are:
   490   -style=compact
   491     The formatting style for help output:
   492        compact   - Good for compact cmdline output.
   493        full      - Good for cmdline output, shows all global flags.
   494        godoc     - Good for godoc processing.
   495        shortonly - Only output short description.
   496     Override the default by setting the CMDLINE_STYLE environment variable.
   497   -width=<terminal width>
   498     Format output to this target width in runes, or unlimited if width < 0.
   499     Defaults to the terminal width if available.  Override the default by setting
   500     the CMDLINE_WIDTH environment variable.
   501  
   502  Jiri filesystem - Description of jiri file system layout
   503  
   504  All data managed by the jiri tool is located in the file system under a root
   505  directory, colloquially called the jiri root directory.  The file system layout
   506  looks like this:
   507  
   508   [root]                              # root directory (name picked by user)
   509   [root]/.jiri_root                   # root metadata directory
   510   [root]/.jiri_root/bin               # contains tool binaries (jiri, etc.)
   511   [root]/.jiri_root/update_history    # contains history of update snapshots
   512   [root]/.manifest                    # contains jiri manifests
   513   [root]/[project1]                   # project directory (name picked by user)
   514   [root]/[project1]/.jiri             # project metadata directory
   515   [root]/[project1]/.jiri/metadata.v2 # project metadata file
   516   [root]/[project1]/.jiri/<<cls>>     # project per-cl metadata directories
   517   [root]/[project1]/<<files>>         # project files
   518   [root]/[project2]...
   519  
   520  The [root] and [projectN] directory names are picked by the user.  The <<cls>>
   521  are named via jiri cl new, and the <<files>> are named as the user adds files
   522  and directories to their project.  All other names above have special meaning to
   523  the jiri tool, and cannot be changed; you must ensure your path names don't
   524  collide with these special names.
   525  
   526  To find the [root] directory, the jiri binary looks for the .jiri_root
   527  directory, starting in the current working directory and walking up the
   528  directory chain. The search is terminated successfully when the .jiri_root
   529  directory is found; it fails after it reaches the root of the file system.
   530  Thus jiri must be invoked from the [root] directory or one of its
   531  subdirectories.  To invoke jiri from a different directory, you can set the
   532  -root flag to point to your [root] directory.
   533  
   534  Keep in mind that when "jiri update" is run, the jiri tool itself is
   535  automatically updated along with all projects.  Note that if you have multiple
   536  [root] directories on your file system, you must remember to run the jiri
   537  binary corresponding to your [root] directory.  Things may fail if you mix
   538  things up, since the jiri binary is updated with each call to "jiri update",
   539  and you may encounter version mismatches between the jiri binary and the
   540  various metadata files or other logic.
   541  
   542  The jiri binary is located at [root]/.jiri_root/bin/jiri
   543  
   544  Jiri manifest - Description of manifest files
   545  
   546  Jiri manifest files describe the set of projects that get synced when running
   547  "jiri update".
   548  
   549  The first manifest file that jiri reads is in [root]/.jiri_manifest.  This
   550  manifest **must** exist for the jiri tool to work.
   551  
   552  Usually the manifest in [root]/.jiri_manifest will import other manifests from
   553  remote repositories via <import> tags, but it can contain its own list of
   554  projects as well.
   555  
   556  Manifests have the following XML schema:
   557  
   558  <manifest>
   559    <imports>
   560      <import remote="https://vanadium.googlesource.com/manifest"
   561              manifest="public"
   562              name="manifest"
   563      />
   564      <localimport file="/path/to/local/manifest"/>
   565      ...
   566    </imports>
   567    <projects>
   568      <project name="my-project"
   569               path="path/where/project/lives"
   570               protocol="git"
   571               remote="https://github.com/myorg/foo"
   572               revision="ed42c05d8688ab23"
   573               remotebranch="my-branch"
   574               gerrithost="https://myorg-review.googlesource.com"
   575               githooks="path/to/githooks-dir"
   576               attributes="attr1,attr2..."
   577      />
   578      ...
   579    </projects>
   580    <hooks>
   581      <hook name="update"
   582            project="mojo/public"
   583            action="update.sh"/>
   584      ...
   585    </hooks>
   586  
   587  </manifest>
   588  
   589  The <import> and <localimport> tags can be used to share common projects across
   590  multiple manifests.
   591  
   592  A <localimport> tag should be used when the manifest being imported and the
   593  importing manifest are both in the same repository, or when neither one is in a
   594  repository.  The "file" attribute is the path to the manifest file being
   595  imported.  It can be absolute, or relative to the importing manifest file.
   596  
   597  If the manifest being imported and the importing manifest are in different
   598  repositories then an <import> tag must be used, with the following attributes:
   599  
   600  * remote (required) - The remote url of the repository containing the manifest
   601  to be imported
   602  
   603  * manifest (required) - The path of the manifest file to be imported, relative
   604  to the repository root.
   605  
   606  * name (optional) - The name of the project corresponding to the manifest
   607  repository.  If your manifest contains a <project> with the same remote as the
   608  manifest remote, then the "name" attribute of on the <import> tag should match
   609  the "name" attribute on the <project>.  Otherwise, jiri will clone the manifest
   610  repository on every update.
   611  
   612  The <project> tags describe the projects to sync, and what state they should
   613  sync to, accoring to the following attributes:
   614  
   615  * name (required) - The name of the project.
   616  
   617  * path (required) - The location where the project will be located, relative to
   618  the jiri root.
   619  
   620  * remote (required) - The remote url of the project repository.
   621  
   622  * protocol (optional) - The protocol to use when cloning and syncing the repo.
   623  Currently "git" is the default and only supported protocol.
   624  
   625  * remotebranch (optional) - The remote branch that the project will sync to.
   626  Defaults to "main".  The "remotebranch" attribute is ignored if "revision" is
   627  specified.
   628  
   629  * revision (optional) - The specific revision (usually a git SHA) that the
   630  project will sync to.  If "revision" is  specified then the "remotebranch"
   631  attribute is ignored.
   632  
   633  * gerrithost (optional) - The url of the Gerrit host for the project.  If
   634  specified, then running "jiri cl upload" will upload a CL to this Gerrit host.
   635  
   636  * githooks (optional) - The path (relative to [root]) of a directory containing
   637  git hooks that will be installed in the projects .git/hooks directory during
   638  each update.
   639  
   640  * attributes (optional) - If this field is specified, the default behavior does
   641  not fetch the project. However, you can include it by specifying the attribute
   642  with the -fetch-optional flag in the 'jiri init' invocation.
   643  
   644  The <hook> tag describes the hooks that must be executed after every 'jiri update'
   645  They are configured via the following attributes:
   646  
   647  * name (required) - The name of the of the hook to identify it
   648  
   649  * project (required) - The name of the project where the hook is present
   650  
   651  * action (required) - Action to be performed inside the project.
   652  It is mostly identified by a script
   653  */
   654  package main