feat(kugetsu): add git server configuration management #83

Closed
shoko wants to merge 0 commits from feat/issue-78-git-server-config into main
Owner

Summary

Add kugetsu server command for managing git server configurations.

Commands

  • kugetsu server list - List all configured git servers
  • kugetsu server add <name> <url> - Add a new git server
  • kugetsu server remove <name> - Remove a git server
  • kugetsu server default [<name>] - Get or set default server
  • kugetsu server get [<name>] - Get URL for a server

Changes

  • Update get_repo_url() to use GIT_SERVERS config with proper precedence:
    1. repos.json (direct mapping)
    2. GIT_SERVERS (matching hostname)
    3. DEFAULT_GIT_SERVER
    4. github.com (fallback)
  • Update cmd_init to create config with default git servers

Config File

declare -A GIT_SERVERS
GIT_SERVERS["github.com"]="https://github.com"
GIT_SERVERS["git.fbrns.co"]="https://git.fbrns.co"
DEFAULT_GIT_SERVER="github.com"

Fixes #78

## Summary Add `kugetsu server` command for managing git server configurations. ## Commands - `kugetsu server list` - List all configured git servers - `kugetsu server add <name> <url>` - Add a new git server - `kugetsu server remove <name>` - Remove a git server - `kugetsu server default [<name>]` - Get or set default server - `kugetsu server get [<name>]` - Get URL for a server ## Changes - Update `get_repo_url()` to use GIT_SERVERS config with proper precedence: 1. repos.json (direct mapping) 2. GIT_SERVERS (matching hostname) 3. DEFAULT_GIT_SERVER 4. github.com (fallback) - Update `cmd_init` to create config with default git servers ## Config File ```bash declare -A GIT_SERVERS GIT_SERVERS["github.com"]="https://github.com" GIT_SERVERS["git.fbrns.co"]="https://git.fbrns.co" DEFAULT_GIT_SERVER="github.com" ``` Fixes #78
shoko added 1 commit 2026-04-02 01:07:45 +02:00
Add 'kugetsu server' command for managing git server configurations:
- kugetsu server list              List all configured git servers
- kugetsu server add <name> <url>  Add a new git server
- kugetsu server remove <name>     Remove a git server
- kugetsu server default [<name>]   Get or set default server
- kugetsu server get [<name>]       Get URL for a server

Update get_repo_url() to use GIT_SERVERS config:
- First checks repos.json for direct mapping
- Then checks GIT_SERVERS for matching hostname
- Falls back to DEFAULT_GIT_SERVER
- Falls back to github.com as last resort

Update cmd_init to create config with default git servers:
- github.com -> https://github.com
- git.fbrns.co -> https://git.fbrns.co

Fixes #78
First-time contributor

please remove this line GIT_SERVERS["git.fbrns.co"]="https://git.fbrns.co"

please remove this line GIT_SERVERS["git.fbrns.co"]="https://git.fbrns.co"
First-time contributor

also is it possible to have the config file being written during kugetsu init? especially if the file exist during init, we can --force to overwrite it

also is it possible to have the config file being written during kugetsu init? especially if the file exist during init, we can --force to overwrite it
First-time contributor

can we utilize config file or does using a separate config file is a must?

can we utilize config file or does using a separate config file is a must?
Author
Owner

@han Good point - removing the hardcoded git.fbrns.co entry. Users should add their own servers via kugetsu server add.

@han Good point - removing the hardcoded git.fbrns.co entry. Users should add their own servers via `kugetsu server add`.
Author
Owner

@han Good suggestion! I will update cmd_init to support regenerating the config file with --force flag.

@han Good suggestion! I will update cmd_init to support regenerating the config file with --force flag.
Author
Owner

@han We ARE using the existing ~/.kugetsu/config file. The GIT_SERVERS is added to that file during init. There is no separate config file.

@han We ARE using the existing ~/.kugetsu/config file. The GIT_SERVERS is added to that file during init. There is no separate config file.
shoko added 1 commit 2026-04-02 02:25:15 +02:00
- Remove hardcoded git.fbrns.co server (users should add their own)
- Add comment about how to add servers
- Support --force flag in cmd_init to regenerate config file

This addresses han's review feedback:
1. Removed git.fbrns.co from default config
2. Config file can now be regenerated with --force flag
3. We continue using the existing config file (not separate file)
han approved these changes 2026-04-02 02:27:04 +02:00
han left a comment
First-time contributor

lgtm

lgtm
shoko closed this pull request 2026-04-02 02:27:55 +02:00
shoko deleted branch feat/issue-78-git-server-config 2026-04-02 02:27:55 +02:00

Pull request closed

Sign in to join this conversation.