git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Leading slash exclusion does not with git clean on Windows

From
AKAdam Kapos <adam@yousician.com>
Date
Feb 16, 2022, 14:15 UTC
Message-ID
<CAMwvdPQLMK2-CPyLqSKBWZjEi+6o2iaj_=C2VnJA=sV5GUV47Q@mail.gmail.com>

I came across an issue where the leading slash exclusion pattern does not work with git clean on Windows.

What did you do before the bug happened? (Steps to reproduce your issue)
Run the following commands:
1. mkdir foo
2. mkdir -p bar/foo
3. git clean -fdx --exclude /foo

What did you expect to happen? (Expected behavior) The root-level directory is not removed because it's excluded

Removing bar/

What happened instead? (Actual behavior) The root level directory is removed:

Removing bar/ Removing foo/

What's different between what you expected and what actually happened? The root-level exclusion doesn't work

Anything else you want to add:

Please review the rest of the bug report below. You can delete any lines you don't wish to share.

[System Info] git version: git version 2.35.1.windows.2, 2.31.1.windows.1 cpu: x86_64 built from commit: c5f0be26a7e3846e3b6268d1c6c4800d838c6bbb sizeof-long: 4 sizeof-size_t: 8 shell-path: /bin/sh feature: fsmonitor--daemon uname: Windows 10.0 22000 compiler info: gnuc: 10.2 libc info: no libc information available $SHELL (typically, interactive shell): C:\Program Files\Git\usr\bin\bash.exe

[Enabled Hooks] post-commit post-checkout post-merge pre-push

-- 
**Confidentiality**
The
 information contained in this e-mail is 
confidential, may be privileged
 and is intended solely for the use of the 
named addressee. Access to 
this e-mail by any other person is not 
authorised. If you are not the 
intended recipient, you should not 
disclose, copy, distribute, take any 
action or rely on it and you should 
please notify the sender by reply. 
Any opinions expressed are not 
necessarily those of the company.

We
 may monitor all incoming and 
outgoing emails in line with current 
legislation. We have taken steps to 
ensure that this email and 
attachments are free from any virus, but it 
remains your responsibility 
to ensure that viruses do not adversely affect 
you.
Next: Johannes Schindelin
Message 1 of 2 in “Leading slash exclusion does not with git clean on Windows”
  1. Adam KaposFeb 16, 2022
  2. Johannes SchindelinMar 9, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.