The current list output only shows project paths relative to the
root of the repo client checkout. It can be helpful to also get
a listing of paths based on other paths (e.g. the current working
directory), so add an option to repo list to support that. We'll
leverage this in bash completion to support completing projects by
their local paths and not just remote names.
Bug: https://crbug.com/gerrit/14797
Change-Id: Ia2b35d18c890217768448118b003874a1016efd4
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/312904
Reviewed-by: Xin Li <delphij@google.com>
Tested-by: Mike Frysinger <vapier@google.com>
Let's keep the main processing loop free of subcommand implementations
by pulling the existing help & start commands into dedicated functions.
Having a single giant function is harder to track as we add more and
more logic in.
Bug: https://crbug.com/gerrit/14797
Change-Id: I2b62dc430c0e7574f09aa4838f4ef03fbe4bf7fb
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/312903
Reviewed-by: Xin Li <delphij@google.com>
Tested-by: Mike Frysinger <vapier@google.com>
If we can't provide any completions, then fallback to the standard
bash & readline ones. This allows completion based on the user's
settings (e.g. local paths) to kick in.
Bug: https://crbug.com/gerrit/14797
Test: `repo rebase ./src/<tab>` works in a CrOS checkout
Change-Id: Iced343c4fc6fd3a932aab99875c1346687d187b6
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/312902
Reviewed-by: Xin Li <delphij@google.com>
Tested-by: Mike Frysinger <vapier@google.com>
We've had a limited version of this in CrOS for a long time. There's
nothing CrOS specific about it, so lets move it to the repo project so
everyone can utilize it.
Change-Id: I04cd94610c1100f3afcd2baf8c8e7ab13e589490
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/299202
Reviewed-by: Michael Mortensen <mmortensen@google.com>
Tested-by: Mike Frysinger <vapier@google.com>