Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 2 additions & 1 deletion docs/guides/model_selection.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,9 @@ Models:
#### Select with git changes

The git-based selector allows you to select models whose files have changed compared to a target branch (default: main). This includes:

- Untracked files (new files not in git)
- Uncommitted changes in working directory
- Uncommitted changes in working directory (both staged and unstaged)
- Committed changes different from the target branch

For example:
Expand Down
4 changes: 3 additions & 1 deletion sqlmesh/utils/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ def list_untracked_files(self) -> t.List[Path]:
)

def list_uncommitted_changed_files(self) -> t.List[Path]:
return self._execute_list_output(["diff", "--name-only", "--diff-filter=d"], self._git_root)
return self._execute_list_output(
["diff", "--name-only", "--diff-filter=d", "HEAD"], self._git_root
)

def list_committed_changed_files(self, target_branch: str = "main") -> t.List[Path]:
return self._execute_list_output(
Expand Down
Loading