Skip to content

config: add .gitattributes for cross-platform line ending consistency#951

Merged
Hundao merged 2 commits intoaden-hive:mainfrom
Emart29:config/add-gitattributes-for-windows
Jan 28, 2026
Merged

config: add .gitattributes for cross-platform line ending consistency#951
Hundao merged 2 commits intoaden-hive:mainfrom
Emart29:config/add-gitattributes-for-windows

Conversation

@Emart29
Copy link
Contributor

@Emart29 Emart29 commented Jan 27, 2026

Description

Adds comprehensive .gitattributes file to normalize line endings across platforms and eliminate CRLF warnings for Windows contributors.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)

Related Issues

Fixes #950

Changes Made

  • Created .gitattributes file with comprehensive rules
  • Auto-detect and normalize text files to LF
  • Force LF for shell scripts (required for Unix execution)
  • Force CRLF for Windows batch files
  • Mark binary files explicitly (images, archives, compiled files)
  • Include all file types present in repository

Testing

Describe the tests you ran to verify your changes:

  • Manual testing performed
  • Tested on Windows 11

Before .gitattributes:

PS> git add README.md
warning: LF will be replaced by CRLF in README.md

After .gitattributes:

PS> git add README.md
[no warnings]

Checklist

  • My code follows the project's style guidelines (configuration file)
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas (comments in .gitattributes)
  • I have made corresponding changes to the documentation (N/A)
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works (manual testing)
  • New and existing unit tests pass locally with my changes

Screenshots (if applicable)

N/A - Configuration file

Additional Context

Standard cross-platform practice. Eliminates persistent CRLF warnings that confuse Windows contributors during normal git operations.

- Add comprehensive .gitattributes to normalize line endings
- Ensure shell scripts always use LF (required for Unix execution)
- Mark binary files explicitly to prevent corruption
- Eliminate CRLF warnings for Windows contributors
- Follow cross-platform best practices

This fixes persistent 'LF will be replaced by CRLF' warnings that
confuse Windows contributors during normal git operations.

Fixes aden-hive#950
@github-actions
Copy link

PR Closed - Requirements Not Met

This PR has been automatically closed because it doesn't meet the requirements.

PR Author: @Emart29
Found issues: #950 (assignees: none), #472 (assignees: none)
Problem: The PR author must be assigned to the linked issue.

To fix:

  1. Assign yourself (@Emart29) to one of the linked issues
  2. Re-open this PR

Why is this required? See #472 for details.

@Emart29
Copy link
Contributor Author

Emart29 commented Jan 27, 2026

@bryanadenhq This PR should qualify for the exception rule in #472:

Exception Categories:

  • Configuration file (.gitattributes)
  • Obvious improvement (eliminates CRLF warnings)
  • No code changes (config only)

Rationale:
Adding a standard .gitattributes file is:

  • Standard practice for cross-platform repos
  • No controversial decisions
  • One file, clear benefit
  • Analogous to .gitignore or .editorconfig

Could this be reopened under the configuration exception, or should I wait for assignment to #950?

@Hundao Hundao self-requested a review January 27, 2026 14:20
@Hundao Hundao reopened this Jan 27, 2026
Copy link
Collaborator

@Hundao Hundao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reopening this — looks good overall. One small fix needed, see review comment.

.gitattributes Outdated
# Database files (binary)
*.db binary
*.sqlite binary
*.sqlite3 binary No newline at end of file
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing trailing newline at end of file.

@Emart29
Copy link
Contributor Author

Emart29 commented Jan 27, 2026

Fixed. Added trailing newline at end of file.

Ready for merge. Thank you @Hundao for the review

@Hundao Hundao merged commit 3bbecad into aden-hive:main Jan 28, 2026
3 of 4 checks passed
jhalak999 pushed a commit to jhalak999/hive that referenced this pull request Feb 17, 2026
…aden-hive#951)

* config: add .gitattributes for cross-platform line ending consistency

- Add comprehensive .gitattributes to normalize line endings
- Ensure shell scripts always use LF (required for Unix execution)
- Mark binary files explicitly to prevent corruption
- Eliminate CRLF warnings for Windows contributors
- Follow cross-platform best practices

This fixes persistent 'LF will be replaced by CRLF' warnings that
confuse Windows contributors during normal git operations.

Fixes aden-hive#950

* fix: add trailing newline at end of file

Per review feedback from @Hundao
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.

[Bug]: Missing .gitattributes causes confusing CRLF warnings for Windows contributors

2 participants