@@ -311,17 +311,22 @@ def display_diff(
311311 * ,
312312 left_label : str ,
313313 right_label : str ,
314+ ignore_missing : bool = False ,
314315) -> None :
315316 """Render diff showing only changed hashes."""
316317 differences : List [tuple [str , str , str ]] = []
317318
318319 for path in left :
319320 right_hash = right .get (path , "<missing>" )
320321 if left [path ] != right_hash :
322+ if ignore_missing and right_hash == "<missing>" :
323+ continue
321324 differences .append ((path , left [path ], right_hash ))
322325
323326 for path in right :
324327 if path not in left :
328+ if ignore_missing :
329+ continue
325330 differences .append ((path , "<missing>" , right [path ]))
326331
327332 if not differences :
@@ -433,6 +438,12 @@ def hash_cmd(
433438 default = None ,
434439 help = "Limit to N levels (0=root, 1=folders, 2=files, 3=tests)." ,
435440)
441+ @click .option (
442+ "--ignore-missing" ,
443+ is_flag = True ,
444+ default = False ,
445+ help = "Hide entries that exist in only one directory." ,
446+ )
436447@hash_options
437448def compare_cmd (
438449 left_folder : str ,
@@ -441,6 +452,7 @@ def compare_cmd(
441452 tests : bool ,
442453 root : bool ,
443454 depth : Optional [int ],
455+ ignore_missing : bool ,
444456) -> None :
445457 """Compare two fixture directories and show differences."""
446458 try :
@@ -474,6 +486,7 @@ def compare_cmd(
474486 right_hashes ,
475487 left_label = left_folder ,
476488 right_label = right_folder ,
489+ ignore_missing = ignore_missing ,
477490 )
478491 sys .exit (1 )
479492 except PermissionError as e :
0 commit comments