Skip to content

Remove DataLad dependency, use git-annex directly - #63

Merged
neuromechanist merged 3 commits into
mainfrom
feature/remove-datalad-dependency
Jan 21, 2026
Merged

neuromechanist merged 3 commits into
mainfrom
feature/remove-datalad-dependency

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Summary

  • Remove DataLad as a dependency; CLI now only requires git-annex
  • Rename datalad.ts to git-annex.ts to reflect the change
  • Replace all DataLad commands with native git/git-annex equivalents

Changes

Operation Before After
Init dataset datalad create git init + git annex init
Save changes datalad save git add -A + git commit
Clone datalad clone git clone + git annex init
Download files datalad get git annex get
Prerequisites DataLad + git-annex git-annex only

Why

  • Removes Python dependency (DataLad requires Python)
  • Simpler installation for users
  • DataLad was only a thin wrapper around git-annex for our use case
  • Users can still access NEMAR datasets with DataLad if they prefer (confirmed compatible)

Test plan

  • Build passes (bun run build)
  • TypeScript type check passes
  • CLI help shows updated prerequisites (git-annex only)
  • Tested on mba: prerequisites check correctly identifies git-annex requirement
  • Full sandbox workflow (blocked by gh auth on test machine, unrelated to this change)

Related

Closes #22
Part of epic #58

- Rename datalad.ts to git-annex.ts
- Replace datalad create with git init + git annex init
- Replace datalad save with git add -A + git commit
- Replace datalad clone with git clone + git annex init
- Replace datalad get with git annex get
- Remove checkDataladInstalled() function
- Update prerequisites to only require git-annex
- Update all user-facing messages to reference git-annex

Closes #22
@github-actions

github-actions Bot commented Jan 21, 2026 •

Copy link
Copy Markdown

📦 Package Preview

Your package is ready to test!

bun install -g nemar-cli@PR63

Version: 0.3.6-PR63.a6ac169
Commit: a6ac169


🤖 Updated on each push.

@neuromechanist

Copy link
Copy Markdown
Contributor Author

PR Review Summary

Critical Issues (2)

Issue Location Fix
Empty catch block swallows ALL errors in getLocalDatasetInfo() git-annex.ts:1556-1558 Add error logging
Another empty catch block returns null silently git-annex.ts:1572-1575 Add error logging

Important Issues (5)

Issue Location Fix
getDatasetData file count regex may not match git-annex output git-annex.ts:1488-1490 Update regex or check stderr
collectFileManifest still excludes .datalad/* (dead code) git-annex.ts:1839-1857 Remove exclusion
cloneDataset() swallows git-annex init failures git-annex.ts:1450-1458 Verify init or return warning
saveDataset() doesn't check git status --porcelain exit code git-annex.ts:968-976 Check exit code
pushToGitHub() swallows git-annex branch push failures git-annex.ts:1092-1100 Return warning field

Suggestions (4)

Suggestion Location
Remove unused basename import git-annex.ts:9
Remove unused results variable git-annex.ts:1250-1284
Extract repeated error message pattern to helper Multiple
Add removal version to deprecated aliases git-annex.ts:1903-1911

Strengths

  • Clean refactoring replacing DataLad with git/git-annex
  • Backward-compatible aliases for migration
  • Good error handling in initDataset(), acceptGitHubInvitation()

- Add exit code check for git status in saveDataset
- Verify git-annex init in cloneDataset with fallback check
- Return warning field from pushToGitHub for git-annex branch failures
- Fix empty catch blocks in getLocalDatasetInfo with error logging
- Remove .datalad exclusion from collectFileManifest (dead code)
- Remove unused basename import
- Remove unused results variable in uploadFilesWithPresignedUrls
- Add removal version (v1.0.0) to deprecated aliases
@neuromechanist

Copy link
Copy Markdown
Contributor Author

PR Review Summary

Ran comprehensive review using code-reviewer, silent-failure-hunter, and code-simplifier agents.

Findings Addressed (commit 735f15a)

Critical Issues (2):

  • Empty catch blocks in getLocalDatasetInfo - added error logging

Important Issues (5):

  • saveDataset: Check git status exit code before using output
  • cloneDataset: Verify git-annex init success with fallback check
  • pushToGitHub: Return warning when git-annex branch push fails
  • collectFileManifest: Remove dead .datalad/* exclusion

Suggestions (4):

  • Remove unused basename import
  • Remove unused results variable in uploadFilesWithPresignedUrls
  • Add removal version to deprecated aliases (v1.0.0)

Strengths Noted

  • Clean DataLad removal with backward-compatible aliases
  • Proper error handling with informative messages
  • Good use of TypeScript interfaces for type safety
  • Comprehensive git-annex integration

This branch was previously deployed

1 inactive deployment
npm — a6ac1690 Deployed Jan 21, 2026 by neuromechanist
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.

Make CLI independent of DataLad, bundle git-annex binaries

1 participant