scenemerge

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package scenemerge inspects and configures the nsgo-scene Git merge driver shared by the game CLI and the scene editor.

Index

Constants

View Source
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

View Source
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.

View Source
var GitAttributesContent = buildDefaultGitAttributes()

GitAttributesContent is the default .gitattributes written by templates and game merge -setup.

Functions

func ConfigureDriver

func ConfigureDriver(dir string, runGit GitRunner) error

ConfigureDriver writes merge.nsgo-scene.name and merge.nsgo-scene.driver into the local Git repository containing dir.

func EnsureGitAttributes

func EnsureGitAttributes(path string) (bool, error)

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.

func RepoRoot

func RepoRoot(dir string, runGit GitRunner) (string, error)

RepoRoot returns the top-level directory of the Git repository containing dir, or empty if dir is not in a Git work tree.

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.

type GitRunner

type GitRunner func(dir string, args ...string) (string, error)

GitRunner executes git with args in dir and returns its trimmed combined output.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL