Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ url: "https://github.com/BHFock/git-cl"
repository-code: "https://github.com/BHFock/git-cl"
license: BSD-3-Clause
doi: "10.5281/zenodo.18722077"
version: "1.1.6"
date-released: "2026-04-17"
version: "1.1.7"
date-released: "2026-05-16"
abstract: >-
git-cl is a command-line tool that brings changelist support to Git.
It introduces a pre-staging layer that allows developers to partition
Expand Down
12 changes: 11 additions & 1 deletion docs/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,16 @@ Example output of `git cl st`, showing files grouped by changelist with standard
alt="git cl st output showing changelists feature1, feature2, and No Changelist with colour-coded status codes"
width="200"/>

#### Hiding untracked files

If your repository has many untracked files that clutter the output, you can hide them with `--no-untracked`:

```
git cl st --no-untracked
```

This is useful when working on a focused task and you only want to see files already known to Git.

### 2.3 Diff a changelist

```
Expand Down Expand Up @@ -609,7 +619,7 @@ Yes. Each worktree has its own independent set of changelists — changes made i
| Task | Command | Alias |
| ------------------------------- | --------------------------------------------------------- | ------------- |
| Add files to a changelist | `git cl add <name> <files...>` | `git cl a` |
| View grouped status | `git cl status [--all] [--no-color] ` | `git cl st` |
| View grouped status | `git cl status [--all] [--no-untracked] [--no-color]` | `git cl st` |
| Show diff for changelist(s) | `git cl diff <name1> [<name2> ...] [--staged]` | |
| Stage a changelist | `git cl stage <name> [--delete]` | |
| Unstage a changelist | `git cl unstage <name> [--delete]` | |
Expand Down
18 changes: 14 additions & 4 deletions git-cl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Single file, zero dependencies beyond Python 3.9+ and Git.
Cross-platform: Unix (fcntl) and Windows (msvcrt) file locking.
"""

__version__ = "1.1.6"
__version__ = "1.1.7"

import argparse
import datetime
Expand Down Expand Up @@ -370,6 +370,8 @@ def clutil_get_git_status(include_untracked: bool = False) -> list[str]:
cmd = ["git", "status", "--porcelain"]
if include_untracked:
cmd.append("--untracked-files=all")
else:
cmd.append("--untracked-files=no")

try:
return subprocess.check_output(cmd, text=True).splitlines()
Expand Down Expand Up @@ -422,7 +424,9 @@ def clutil_sanitize_path(file_path: str, git_root: Path) -> Optional[str]:
return None


def clutil_get_file_status_map(show_all: bool = False) -> dict[str, str]:
def clutil_get_file_status_map(
show_all: bool = False,
include_untracked: bool = True) -> dict[str, str]:
"""
Get a mapping of files to their Git 2-letter status codes.

Expand All @@ -436,13 +440,15 @@ def clutil_get_file_status_map(show_all: bool = False) -> dict[str, str]:

Args:
show_all (bool): If True, include all files regardless of status code.
include_untracked (bool): If True (default), list every untracked file.
If False, untracked files are excluded entirely from the status map.

Returns:
dict[str, str]: Mapping of relative file paths
to their Git status codes.
"""
git_root = clutil_get_git_root()
output = clutil_get_git_status(include_untracked=True)
output = clutil_get_git_status(include_untracked=include_untracked)

# Allowlist of known meaningful status codes
INTERESTING_CODES = {
Expand Down Expand Up @@ -2525,7 +2531,9 @@ def cl_status(args: argparse.Namespace) -> None:
changelists = clutil_load()
stashes = clutil_load_stashes()
git_root = clutil_get_git_root()
status_map = clutil_get_file_status_map(show_all=args.all)
status_map = clutil_get_file_status_map(
show_all=args.all,
include_untracked=not args.no_untracked)

use_color = clutil_should_use_color(args)

Expand Down Expand Up @@ -3241,6 +3249,8 @@ def main() -> None:
status_parser.add_argument('--all', action='store_true',
help=("Include files with uncommon Git "
"status codes"))
status_parser.add_argument('--no-untracked', action='store_true',
help='Hide untracked files (??) from output')
status_parser.add_argument('--no-color', action='store_true',
help='Disable colored output')
status_parser.set_defaults(func=cl_status)
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = git-changelists
version = 1.1.6
version = 1.1.7
author = Bjoern Hendrik Fock
description = Git subcommand for named changelist support. Group working directory files by intent, then stage, commit, or branch by changelist.
long_description = file: README.md
Expand Down
Loading