# Changelog

## master (unreleased)

### New features

* [#978](https://github.com/bbatsov/projectile/issues/978): Add `projectile-project-changed-functions`, run whenever the current project changes - including implicitly via visiting a file or directory of another project - with the new and previous project root as arguments.
* [#1442](https://github.com/bbatsov/projectile/pull/1442): `projectile-sort-order` can now be set to a function that receives the list of project files and returns them in the desired order.
* [#1984](https://github.com/bbatsov/projectile/pull/1984): The VCS markers are now customizable via `projectile-vcs-markers`, whose order breaks ties between markers in the same directory - so colocated `jj`+`git` repositories can be detected as `jj` by moving `.jj` first.
* [#1890](https://github.com/bbatsov/projectile/pull/1890): Recognize osc (openSUSE Build Service) checkouts: `.osc` is now a VCS marker, a top-down-recurring root marker, and globally ignored; file listing uses the generic indexing command.
* [#1694](https://github.com/bbatsov/projectile/issues/1694): Add `projectile-invalidate-cache-all`, which invalidates the caches of all known projects at once (handy when commands like `projectile-find-file-in-known-projects` serve stale results).

### Changes

* Project root detection and project-type detection now probe marker files with a single directory listing per directory level instead of one file stat per marker, collapsing dozens of sequential round-trips over TRAMP into one. Marker matching is exact-case as a result even on case-insensitive filesystems, which also fixed the `gnumake` type's marker to GNU make's actual `GNUmakefile` spelling; the `make` type now recognizes a lowercase `makefile` too.
* [#1771](https://github.com/bbatsov/projectile/issues/1771), [#740](https://github.com/bbatsov/projectile/issues/740): Hybrid indexing now applies the dirconfig glob patterns (`-`/`!` entries without a leading slash); previously they were silently ignored under `hybrid` and only `/`-prefixed path entries took effect.
* [#1941](https://github.com/bbatsov/projectile/issues/1941): Dirconfig glob patterns now follow `.gitignore`-like rules, identical under `native` and `hybrid` indexing: a slashless pattern matches the file name or any directory segment at any depth, a pattern containing a slash is anchored at the project root (prefix with `**/` to match anywhere), a trailing slash matches directories only, a matched directory covers its subtree, and `*` stops at `/` while `**` crosses it. Previously `native` matching was based on loose string suffixes (`-build` would also ignore `mybuild`) and per-directory glob expansion, which behaved differently from level to level.
* Remove `projectile-check-pattern-p` and `projectile-ignored-rel-p`, the old pattern matchers superseded by the compiled dirconfig matcher (nothing referenced them anymore).
* `projectile-verify-file` now goes through `projectile-file-exists-p`, so cold project-type detection benefits from the remote file-exists cache instead of issuing a TRAMP round-trip for every marker file probed.
* The mode-line updater is only added to `window-configuration-change-hook` when `projectile-dynamic-mode-line` is enabled; change the option via Customize or `setopt` for it to apply immediately.
* The `recentf` and `recently-active` sort orders no longer rescan the full project file list once per recent file, making them usable on very large projects.
* [#1953](https://github.com/bbatsov/projectile/issues/1953): Cache the git submodule listing instead of shelling out to `git submodule foreach` on every alien/hybrid file listing; the cache invalidates automatically when `.gitmodules` changes and is also cleared by `projectile-invalidate-cache`.
* User-facing conditions (no project found, missing optional package, nothing to toggle to, etc.) now signal `user-error` instead of `error`, so they no longer trigger the debugger under `debug-on-error`.

### Bugs fixed
...
...
