-
-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improvements to gix clean
#1470
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great! It even properly handles the intuitively tricky case where the repo has a git worktree
managed worktree that is nested inside an unrelated repository that is itself nested inside an ignored directory. The directory for the unrelated repository is removed, except for its subdirectory that is our worktree.
ek@Glub:~/src/has-deeply-nested-worktree (main)$ git worktree list
/home/ek/src/has-deeply-nested-worktree e53b380 [main]
/home/ek/src/has-deeply-nested-worktree/subdir/blah/tricky e53b380 [tricky]
/home/ek/src/has-deeply-nested-worktree/subdir/mybranch e53b380 [mybranch]
ek@Glub:~/src/has-deeply-nested-worktree (main)$ tree
.
└── subdir
├── blah
│ ├── bar
│ ├── foo
│ └── tricky
└── mybranch
4 directories, 2 files
ek@Glub:~/src/has-deeply-nested-worktree (main)$ gix clean -xdrn
WOULD remove repository subdir/blah/.git/ (🗑️)
WOULD remove subdir/blah/bar (🗑️)
WOULD remove subdir/blah/foo (🗑️)
ek@Glub:~/src/has-deeply-nested-worktree (main)$ git worktree remove subdir/mybranch
ek@Glub:~/src/has-deeply-nested-worktree (main)$ git worktree list
/home/ek/src/has-deeply-nested-worktree e53b380 [main]
/home/ek/src/has-deeply-nested-worktree/subdir/blah/tricky e53b380 [tricky]
ek@Glub:~/src/has-deeply-nested-worktree (main)$ gix clean -xdrn
WOULD remove repository subdir/blah/.git/ (🗑️)
WOULD remove subdir/blah/bar (🗑️)
WOULD remove subdir/blah/foo (🗑️)
ek@Glub:~/src/has-deeply-nested-worktree (main)$ gix clean -xdre
removing repository subdir/blah/.git/ (🗑️)
removing subdir/blah/bar (🗑️)
removing subdir/blah/foo (🗑️)
ek@Glub:~/src/has-deeply-nested-worktree (main)$ tree
.
└── subdir
└── blah
└── tricky
3 directories, 0 files
ek@Glub:~/src/has-deeply-nested-worktree (main)$ ls -al subdir/blah
total 12
drwxr-xr-x 3 ek ek 4096 Jul 26 04:59 .
drwxr-xr-x 3 ek ek 4096 Jul 26 04:58 ..
drwxr-xr-x 2 ek ek 4096 Jul 26 04:55 tricky
Are there aspects of #1469 that this does not cover? It looks like this may be a fix for it rather than just being related. But maybe I'm missing something. |
Indeed, it turned out to be a fix. |
Since GitoxideLabs#1470 (for GitoxideLabs#1469), the repository's own nested worktrees are no longer removed when using `gix clean`, even if they are nested arbitarily under ignored directories. So no new mention of worktrees (separate from "repositories") in the help and warning message is accurate or required. This removes that, which means really we are keeping the warning message the same as it had been earlier, while still otherwise bringing in new explanatory text in the `gix clean` options help.
Since GitoxideLabs#1470 (for GitoxideLabs#1469), the repository's own nested worktrees are no longer removed when using `gix clean`, even if they are nested arbitarily under ignored directories. So no new mention of worktrees (separate from "repositories") in the help and warning message is accurate or required. This removes that, which means really we are keeping the warning message the same as it had been earlier, while still otherwise bringing in new explanatory text in the `gix clean` options help.
Since GitoxideLabs#1470 (for GitoxideLabs#1469), the repository's own nested worktrees are no longer removed when using `gix clean`, even if they are nested arbitarily under ignored directories. So no new mention of worktrees (separate from "repositories") in the help and warning message is accurate or required. This removes that, which means really we are keeping the warning message the same as it had been earlier, while still otherwise bringing in new explanatory text in the `gix clean` options help.
Since GitoxideLabs#1470 (for GitoxideLabs#1469), the repository's own nested worktrees are no longer removed when using `gix clean`, even if they are nested arbitarily under ignored directories. So no new mention of worktrees (separate from "repositories") in the help and warning message is accurate or required. This removes that, which means really we are keeping the warning message the same as it had been earlier, while still otherwise bringing in new explanatory text in the `gix clean` options help.
RelatedFixes #1469Tasks