Skip to content

fix: treat .gitignore.in as a gitignore.in template, not a shell script#842

Merged
kitsuyui merged 1 commit into
mainfrom
fix/gitignore-in-template-recipe
Jun 9, 2026
Merged

fix: treat .gitignore.in as a gitignore.in template, not a shell script#842
kitsuyui merged 1 commit into
mainfrom
fix/gitignore-in-template-recipe

Conversation

@kitsuyui

@kitsuyui kitsuyui commented Jun 9, 2026

Copy link
Copy Markdown
Owner

Summary

.gitignore here is generated by the gitignore.in CLI, 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 from the era when it genuinely was an executable script:

#!/usr/bin/env bash
set -euo pipefail
cd "${0%/*}" && exec > .gitignore
gi() { curl -L -s https://www.gitignore.io/api/"$*"; }

This only kept working by coincidence: the parser ignores the wrapper lines while the bare gibo dump ... lines still match the gibo dump prefix. 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 with gitignore.in.

How to regenerate

$ gitignore.in

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`.
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

🎉 Happy commit!

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

Code Metrics Report

main (6709cec) #842 (b5be29c) +/-
Coverage 99.2% 99.2% 0.0%
Code to Test Ratio 1:0.5 1:0.5 0.0
Test Execution Time 1s 1s 0s
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

@kitsuyui
kitsuyui merged commit d6def62 into main Jun 9, 2026
5 checks passed
@kitsuyui
kitsuyui deleted the fix/gitignore-in-template-recipe branch June 9, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant