Skip to content

Commit ab6a62f

Browse files
committed
Clarify ignored files documentation and add defensive cleanup
- Changed ambiguous "❌ No" to "✅ Excluded" for ignored files row - Added "(gitignore)" label to make it clear what "ignored" means - Updated explanation to "Correctly excluded - rules don't trigger" - Added `unset GIT_INDEX_FILE` after temp index cleanup for defensive coding
1 parent 5e21be3 commit ab6a62f

2 files changed

Lines changed: 16 additions & 15 deletions

File tree

src/deepwork/core/git_utils.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@
4141
- CLEAN: Respects .gitignore automatically
4242
4343
WHAT WE CAN DETECT:
44-
| Scenario | Handled? | Explanation |
45-
|-----------------------|----------|-------------------------------------------|
46-
| Modified files | ✅ Yes | Git detects content hash changed |
47-
| New untracked files | ✅ Yes | git add -A captures them in temp index |
48-
| Deleted files | ✅ Yes | Tree comparison shows them as missing |
49-
| Staged vs Unstaged | ✅ Yes | We look at disk state, ignore staging |
50-
| Ignored files | ❌ No | git add respects .gitignore (by design) |
44+
| Scenario | Detected? | Explanation |
45+
|-----------------------|-----------|-------------------------------------------|
46+
| Modified files | ✅ Yes | Git detects content hash changed |
47+
| New untracked files | ✅ Yes | git add -A captures them in temp index |
48+
| Deleted files | ✅ Yes | Tree comparison shows them as missing |
49+
| Staged vs Unstaged | ✅ Yes | We look at disk state, ignore staging |
50+
| Ignored files (.gitignore) | ✅ Excluded | Correctly excluded - rules don't trigger |
5151
5252
KEY GIT PLUMBING CONCEPTS:
5353
- GIT_INDEX_FILE: By setting this env var, Git uses a different index file.

src/deepwork/standard_jobs/deepwork_rules/hooks/capture_prompt_work_tree.sh

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@
3434
# - CLEAN: Respects .gitignore automatically
3535
#
3636
# WHAT WE CAN DETECT:
37-
# | Scenario | Handled? | Explanation |
38-
# |-----------------------|----------|-------------------------------------------|
39-
# | Modified files | ✅ Yes | Git detects content hash changed |
40-
# | New untracked files | ✅ Yes | git add -A captures them in temp index |
41-
# | Deleted files | ✅ Yes | Tree comparison shows them as missing |
42-
# | Staged vs Unstaged | ✅ Yes | We look at disk state, ignore staging |
43-
# | Ignored files | ❌ No | git add respects .gitignore (by design) |
37+
# | Scenario | Detected? | Explanation |
38+
# |-----------------------|-----------|-------------------------------------------|
39+
# | Modified files | ✅ Yes | Git detects content hash changed |
40+
# | New untracked files | ✅ Yes | git add -A captures them in temp index |
41+
# | Deleted files | ✅ Yes | Tree comparison shows them as missing |
42+
# | Staged vs Unstaged | ✅ Yes | We look at disk state, ignore staging |
43+
# | Ignored files (.gitignore) | ✅ Excluded | Correctly excluded - rules don't trigger |
4444
#
4545
# =============================================================================
4646

@@ -65,8 +65,9 @@ git add -A 2>/dev/null || true
6565
# This stores the snapshot in git's object database without creating a commit
6666
TREE_HASH=$(git write-tree 2>/dev/null || echo "")
6767

68-
# 5. Clean up the temporary index
68+
# 5. Clean up the temporary index and restore environment
6969
rm -f "$TEMP_INDEX"
70+
unset GIT_INDEX_FILE # Restore normal Git behavior
7071

7172
# 6. Save the tree hash for later comparison by rules_check
7273
if [ -n "$TREE_HASH" ]; then

0 commit comments

Comments
 (0)