Write a BIDS-friendly .gitattributes at babs init - #393
Draft
asmacdo wants to merge 1 commit into
Draft
Conversation
babs init gave the analysis dataset yoda's default .gitattributes, which annexes everything except .git*/README/CHANGELOG, so BIDS metadata sidecars (dataset_description.json, small *.json/*.tsv) were annexed. Overwrite it with a rule that keeps small text in git and everything else in the annex: a file is annexed if it is binary (mimeencoding) or larger than 40kb, with explicit overrides forcing listed files into git. Fixes PennLINC#378 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #393 +/- ##
==========================================
+ Coverage 79.49% 79.53% +0.04%
==========================================
Files 17 17
Lines 2121 2126 +5
Branches 373 373
==========================================
+ Hits 1686 1691 +5
Misses 300 300
Partials 135 135 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
yarikoptic
requested changes
Jul 20, 2026
yarikoptic
left a comment
Collaborator
There was a problem hiding this comment.
test and accompany recommended fix with a test
| # larger than 40kb; the explicit lines force listed files into git regardless. | ||
| BIDS_GITATTRIBUTES = """\ | ||
| * annex.backend=MD5E | ||
| * annex.largefiles=((mimeencoding=binary)or(largerthan=40kb)) |
Collaborator
There was a problem hiding this comment.
Suggested change
| * annex.largefiles=((mimeencoding=binary)or(largerthan=40kb)) | |
| * annex.largefiles=((* annex.largefiles=(((mimeencoding=binary)and(largerthan=0))or(largerthan=40kb)) |
add to your unittest that 0-sized files (which aren't text since can't be judged) are in git, not annex.
14 tasks
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.
Waiting until bids-study merges. This is just a draft, but posting now for @djarecka
babs init gave the analysis dataset yoda's default .gitattributes, which annexes everything except .git*/README/CHANGELOG, so BIDS metadata sidecars (dataset_description.json, small .json/.tsv) were annexed. Overwrite it with a rule that keeps small text in git and everything else in the annex: a file is annexed if it is binary (mimeencoding) or larger than 40kb, with explicit overrides forcing listed files into git.
Fixes #378