Documentation
¶
Overview ¶
Package scenemerge inspects and configures the nsgo-scene Git merge driver shared by the game CLI and the scene editor.
Index ¶
Constants ¶
const ( // DriverName is the gitattributes merge driver identifier for NSGo scene files. DriverName = "nsgo-scene" // DriverTitle is the human-readable description written to Git config. DriverTitle = "NSGo scene merge driver" // DriverCommand is the command Git invokes with ancestor (%O), current (%A), other (%B), and path (%P). DriverCommand = "go tool game merge %O %A %B %P" )
Variables ¶
var BinaryMediaPatterns = []string{
"*.png",
"*.jpg",
"*.jpeg",
"*.webp",
"*.gif",
"*.bmp",
"*.ktx2",
"*.dds",
"*.hdr",
"*.pic",
"*.wav",
"*.ogg",
"*.mp3",
"*.m4a",
"*.aac",
"*.flac",
"*.opus",
"*.mp4",
"*.webm",
"*.ttf",
"*.otf",
"*.woff",
"*.woff2",
"*.glb",
"*.bin",
}
BinaryMediaPatterns are the binary media file extensions the engine loads, marked binary in .gitattributes so Git never alters their bytes.
var GitAttributesContent = buildDefaultGitAttributes()
GitAttributesContent is the default .gitattributes written by templates and game merge -setup.
Functions ¶
func ConfigureDriver ¶
ConfigureDriver writes merge.nsgo-scene.name and merge.nsgo-scene.driver into the local Git repository containing dir.
func EnsureGitAttributes ¶
EnsureGitAttributes ensures path contains * text=auto eol=lf (before any pattern-specific rules), binary rules for media extensions, and merge=nsgo-scene rules for *.scene.yaml and *.scene.yml without duplicating existing entries.
Types ¶
type DriverStatus ¶
type DriverStatus struct {
// InRepo is true when dir lies inside a Git work tree.
InRepo bool
// RepoRoot is the top-level directory reported by git rev-parse --show-toplevel.
RepoRoot string
// AttributesConfigured is true when .gitattributes (or Git's effective attributes) routes files to merge=nsgo-scene.
AttributesConfigured bool
// AttributesPath is the .gitattributes file that names merge=nsgo-scene, if found on disk.
AttributesPath string
// DriverConfigured is true when Git config defines a non-empty merge.nsgo-scene.driver.
DriverConfigured bool
// DriverCommand is the configured value of merge.nsgo-scene.driver.
DriverCommand string
}
DriverStatus reports how the nsgo-scene Git merge driver is configured for a directory.
func Check ¶
func Check(dir string, runGit GitRunner) (DriverStatus, error)
Check inspects dir's Git repository, .gitattributes chain, and effective Git config for the nsgo-scene merge driver.
func (DriverStatus) NeedsSetup ¶
func (s DriverStatus) NeedsSetup() bool
NeedsSetup reports whether the directory is in a Git repository whose attributes name merge=nsgo-scene without a configured merge.nsgo-scene.driver.