Remove nodb_prefix.txt in favor of config.yaml
Remove support for the legacy .beads/nodb_prefix.txt file and use the cleaner config.yaml approach exclusively for setting the issue prefix. This simplifies the configuration system and makes it more consistent. Changes: - Remove nodb_prefix.txt creation in cmd/bd/init.go - Remove nodb_prefix.txt check in cmd/bd/nodb.go detectPrefix() - Update error message to recommend config.yaml instead - Update documentation to reflect config.yaml-only approach New prefix detection order for --no-db mode: 1. issue-prefix in config.yaml (if set) 2. Common prefix from existing issues (if all share same prefix) 3. Current directory name (fallback) Users should now set the prefix in .beads/config.yaml: issue-prefix: "myproject" Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
@@ -111,20 +111,10 @@ func loadIssuesFromJSONL(path string) ([]*types.Issue, error) {
|
||||
|
||||
// detectPrefix detects the issue prefix to use in --no-db mode
|
||||
// Priority:
|
||||
// 1. .beads/nodb_prefix.txt file (if exists)
|
||||
// 2. issue-prefix from config.yaml (if set)
|
||||
// 3. Common prefix from existing issues (if all share same prefix)
|
||||
// 4. Current directory name (fallback)
|
||||
// 1. issue-prefix from config.yaml (if set)
|
||||
// 2. Common prefix from existing issues (if all share same prefix)
|
||||
// 3. Current directory name (fallback)
|
||||
func detectPrefix(beadsDir string, memStore *memory.MemoryStorage) (string, error) {
|
||||
// Check for nodb_prefix.txt
|
||||
prefixFile := filepath.Join(beadsDir, "nodb_prefix.txt")
|
||||
if data, err := os.ReadFile(prefixFile); err == nil {
|
||||
prefix := strings.TrimSpace(string(data))
|
||||
if prefix != "" {
|
||||
return prefix, nil
|
||||
}
|
||||
}
|
||||
|
||||
// Check config.yaml for issue-prefix
|
||||
configPrefix := config.GetString("issue-prefix")
|
||||
if configPrefix != "" {
|
||||
@@ -152,7 +142,7 @@ func detectPrefix(beadsDir string, memStore *memory.MemoryStorage) (string, erro
|
||||
|
||||
// If issues have mixed prefixes, we can't auto-detect
|
||||
if !allSame {
|
||||
return "", fmt.Errorf("issues have mixed prefixes, please create .beads/nodb_prefix.txt with the desired prefix")
|
||||
return "", fmt.Errorf("issues have mixed prefixes, please set issue-prefix in .beads/config.yaml")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user