Skip to content

completion: Use same config as list-topics for topic completion - #288

Open
jerry-skydio wants to merge 1 commit into
mainfrom
jerry/revup/main/fixcomp
Open

completion: Use same config as list-topics for topic completion#288
jerry-skydio wants to merge 1 commit into
mainfrom
jerry/revup/main/fixcomp

Conversation

@jerry-skydio

Copy link
Copy Markdown
Collaborator

Tab completion built git with hardcoded values (origin/main, empty base
branch globs) instead of the repo config, so it picked the wrong base
branch and surfaced thousands of stale historical topics. Two fixes:

  • Apply config to the parsers before argcomplete runs, so completers see
    the same resolved settings normal commands do.
  • topic_completer now builds git and topics via make_git/get_topics
    exactly as list-topics does, from the parsed namespace.

Consolidate get_git into make_git (now takes the namespace directly),
which also breaks the completion -> revup cyclic import.

Tab completion built git with hardcoded values (origin/main, empty base
branch globs) instead of the repo config, so it picked the wrong base
branch and surfaced thousands of stale historical topics. Two fixes:

- Apply config to the parsers before argcomplete runs, so completers see
  the same resolved settings normal commands do.
- topic_completer now builds git and topics via make_git/get_topics
  exactly as list-topics does, from the parsed namespace.

Consolidate get_git into make_git (now takes the namespace directly),
which also breaks the completion -> revup cyclic import.
@jerry-skydio

Copy link
Copy Markdown
Collaborator Author

Reviews in this chain:
#288 completion: Use same config as list-topics for topic completion

@jerry-skydio

Copy link
Copy Markdown
Collaborator Author
# head base diff date summary
0 63a0e0d4 69101c6b diff Aug 7 14:50 PM 3 files changed, 35 insertions(+), 41 deletions(-)

Comment thread revup/completion.py
Comment on lines +52 to +53
base_branch = getattr(parsed_args, "base_branch", None) or ""
relative_branch = getattr(parsed_args, "relative_branch", None) or ""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these should be set regardless, but None if not passed? i.e. this can be

Suggested change
base_branch = getattr(parsed_args, "base_branch", None) or ""
relative_branch = getattr(parsed_args, "relative_branch", None) or ""
base_branch = parsed_args.base_branch or ""
relative_branch = parsed_args.relative_branch or ""

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants