feat: bake global gitignore (core.excludesFile) into image
Seed ~/.gitignore_global from /etc/skel-devbox (seed-if-absent, like .bash_aliases/.inputrc, so user edits survive recreate) and wire it via git config --global core.excludesFile, guarded so a user-set excludesFile is never overridden. Ignores *.bak, *.bak.*, *~, *.orig, *.swp, *.tmp across all repos without per-repo .gitignore entries.
This commit is contained in:
@@ -13,6 +13,16 @@ Pre-v1.0.0 tags followed the pi npm version (`v{pi_version}[letter]`).
|
|||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- **Global gitignore baked into the image.** A `~/.gitignore_global`
|
||||||
|
(`*.bak`, `*.bak.*`, `*~`, `*.orig`, `*.swp`, `*.tmp`) is seeded into the home
|
||||||
|
dir from `/etc/skel-devbox/` on first boot (seed-if-absent, like
|
||||||
|
`.bash_aliases`/`.inputrc`, so user edits survive recreate) and wired via
|
||||||
|
`git config --global core.excludesFile`. Personal/tooling backup artifacts are
|
||||||
|
now ignored across all repos in the container without per-repo `.gitignore`
|
||||||
|
entries. The `core.excludesFile` wiring is skipped if the user already set one.
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- **Secrets are now delivered to the container via `env_file: .env` only; the
|
- **Secrets are now delivered to the container via `env_file: .env` only; the
|
||||||
|
|||||||
+3
-2
@@ -477,8 +477,9 @@ ENV PATH="/home/${USER_NAME}/.pi/npm-global/bin:${PATH}"
|
|||||||
|
|
||||||
# ── Shell defaults (bash history, aliases, readline) ─────────────────
|
# ── Shell defaults (bash history, aliases, readline) ─────────────────
|
||||||
RUN mkdir -p /etc/skel-devbox
|
RUN mkdir -p /etc/skel-devbox
|
||||||
COPY rootfs/home/developer/.bash_aliases /etc/skel-devbox/.bash_aliases
|
COPY rootfs/home/developer/.bash_aliases /etc/skel-devbox/.bash_aliases
|
||||||
COPY rootfs/home/developer/.inputrc /etc/skel-devbox/.inputrc
|
COPY rootfs/home/developer/.inputrc /etc/skel-devbox/.inputrc
|
||||||
|
COPY rootfs/home/developer/.gitignore_global /etc/skel-devbox/.gitignore_global
|
||||||
|
|
||||||
# ── Entrypoint ────────────────────────────────────────────────────────
|
# ── Entrypoint ────────────────────────────────────────────────────────
|
||||||
COPY rootfs/usr/local/lib/pi-devbox/ /usr/local/lib/pi-devbox/
|
COPY rootfs/usr/local/lib/pi-devbox/ /usr/local/lib/pi-devbox/
|
||||||
|
|||||||
+7
-1
@@ -33,7 +33,7 @@ fi
|
|||||||
# directly.
|
# directly.
|
||||||
SKEL_DIR="/etc/skel-devbox"
|
SKEL_DIR="/etc/skel-devbox"
|
||||||
if [ -d "$SKEL_DIR" ]; then
|
if [ -d "$SKEL_DIR" ]; then
|
||||||
for f in .bash_aliases .inputrc; do
|
for f in .bash_aliases .inputrc .gitignore_global; do
|
||||||
if [ -f "$SKEL_DIR/$f" ] && [ ! -e "$HOME/$f" ]; then
|
if [ -f "$SKEL_DIR/$f" ] && [ ! -e "$HOME/$f" ]; then
|
||||||
cp "$SKEL_DIR/$f" "$HOME/$f"
|
cp "$SKEL_DIR/$f" "$HOME/$f"
|
||||||
fi
|
fi
|
||||||
@@ -91,6 +91,12 @@ fi
|
|||||||
if [ -n "${GIT_USER_EMAIL:-}" ] && ! git config --global user.email &>/dev/null; then
|
if [ -n "${GIT_USER_EMAIL:-}" ] && ! git config --global user.email &>/dev/null; then
|
||||||
git config --global user.email "$GIT_USER_EMAIL"
|
git config --global user.email "$GIT_USER_EMAIL"
|
||||||
fi
|
fi
|
||||||
|
# Global gitignore for personal/tooling artifacts (*.bak, *~, *.orig, ...).
|
||||||
|
# Seeded above into $HOME/.gitignore_global from /etc/skel-devbox. Point git at
|
||||||
|
# it only if the user has not already set their own core.excludesFile.
|
||||||
|
if [ -f "$HOME/.gitignore_global" ] && ! git config --global core.excludesFile &>/dev/null; then
|
||||||
|
git config --global core.excludesFile "$HOME/.gitignore_global"
|
||||||
|
fi
|
||||||
|
|
||||||
# ── pi: deploy toolkit + extensions + mempalace bridge ─────────────
|
# ── pi: deploy toolkit + extensions + mempalace bridge ─────────────
|
||||||
# pi is always installed in pi-devbox; no INSTALL_PI guard needed.
|
# pi is always installed in pi-devbox; no INSTALL_PI guard needed.
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
# Global gitignore — personal/tooling artifacts (applies to all repos in the container)
|
||||||
|
# Seeded into $HOME/.gitignore_global by entrypoint-user.sh and wired via
|
||||||
|
# `git config --global core.excludesFile`. Edit freely; it is yours after first boot.
|
||||||
|
|
||||||
|
# backup / editor / merge artifacts
|
||||||
|
*.bak
|
||||||
|
*.bak.*
|
||||||
|
*~
|
||||||
|
*.orig
|
||||||
|
*.swp
|
||||||
|
*.tmp
|
||||||
Reference in New Issue
Block a user