summaryrefslogtreecommitdiff
path: root/completion.bash
AgeCommit message (Collapse)Author
2025-08-21standardize file header wrt licensingMike Frysinger
We've been slightly inconsistent in the license header in files. Standardize them so we can automate checking. Change-Id: I3cdf85c9485d33cac2bb05c8080dfada3e5a5e8d Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/500102 Reviewed-by: Gavin Mak <gavinmak@google.com> Tested-by: Mike Frysinger <vapier@google.com> Commit-Queue: Mike Frysinger <vapier@google.com>
2021-07-27bash-completion: complete projects with repo forallMike Frysinger
We need to add a little bit more logic here so we stop completing projects once we see the -c argument. Bug: https://crbug.com/gerrit/14797 Change-Id: Ic2ba4f3dd616ec49d8ad754ff62d0d6e0250dbe6 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/312905 Reviewed-by: Xin Li <delphij@google.com> Tested-by: Mike Frysinger <vapier@google.com>
2021-07-27list: add a --relative-to optionMike Frysinger
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>
2021-07-27bash-completion: refactor unique subcommand processingMike Frysinger
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>
2021-07-27bash-completion: fallback to default completionMike Frysinger
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>
2021-03-15bash-completion: initial import based on CrOS versionMike Frysinger
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>