This change improves information density by using Base36 (0-9, a-z) instead of hex (0-9, a-f) for hash-based issue IDs. Key benefits: - Shorter IDs: Can now use 3-char IDs (was 4-char minimum) - Better scaling: 3 chars good for ~160 issues, 4 chars for ~980 issues - Case-insensitive: Maintains excellent CLI usability - Backward compatible: Old hex IDs continue to work Changes: - Implemented Base36 encoding with proper truncation (keep LSB) - Updated adaptive length thresholds (3-8 chars instead of 4-8) - Fixed collision probability math to match encoding (was calculating for base36 but encoding in hex - now both use base36) - Fixed ID parser bug (use prefixWithHyphen for substring matching) - Updated all tests and test data patterns Fixes #213 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
25 lines
712 B
Plaintext
25 lines
712 B
Plaintext
# Test bd dep add command
|
|
bd init --prefix test
|
|
|
|
# Create issues and capture their hash IDs from output
|
|
bd create 'First issue'
|
|
cp stdout first.txt
|
|
grep 'Created issue: test-' first.txt
|
|
|
|
bd create 'Second issue'
|
|
cp stdout second.txt
|
|
grep 'Created issue: test-' second.txt
|
|
|
|
# Extract IDs using grep (hash IDs are test-XXXXXXXX format)
|
|
exec sh -c 'grep -oE "test-[a-z0-9]+" first.txt > first_id.txt'
|
|
exec sh -c 'grep -oE "test-[a-z0-9]+" second.txt > second_id.txt'
|
|
|
|
# Add dependency: second depends on first
|
|
exec sh -c 'bd dep add $(cat second_id.txt) $(cat first_id.txt)'
|
|
stdout 'Added dependency'
|
|
|
|
# Verify the dependency was added
|
|
exec sh -c 'bd show $(cat second_id.txt)'
|
|
stdout 'Depends on'
|
|
stdout 'test-'
|