Skip to content

Conversation

@echobt
Copy link
Contributor

@echobt echobt commented Jan 21, 2026

This PR adds a new vgrep clean command to identify and remove entries from the database that correspond to files that no longer exist on the filesystem.

Features

  • vgrep clean: Scans the database for stale entries and prompts for removal.
  • vgrep clean --dry-run: Shows which entries would be removed without making changes.
  • vgrep clean --force: Removes stale entries without interactive confirmation (useful for scripts).

Usage

# Preview what will be cleaned
vgrep clean --dry-run

# Interactive cleanup
vgrep clean

# Force cleanup (non-interactive)
vgrep clean --force

Verification

I reproduced the issue by manually inserting stale entries into the database and verified that:

  1. vgrep clean --dry-run correctly identifies them.
  2. vgrep clean --force successfully removes them.
  3. vgrep clean (interactive) works when running in a terminal.

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.

3 participants