{"thread":{"id":"64761","subject":"Feat. req.: add a flag to `git clean` to also remove ignored nested repositories","startedAt":"2026-01-09T03:50:42Z","lastAt":"2026-01-16T05:16:28Z","messageCount":3,"participants":["Simon Cheng","brian m. carlson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"533311","messageId":"CA+itcS3-RQ=ESqcWj0Pkw=N4e4gwaz2fp2xH2M1MPXQXaMDmCw@mail.gmail.com","threadId":"64761","inReplyTo":null,"subject":"Feat. req.: add a flag to `git clean` to also remove ignored nested repositories","fromName":"Simon Cheng","fromEmail":"cyqsimon@gmail.com","sentAt":"2026-01-09T03:50:30Z","receivedAt":"2026-01-09T03:50:42Z","isPatch":false,"sender":{"key":"cyqsimon@gmail.com","avatar":null},"body":"Currently, running `git clean -dxf` on a repository that includes\nanother repository under an ignored path would skip said repository:\n\n$ git clean -dxf\nRemoving foo\nSkipping repository ignored-path/repo\nRemoving bar\n\nThis is to request the addition of a new flag to allow altering this\nbehaviour, i.e. to make `git clean` remove those repositories too.\n\nFor me, this feature is relevant for building `*-git` packages from\nthe AUR, for example https://aur.archlinux.org/packages/paru-git. By\ndefault `makepkg` would clone the source repo into `./src/NAME`, which\ncreates the aforementioned condition. Without such an option on `git\nclean`, cleanup after build is rather complicated.\n\nThanks and regards,\nSimon Cheng\n"},{"id":"533364","messageId":"aWEAHQLzwTxCpD5Q@fruit.crustytoothpaste.net","threadId":"64761","inReplyTo":"CA+itcS3-RQ=ESqcWj0Pkw=N4e4gwaz2fp2xH2M1MPXQXaMDmCw@mail.gmail.com","subject":"Re: Feat. req.: add a flag to `git clean` to also remove ignored nested repositories","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2026-01-09T13:18:21Z","receivedAt":"2026-01-09T13:18:23Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2026-01-09 at 03:50:30, Simon Cheng wrote:\n> Currently, running `git clean -dxf` on a repository that includes\n> another repository under an ignored path would skip said repository:\n> \n> $ git clean -dxf\n> Removing foo\n> Skipping repository ignored-path/repo\n> Removing bar\n> \n> This is to request the addition of a new flag to allow altering this\n> behaviour, i.e. to make `git clean` remove those repositories too.\n> \n> For me, this feature is relevant for building `*-git` packages from\n> the AUR, for example https://aur.archlinux.org/packages/paru-git. By\n> default `makepkg` would clone the source repo into `./src/NAME`, which\n> creates the aforementioned condition. Without such an option on `git\n> clean`, cleanup after build is rather complicated.\n\nDoes this work if you use `git clean -dxff` (that is, with a second `-f`\nflag)?  I do often clean up ignored repositories that way (and it's\ndocumented to do that in the manual page), but I'm not sure if you're\nmaybe doing something a little different from my workflow.\n\nIf that _doesn't_ work for you, would you mind creating a quick shell\nscript to demonstrate the problem that you're seeing so that we could\nprovide better advice?\n-- \nbrian m. carlson (they/them)\nToronto, Ontario, CA\n"},{"id":"534010","messageId":"CA+itcS3S3SXWGSwFp=k=f0u+q5eEqSqKMzFwLzKHLzLOtYpH9g@mail.gmail.com","threadId":"64761","inReplyTo":"aWEAHQLzwTxCpD5Q@fruit.crustytoothpaste.net","subject":"Re: Feat. req.: add a flag to `git clean` to also remove ignored nested repositories","fromName":"Simon Cheng","fromEmail":"cyqsimon@gmail.com","sentAt":"2026-01-16T05:16:16Z","receivedAt":"2026-01-16T05:16:28Z","isPatch":false,"sender":{"key":"cyqsimon@gmail.com","avatar":null},"body":"Ah yes that's exactly what I need, thanks a lot. Pebkac moment for me sorry.\n\nI must say though, the discoverability of this \"double -f\" behaviour\ncan be improved. Maybe the \"nested repository skipped\" message can\ninclude a hint? Something like this I imagine:\n\nSkipping repository ignored-path/repo (pass a second `-f` to remove)\n\nWdyt?\n\nOn Fri, 9 Jan 2026 at 21:18, brian m. carlson\n<sandals@crustytoothpaste.net> wrote:\n>\n> On 2026-01-09 at 03:50:30, Simon Cheng wrote:\n> > Currently, running `git clean -dxf` on a repository that includes\n> > another repository under an ignored path would skip said repository:\n> >\n> > $ git clean -dxf\n> > Removing foo\n> > Skipping repository ignored-path/repo\n> > Removing bar\n> >\n> > This is to request the addition of a new flag to allow altering this\n> > behaviour, i.e. to make `git clean` remove those repositories too.\n> >\n> > For me, this feature is relevant for building `*-git` packages from\n> > the AUR, for example https://aur.archlinux.org/packages/paru-git. By\n> > default `makepkg` would clone the source repo into `./src/NAME`, which\n> > creates the aforementioned condition. Without such an option on `git\n> > clean`, cleanup after build is rather complicated.\n>\n> Does this work if you use `git clean -dxff` (that is, with a second `-f`\n> flag)?  I do often clean up ignored repositories that way (and it's\n> documented to do that in the manual page), but I'm not sure if you're\n> maybe doing something a little different from my workflow.\n>\n> If that _doesn't_ work for you, would you mind creating a quick shell\n> script to demonstrate the problem that you're seeing so that we could\n> provide better advice?\n> --\n> brian m. carlson (they/them)\n> Toronto, Ontario, CA\n"}]}