Skip to content

Fix doclinks use git#942

Closed
spomichter wants to merge 2 commits intodevfrom
fix-doclinks-use-git
Closed

Fix doclinks use git#942
spomichter wants to merge 2 commits intodevfrom
fix-doclinks-use-git

Conversation

@spomichter
Copy link
Contributor

No description provided.

@spomichter spomichter requested a review from a team January 4, 2026 13:00
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 4, 2026

Greptile Summary

Refactors doclinks.py to use git ls-files instead of manually parsing .gitignore and walking the directory tree with os.walk. This simplifies the codebase by ~60 lines while achieving the same goal of indexing only git-tracked files. The change is cleaner and more reliable since it delegates gitignore handling to git itself.

  • Replaced load_gitignore_patterns() and should_ignore() functions with get_git_tracked_files() which calls git ls-files --cached --others --exclude-standard
  • Simplified build_file_index() and build_doc_index() to iterate over the tracked files list instead of using os.walk with manual filtering
  • Removed Pikchr diagram source from reactivex.md, keeping only the pre-generated SVG (follows previous commit that removed Pikchr tooling)

Confidence Score: 5/5

  • This PR is safe to merge - it simplifies existing functionality using a more reliable approach with no behavioral changes
  • The changes replace manual gitignore parsing with git's built-in file tracking. The git ls-files command correctly includes both cached (committed) and untracked-but-not-ignored files, matching the original behavior. Error handling is preserved. Existing tests cover the public API (build_file_index, build_doc_index) and should validate the refactor.
  • No files require special attention

Important Files Changed

Filename Overview
dimos/utils/docs/doclinks.py Refactored file indexing to use git ls-files instead of manual gitignore parsing and os.walk, simplifying code by ~60 lines while maintaining identical functionality.
docs/api/sensor_streams/reactivex.md Removed Pikchr diagram source code block, keeping only the pre-generated SVG image reference.

Sequence Diagram

sequenceDiagram
    participant Client as doclinks CLI
    participant Git as Git subprocess
    participant FS as File System
    
    Client->>Git: git ls-files --cached --others --exclude-standard
    Git-->>Client: List of tracked file paths
    Client->>Client: Build file index from paths
    Client->>Client: Build doc index (filter .md files)
    Client->>FS: Read markdown files
    Client->>Client: Process links using indices
    Client->>FS: Write updated markdown files
Loading


When you subscribe, data flows through a pipeline:

<details>
Copy link
Contributor

Choose a reason for hiding this comment

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

just this deletion sneaked in, otherwise looking good

@spomichter
Copy link
Contributor Author

#943 overrides

@spomichter spomichter closed this Jan 4, 2026
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.

2 participants