Closed kkom closed 1 year ago
I just checked, and prefixing globs with a !
to invert them works with fastmod as it does with ripgrep, so something like fastmod --hidden --glob '!.git'
should help.
Thank you @swolchok – that works beautifully! I am personally very happy now with the solution – so obviously feel free to close this task.
Problem
This came up when I was trying to do a version bump this way:
I set the
--hidden
flag in order to also match asdf's.tool-versions
file (needs to be included in the version bump).However, I found fastmod matching files in the
.git/
folder - which is something I definitely do not want to mess with (it was matching some of the previous commits where I performed the version bump to 1.2.2):(In this case it was a graphite file, rather than a vanilla git file, but I don't think it matters.)
I suspect that I could somehow use the
--glob
flag to exclude the directories I wanted, but it's not obvious to me how to do it in an elegant and reliable way.Potential solution 1
Wdyt about having a flag to explicitly exclude some directories?
Similar to how comby has
--exclude
and--exclude-dirs
: https://comby.dev/docs/cheat-sheetPotential solution 2
Or have a mode where only files tracked by git would be modified by fastmod? I presume that
.git
is implicitly ignored by git when doing source control, so that could be also implicitly assumed as well.I know that Facebook uses Eden now, but maybe you can consider being aware of git too, as nod to the open source community.