New fossil repo workflow
August 15, 2024; Nov 11, 2024
# project name
$p = env-gis-users
# home dir of shared repositories
$repos = \\SERVER\dev\.fossil-repos
# repo to use as template for fossil settings
$t = env-geo-py.fossil
# create shared repo
fossil init $repos\$p.fossil --template $repos\$t
# checkout local working copy
mkdir $p
chdir $p
fossil clone $repos\$p.fossil .fossil.db
fossil open .fossil.db
# hide the repo sqlite db from casual view and interference
#attrib +h $p # not really needed when using a dot-name
attrib +h _FOSSIL_
alternate, ff-new-repo.ps1
# Determine the OneDrive path
if (Test-Path $env:OneDriveConsumer) {
$oneDrivePath = $env:OneDriveConsumer
} else {
$oneDrivePath = $env:OneDrive
}
# Check if a command-line argument is provided
if ($args.Count -eq 0) {
Write-Host "Please provide a repository name as an argument."
exit
}
$p = $args[0] # Use the first command-line argument as the repository name
md $p; pushd $p
# All my fossil repos get stored in the OneDrive folder
$repo = "$oneDrivePath/fossils/$p.fossil"
fossil init $repo
# for consistency use same fossil database name in all workspaces
fossil clone $repo .fossil.db
fossil open .fossil.db
# make db & checkout marker hidden so not casually interfered with
gci "_FOSSIL_",".fossil.db" | %{ $_.Attributes = "Hidden" }
md .fossil-settings -Force
cp "$oneDrivePath/fossils/fossil-settings-template/*" `
".fossil-settings/" -Recurse
fossil add .fossil-settings
fossil ci -m "standard ignore-glob preferences"
---
todo: automate setting ignore and cr/lf configs
.fossil-settings/binary-glob