feat(Git): support reading language from git attributes #599

Merged
wetneb merged 12 commits from attribute-based-language-selection into main 2025-09-30 14:30:09 +02:00

12 commits

Author SHA1 Message Date
dbcd30977d cargo fmt
All checks were successful
/ test (pull_request) Successful in 38s
2025-09-30 14:28:04 +02:00
60e74cc0b6 Add fallback to linguist-language attribute
Some checks failed
/ test (pull_request) Failing after 17s
2025-09-21 19:30:16 -04:00
bc4c1cf4c5 Make sure all Linguist language names are recognized by mergiraf 2025-09-21 19:30:16 -04:00
ac3d501403 cargo fmt 2025-09-21 19:30:16 -04:00
2a75922816 Inline find_impl 2025-09-21 19:30:16 -04:00
0e1caa8750 Replace by if-let chain for readability 2025-09-21 19:30:16 -04:00
ba67973702 Add comment about language lookup logic 2025-09-21 19:30:16 -04:00
8c58da9a0a Update docs of LangProfile::find 2025-09-21 19:30:15 -04:00
854af3ab0d Rename LangProfile::find_by_filename_or_name to LangProfile::find 2025-09-21 19:30:15 -04:00
ad6ea4f0b6 Simplify read_attribute_for_file 2025-09-21 19:30:15 -04:00
ff3d0b80a1 Move documentation to section about manual language specification 2025-09-21 19:30:15 -04:00
Ben Boeckel
67b950d38f feat(Git): support reading language from git attributes
When used as a merge driver, `mergiraf` only has the file extension as
guidance for language specification. This may not be suitable in all
cases (e.g., custom languages that are supported-language-adjacent or
`.in` template files that are mostly another language). Allow
specification of the language using the `mergiraf.language` attribute.
2025-09-21 19:30:15 -04:00