@@ -56,7 +56,7 @@ Single file, zero dependencies beyond Python 3.9+ and Git.
5656Cross-platform: Unix (fcntl) and Windows (msvcrt) file locking.
5757"""
5858
59- __version__ = "1.1.6 "
59+ __version__ = "1.1.7 "
6060
6161import argparse
6262import datetime
@@ -370,6 +370,8 @@ def clutil_get_git_status(include_untracked: bool = False) -> list[str]:
370370 cmd = ["git" , "status" , "--porcelain" ]
371371 if include_untracked :
372372 cmd .append ("--untracked-files=all" )
373+ else :
374+ cmd .append ("--untracked-files=no" )
373375
374376 try :
375377 return subprocess .check_output (cmd , text = True ).splitlines ()
@@ -422,7 +424,9 @@ def clutil_sanitize_path(file_path: str, git_root: Path) -> Optional[str]:
422424 return None
423425
424426
425- def clutil_get_file_status_map (show_all : bool = False ) -> dict [str , str ]:
427+ def clutil_get_file_status_map (
428+ show_all : bool = False ,
429+ include_untracked : bool = True ) -> dict [str , str ]:
426430 """
427431 Get a mapping of files to their Git 2-letter status codes.
428432
@@ -436,13 +440,15 @@ def clutil_get_file_status_map(show_all: bool = False) -> dict[str, str]:
436440
437441 Args:
438442 show_all (bool): If True, include all files regardless of status code.
443+ include_untracked (bool): If True (default), list every untracked file.
444+ If False, untracked files are excluded entirely from the status map.
439445
440446 Returns:
441447 dict[str, str]: Mapping of relative file paths
442448 to their Git status codes.
443449 """
444450 git_root = clutil_get_git_root ()
445- output = clutil_get_git_status (include_untracked = True )
451+ output = clutil_get_git_status (include_untracked = include_untracked )
446452
447453 # Allowlist of known meaningful status codes
448454 INTERESTING_CODES = {
@@ -2525,7 +2531,9 @@ def cl_status(args: argparse.Namespace) -> None:
25252531 changelists = clutil_load ()
25262532 stashes = clutil_load_stashes ()
25272533 git_root = clutil_get_git_root ()
2528- status_map = clutil_get_file_status_map (show_all = args .all )
2534+ status_map = clutil_get_file_status_map (
2535+ show_all = args .all ,
2536+ include_untracked = not args .no_untracked )
25292537
25302538 use_color = clutil_should_use_color (args )
25312539
@@ -3241,6 +3249,8 @@ def main() -> None:
32413249 status_parser .add_argument ('--all' , action = 'store_true' ,
32423250 help = ("Include files with uncommon Git "
32433251 "status codes" ))
3252+ status_parser .add_argument ('--no-untracked' , action = 'store_true' ,
3253+ help = 'Hide untracked files (??) from output' )
32443254 status_parser .add_argument ('--no-color' , action = 'store_true' ,
32453255 help = 'Disable colored output' )
32463256 status_parser .set_defaults (func = cl_status )
0 commit comments