MergerInterface

Interface

Defines the contract for merging .gitignore entries.

Description

This service SHALL combine canonical and project-specific .gitignore definitions into a single normalized result. The resulting entry list MUST exclude blank lines and comment lines from the merged output, MUST remove duplicate entries, and MUST group directory entries before file entries. Directory and file groups SHALL be sorted independently in ascending string order to provide deterministic output.

Table of Contents

Methods

merge()

Merges two GitIgnore instances, removing duplicates and sorting entries.

 : GitIgnoreInterface
Methods

merge()

Public

Merges two GitIgnore instances, removing duplicates and sorting entries.

public merge(GitIgnoreInterface  $canonical, GitIgnoreInterface  $project) : GitIgnoreInterface

Description

Directories are placed before files in the resulting list. The path from $project is used in the returned instance.

Parameters
$canonical : GitIgnoreInterface

Description

the canonical .gitignore from dev-tools

$project : GitIgnoreInterface

Description

the project-specific .gitignore

Return values

Description

a new GitIgnore instance with merged entries