{"id":39797960,"url":"https://github.com/mulle-sde/mulle-match","last_synced_at":"2026-01-18T12:26:43.233Z","repository":{"id":139651475,"uuid":"123925549","full_name":"mulle-sde/mulle-match","owner":"mulle-sde","description":"💕 Match filenames against a set of .gitignore like patternfiles","archived":false,"fork":false,"pushed_at":"2025-04-27T21:36:39.000Z","size":944,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-27T22:26:35.000Z","etag":null,"topics":["bash","command-line-tool","find","gitignore-patterns","matching-engine","mulle-sde","sources"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mulle-sde.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-03-05T13:45:07.000Z","updated_at":"2025-03-22T09:48:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"dc5a6894-56bc-4ee6-8fc5-76f8daf8f3bc","html_url":"https://github.com/mulle-sde/mulle-match","commit_stats":null,"previous_names":[],"tags_count":71,"template":false,"template_full_name":null,"purl":"pkg:github/mulle-sde/mulle-match","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mulle-sde%2Fmulle-match","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mulle-sde%2Fmulle-match/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mulle-sde%2Fmulle-match/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mulle-sde%2Fmulle-match/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mulle-sde","download_url":"https://codeload.github.com/mulle-sde/mulle-match/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mulle-sde%2Fmulle-match/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28536001,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T10:13:46.436Z","status":"ssl_error","status_checked_at":"2026-01-18T10:13:11.045Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","command-line-tool","find","gitignore-patterns","matching-engine","mulle-sde","sources"],"created_at":"2026-01-18T12:26:42.627Z","updated_at":"2026-01-18T12:26:43.222Z","avatar_url":"https://github.com/mulle-sde.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 💕 Match filenames against a set of .gitignore like patternfiles\n\n... for Android, BSDs, Linux, macOS, SunOS, Windows (MinGW, WSL)\n\nmulle-match is the backbone of the mulle-sde reflection mechanism. It matches\nfilenames against a set of .gitignore like patternfiles to categorize and type\nfiles according to their filenames and location. Its like a marriage of\n**find** and **.gitignore**.\n\nHere's an example of mulle-match in action to categorize files:\n\n``` bash\n$ mulle-match list -f \"%t,%c : %f\\n\"\nheader,private-generated-headers : src/reflect/_mulle-testallocator-include-private.h\nheader,public-generated-headers : src/reflect/_mulle-testallocator-include.h\nheader,public-generic-headers : src/generic/include.h\nheader,public-headers : src/mulle-testallocator-struct.h\nheader,public-headers : src/pointerarray.h\nheader,public-headers : src/pointerset.h\nsource,sources : src/mulle-testallocator.c\nsourcetree,all : .mulle/etc/sourcetree/config\n```\n\n| Release Version                                       | Release Notes\n|-------------------------------------------------------|--------------\n| ![Mulle kybernetiK tag](https://img.shields.io/github/tag/mulle-sde/mulle-match.svg)  | [RELEASENOTES](RELEASENOTES.md) |\n\n| Executable             | Description\n|------------------------|----------------------------------------------------------\n| `mulle-match`          | Match filename according to .gitignore like patternfiles\n| `mulle-match-to-cmake` | Use **mulle-match** to create cmake files\n| `mulle-match-to-c`     | Create include files for public headers\n\n\n\n\n\n## Commands\n\n### init\n\nInitialize the current directory with some patternfiles to match C/ObjC files\nfor demo purposes or as a starting point:\n\n```\nmulle-match init\n```\n\nWould produce in a folder `my-project` a structure like this:\n\n```\nmy-project\n└── .mulle\n    └── etc\n        └── match\n            └── match.d\n                ├── 50-source--private-headers\n                ├── 60-source--public-headers\n                └── 70-source--sources\n```\n\n\n### patternfile\n\nA *patternfile* is made up of one or more *patterns*. It is quite like a\n`.gitignore` file, with the same semantics for negation.\n\n\nExample:\n\n```\n# match .c .h and .cpp files\n*.c\n*.h\n*.cpp\n\n# ignore backup files though\n!*~.*\n```\n\nA *patternfile* resides in either the `ignore.d` folder or the\n`match.d` folder. Its filename is composed of three\nsegments: `priority-type--category`.\n\nThe first digits-only segment is there to prioritize patternfiles.\nLower numbers are matched before higher numbers (`ls` sorting).\nThe second segment gives the *type* of the file. And the last segment\nis the *category* of the file. A *type* is required, a *category* is optional.\n\n![](dox/mulle-match-match.svg)\n\nIf a *patternfile* of the `ignore.d` folder matches, the matching has failed.\nOn the other hand, if a *patternfile* of the `match.d` folder matches, the\nmatching has succeeded. *patternfiles* are matched in sort order of their\nfilename.\n\n\u003e The [Wiki](https://github.com/mulle-sde/mulle-match/wiki) explains this in more detail.\n\nAdd a *patternfile* to select PNG files. We give it a type \"hello\":\n\n```\necho \"*.svg\" \u003e pattern.txt\nmulle-match patternfile add hello pattern.txt\n```\n\nThis will result in this change in the `match.d` folder.\n\n```\n├── .mulle\n│   └── etc\n│       └── match\n│           └── match.d\n│               ├── 50-hello--all\n│               ├── 50-source--private-headers\n│               ├── 60-source--public-headers\n│               └── 70-source--sources\n```\n\nYou could optionally specify a *category* for the patternfile:\n\n```\nmulle-match patternfile add --category special hello pattern.txt\n```\n\nIt may be useful, especially in conjunction with `mulle-match find`,\nthat large and changing folders like `.git` and `build` are ignored.\nInstall the following *patternfile* into the `ignore.d` folder with `-i`:\n\n```\necho \".git/\" \u003e pattern.txt\necho \"build/\" \u003e\u003e pattern.txt\nmulle-match patternfile install -i folders pattern.txt\n```\n\u003e But see [Environment](#Environment) for an even better and more efficient way of ignoring files\n\u003e and subdirectories.\n\nRemove a *patternfile*:\n\n```\nmulle-match patternfile remove hello\n```\n\nList all *patternfiles*:\n\n```\nmulle-match patternfile list\n```\n\nand see their contents with\n\n```\nmulle-match patternfile cat\n```\n\n\n### filename\n\nTo test your installed *patternfile* you can use `mulle-match filename`. It\nwill output the patternfile name if one matches.\n\n```\nmulle-match filename pix/foo.svg\n```\n\nTo test a specific patternfile use the `--pattern-file` option. This will work\nfor both ignored.d and match.d patternfiles:\n\n```\nmulle-match filename --pattern-file '20-ignored--none' pix/foo.svg\n```\n\n\nYou can test individual *patterns* using the `--pattern` option:\n\n```\nmulle-match filename --pattern '*.svg' pix/foo.svg\n```\n\n\n### list\n\nThis command lists the filenames that match *patternfiles*.\nYou can decide which *patternfile* should be used by supplying an optional\nfilter.\n\nThis example lists all the files, that pass through *patternfiles* of type\n\"hello\":\n\n```\nmulle-match list --match-filter \"hello\"\n```\n\nThe speed of the `list` command is highly dependent on a reduction of the\nsearch space with the environment variables `MULLE_MATCH_FILENAMES`,\n`MULLE_MATCH_IGNORE_PATH`, `MULLE_MATCH_PATH`.\n\n\n#### .gitignore modes\n\nWith the `list` option `--gitignore` the `.gitignore` file will be used to\nprune the search space.\n\n\n## Environment\n\nVariable                  | Description\n--------------------------|---------------------------------------------\n`MULLE_MATCH_FILENAMES`   | Filename wildcards separated by ':'. Only files matching these wildcards will be considered for. e.g. *.c:*.m:*.cmake. These values are evaluated with `find`'s `-name`. The default value is `*`\n`MULLE_MATCH_IGNORE_PATH` | Locations to ignore separated by ':'. These values are evaluated with `find`'s `-path` and then pruned. The default value is `addiction:build:dependency:stash:include:lib:libexec:.git`\n`MULLE_MATCH_PATH`        | Locations to search for separated by ':'. These values are passed to `find` as search starts. The default value is `.mulle/etc/sourcetree/config:src`\n\n\n\n\n\n## Install\n\nSee [mulle-sde-developer](//github.com/mulle-sde/mulle-sde-developer) how to\ninstall mulle-sde, which will also install mulle-match with required\ndependencies.\n\nThe command to install only the latest mulle-match into\n`/usr/local` (with **sudo**) is:\n\n``` bash\ncurl -L 'https://github.com/mulle-sde/mulle-match/archive/latest.tar.gz' \\\n | tar xfz - \u0026\u0026 cd 'mulle-match-latest' \u0026\u0026 sudo ./bin/installer /usr/local\n```\n\n\n\n## Author\n\n[Nat!](https://mulle-kybernetik.com/weblog) for Mulle kybernetiK\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmulle-sde%2Fmulle-match","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmulle-sde%2Fmulle-match","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmulle-sde%2Fmulle-match/lists"}