fix: treat .gitignore.in as a gitignore.in template, not a shell script#842
Merged
Conversation
This repo's .gitignore is generated by the `gitignore.in` CLI (github.com/gitignore-in/gitignore-in), which parses .gitignore.in as a small template language and never executes it as a shell script. The file still carried a vestigial shell wrapper (`#!/usr/bin/env bash`, `set -euo pipefail`, `exec > .gitignore`, an unused helper function) that only kept working by coincidence because the bare `gibo dump ...` lines still parsed. Reduce .gitignore.in to the template form the tool expects and regenerate .gitignore with `gitignore.in`.
🎉 Happy commit!
|
Code Metrics Report
Details | | main (6709cec) | #842 (b5be29c) | +/- |
|---------------------|----------------|----------------|------|
| Coverage | 99.2% | 99.2% | 0.0% |
| Files | 5 | 5 | 0 |
| Lines | 134 | 134 | 0 |
| Covered | 133 | 133 | 0 |
| Code to Test Ratio | 1:0.5 | 1:0.5 | 0.0 |
| Code | 1678 | 1678 | 0 |
| Test | 955 | 955 | 0 |
| Test Execution Time | 1s | 1s | 0s |Reported by octocov |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.gitignorehere is generated by thegitignore.inCLI, which parses.gitignore.inas a small template language and never executes it as a shell script.The file still carried a vestigial shell wrapper from the era when it genuinely was an executable script:
This only kept working by coincidence: the parser ignores the wrapper lines while the bare
gibo dump ...lines still match thegibo dumpprefix. Editing the file as a shell script (e.g. wrapping the dumps in a block and indenting them) would silently disable every template, because the parser does not trim leading whitespace.Changes
.gitignore.in: reduce to the template form the tool expects (one directive per line, from column 0)..gitignore: regenerated withgitignore.in.How to regenerate