Message-ID: From: "vlsi (@vlsi)" To: "pgjdbc/pgjdbc" Date: Thu, 28 May 2026 16:43:50 +0000 Subject: [pgjdbc/pgjdbc] PR #4118: build: tidy .gitattributes for generated files and java diffs List-Id: X-GitHub-Additions: 9 X-GitHub-Author-Id: 213894 X-GitHub-Author-Login: vlsi X-GitHub-Base: master X-GitHub-Changed-Files: 1 X-GitHub-Commits: 1 X-GitHub-Deletions: 0 X-GitHub-Head-Branch: claude/relaxed-payne-1947a7 X-GitHub-Head-SHA: 6deb63565e0cd50dff10e162cded14fd090c0535 X-GitHub-Issue: 4118 X-GitHub-Labels: chore X-GitHub-Merge-SHA: 03fea4ef91760a5d6637f2d79c727340884a9546 X-GitHub-Merged-By: vlsi X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-State: merged X-GitHub-Type: pull_request X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/pull/4118 Content-Type: text/plain; charset=utf-8 ## What - Mark `messages_*.java`, `messages.pot`, and `.github/workflows/package-lock.json` as `linguist-generated` so GitHub collapses them in PR diffs and excludes them from language stats. - Enable git's built-in `java` funcname patterns (`*.java diff=java`) for clearer hunk headers in local diffs. ## Why The translation `messages_*.java` bundles and the `.pot` template are regenerated by the gettext tasks, so their diffs are pure noise on review (the `.pot` in particular churns its `#: src/...:NNN` source-line refs on every edit). The npm lockfile is the textbook `linguist-generated` case. `.po` files are intentionally left untouched: they hold human-authored translations, so reviewers should still see those diffs. ## How to verify - After merge, open a PR that touches translations and confirm the generated files appear collapsed on GitHub. - `git diff` on a Java change now shows the enclosing method in the hunk header. 🤖 Generated with [Claude Code](https://claude.com/claude-code) diff --git a/.gitattributes b/.gitattributes index 28e4536037..9f58a6e6b0 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7,5 +7,14 @@ *.yaml text *.yml text *.bat text eol=crlf + +# Java-aware diff hunk headers (git built-in funcname pattern) +*.java diff=java + /CHANGELOG.md merge=union /contributors.json merge=union + +# Generated files: collapse in PR diffs and exclude from language stats +/pgjdbc/src/main/java/org/postgresql/translation/messages_*.java linguist-generated=true +/pgjdbc/src/main/java/org/postgresql/translation/messages.pot linguist-generated=true +/.github/workflows/package-lock.json linguist-generated=true