Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

group member becomes obsolete after repo is removed #211

Closed
nosarthur opened this issue Jan 25, 2022 · 2 comments · Fixed by #226
Closed

group member becomes obsolete after repo is removed #211

nosarthur opened this issue Jan 25, 2022 · 2 comments · Fixed by #226
Labels
bug Something isn't working

Comments

@nosarthur
Copy link
Owner

Here I set that group as context, when calling gita super, got this traceback

15:35 (quote-mode *) gita $ gita super -q xx
['xx']
Traceback (most recent call last):
  File "/usr/local/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/Users/dzhou/src/gita/gita/__main__.py", line 670, in <module>
    main()  # pragma: no cover
  File "/Users/dzhou/src/gita/gita/__main__.py", line 665, in main
    args.func(args)
  File "/Users/dzhou/src/gita/gita/__main__.py", line 368, in f_super
    repos, cmds = utils.parse_repos_and_rest(args.man, args.quote_mode)
  File "/Users/dzhou/src/gita/gita/utils.py", line 495, in parse_repos_and_rest
    chosen[r] = repos[r]
KeyError: 'wikidata'
@nosarthur nosarthur added the bug Something isn't working label Jan 25, 2022
@nosarthur
Copy link
Owner Author

It seems there are already code to update group config file when gita rm <repo> is called. Maybe my setting predates the corresponding change and this traceback won't really occur in reality.

Keep the issue for future reference

@nosarthur
Copy link
Owner Author

I think I moved the wikidata repo in shell, but didn't gita rm <repo> (it probably won't allow me to after being moved), thus the repo config file is not updated. utils.get_repos() will automatically skip obsolete files.

We should update the repo and group config if utils.get_repos() detects invalid registered repos, i.e., run the same logic in f_rm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant