Skip to content

[BUG] bmignore weirdness #819

Closed
Closed

Description

@phernandez

Bug Description

Image

Issue: is it a known expected behavior (reproduced this on my system) the behavior appears likely to be general rather than environment-specific because rclone --dump filters shows the shipped rule compiling to a terminal-segment regex that does not match hidden directory contents. in other words when doing bm bisync to cloud

bmignore.rclone

config.json/**

and

.*

does NOT exclude config.json files nor .folders at the root. (i have a 1 pager explaining in more detail but i dont know if this is the proper for long stuff...)

Steps To Reproduce

Activity

  1. added
    bug
    on May 14, 2026
  2. claude commented on May 14, 2026

    @claude
    Contributor

    Claude finished @phernandez's task in 3m 39s —— View job • claude/issue-819-20260514-0002 • Create PR ➔


    Triage Complete

    Type: Bug — Cloud functionality
    Priority: Medium — affects all users of bm bisync
    Component: Cloud / bisync
    Complexity: Simple fix, clear root cause


    Root Cause

    Two bugs in convert_bmignore_to_rclone_filters() in src/basic_memory/cli/commands/cloud/bisync_commands.py:

    Bug 1 — config.json not excluded as a file:
    Patterns without wildcards (e.g. config.json) were converted to - config.json/**. In rclone, /** suffix targets directory contents — it excludes what's inside a directory named config.json, but not the config.json file itself. So the file synced to cloud.

    Bug 2 — .* doesn't cover hidden directory contents:
    Wildcard patterns like .* were emitted as - .* only. rclone globs treat * as not crossing /, so - .* matches hidden files but .obsidian/workspace.json would pass through unfiltered.

    Fix

    bisync_commands.py: For every gitignore pattern, now emit two rclone rules:

    • - pattern — excludes the item itself (file or directory entry)
    • - pattern/** — excludes all contents when the item is a directory

    The only exception is patterns already ending with /** (emitted as-is to avoid doubling).

    Changes

    • Gather context and read issue
    • Identify root cause
    • Fix convert_bmignore_to_rclone_filters() in bisync_commands.py
    • Add regression tests (test_convert_bmignore_file_pattern_not_mangled_as_directory, test_convert_bmignore_hidden_glob_covers_directory_contents)
    • Committed and pushed
  3. added
    cloud
    on May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcloud

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions