Skip to content

Releases: andrewmcwattersandco/git-fetch-file

v1.4.3

20 Aug 23:31
Compare
Choose a tag to compare

Fixed

  • Target path calculation with git aliases: Fixed critical bug where target paths were incorrectly calculated when using git fetch-file commands from subdirectories within a repository. Git aliases that start with ! execute from the repository root, causing the tool to incorrectly detect the working directory as the repository root instead of the directory where the user invoked the command.
  • GIT_PREFIX environment variable support: Now properly uses Git's GIT_PREFIX environment variable to determine the correct relative path from repository root to where the command was invoked, ensuring target paths are calculated correctly regardless of where the git alias runs.
  • Manifest target storage accuracy: Target paths in the .git-remote-files manifest are now correctly stored relative to the git repository root, accounting for the actual directory where the command was run.

Technical Details

  • Modified get_relative_path_from_git_root() to use os.environ.get('GIT_PREFIX') instead of Path.cwd().relative_to(git_root)
  • Enhanced conflict detection logic to handle cases where the same file from the same repository is being tracked with different target paths
  • Improved target path calculation for both explicit target directories and default placement scenarios

Examples of Fixed Behavior

Before (incorrect):

cd repo/subdir
git fetch-file add https://github.com/user/repo.git file.txt myfile.txt
# Would store: target = myfile.txt (incorrect, should be subdir/myfile.txt)

After (correct):

cd repo/subdir  
git fetch-file add https://github.com/user/repo.git file.txt myfile.txt
# Now stores: target = subdir/myfile.txt (correct)

What's Changed

New Contributors

Full Changelog: v1.4.2...v1.4.3

v1.4.2

14 Aug 22:11
Compare
Choose a tag to compare

Fixed

  • Fixed pull command not updating branch-tracked files to their latest commits
  • Fixed incorrect "local changes detected" warnings when pulling branch updates
  • Branch-tracked files now automatically resolve to the latest commit on their branch during pulls
  • Fixed grouping logic to use resolved commits instead of stored commits for branch-tracked files
  • Improved local change detection to distinguish between actual user modifications and expected branch updates

Changed

  • BREAKING: Removed --save flag from pull command
  • Branch tracking is now automatic: files with a branch key automatically update to latest commit, files without branch key remain pinned to their stored commit
  • Improved user experience by making branch vs. pinned behavior more intuitive

Full Changelog: v1.4.1...v1.4.2

v1.4.1

13 Aug 17:02
Compare
Choose a tag to compare

Fixed

  • Directory creation bug: Fixed issue where TEMP_DIR wasn't being created before use in pull_files function, which could cause operations to fail
  • Test coverage: Added test for git fetch-file pull command to prevent regression

Full Changelog: v1.4.0...v1.4.1

v1.4.0

12 Aug 00:05
Compare
Choose a tag to compare

Added

  • Multi-target file tracking: Same file can now be tracked from different repositories or to different target directories without conflicts
  • Enhanced conflict detection: Intelligent conflict detection only prevents duplicates when repository, file path, and target directory are all identical
  • Remove command: New git fetch-file remove <path> [<target_dir>] command to remove tracked files from the manifest
  • Force flag for add command: Added --force flag to add command for intentionally overwriting existing entries
  • Repository disambiguation: --repository flag for remove command to disambiguate entries from different repositories

Changed

  • BREAKING: Manifest format simplification: All manifest sections now use unified format [file "path" from "repository_url"] for clarity and consistency
  • Eliminated redundant repository keys: Repository information is now stored only in section names, eliminating duplicate repository keys in manifest entries
  • Simplified codebase: Removed unnecessary helper functions, making the code more maintainable
  • Git-style error messages: Conflict errors now use concise, git-like format: fatal: 'file' already tracked from <repo> with helpful hints
  • Backward compatibility: Old manifest formats are still supported and automatically migrated

Fixed

  • Issue #5: Cannot add same filename from two different repos: Resolved conflict detection that incorrectly prevented tracking same filename from different repositories or to different target directories

Improved

  • Conflict resolution guidance: Error messages now provide clear options: use --force to overwrite, or specify different target directory
  • Status output clarity: Status command shows multiple entries when same file is tracked to different locations
  • Documentation coverage: Comprehensive README.md updates with conflict handling examples and new command documentation

Full Changelog: v1.3.0...v1.4.0

v1.3.0

11 Aug 20:38
Compare
Choose a tag to compare

Added

  • Backward compatibility for manifest format: Automatic migration from legacy repo key to new repository key in .git-remote-files manifest
  • Documentation improvements: Updated README.md with corrected manifest format examples and improved feature descriptions
  • Git-consistent options: Added --detach option for commit tracking (consistent with git checkout --detach), while maintaining --commit for backward compatibility

Changed

  • BREAKING: Manifest format standardization: The .git-remote-files manifest now uses repository as the key instead of repo for consistency. Old files are automatically migrated when read
  • Commit hash storage: The manifest now always stores actual commit hashes in the commit field, never symbolic references like "HEAD" or branch names
  • Dry-run accuracy: Dry-run mode now resolves commit references to actual commit hashes before displaying output, providing accurate information about what would be stored
  • CLI argument consistency: Updated help text and all user-facing output to use <repository> instead of <repo> for consistency

Fixed

  • Commit reference resolution: Fixed inconsistency where commit_ref could be "HEAD" in display logic, which didn't align with the requirement that manifests always store resolved commit hashes
  • Display consistency: Eliminated confusing "HEAD" symbolic references from manifest format and user-facing output
  • Jobs parallelism documentation: Corrected help text from "default: 4" to "default: auto" to accurately reflect the CPU-based auto-detection behavior
  • README.md accuracy: Fixed output message casing and manifest format examples to match actual tool behavior

Improved

  • Code organization: Added resolve_commit_ref() helper function to centralize commit resolution logic and eliminate code duplication
  • User experience: All user-facing code, variables, and help text now consistently use "repository" instead of "repo" for clarity
  • Documentation completeness: Enhanced README.md with backward compatibility notes, corrected examples, and comprehensive feature descriptions
  • Migration transparency: Added clear notes about v1.3.0 manifest format changes with full backward compatibility assurance
  • Git consistency: Improved option naming with --detach (matching git's terminology) while preserving --commit for compatibility

Full Changelog: v1.2.2...v1.3.0

v1.2.2

11 Aug 17:34
Compare
Choose a tag to compare

Fixed

  • Concurrency crash with multiple files from same repository: Fixed fatal crash when pulling multiple files from the same repository concurrently. The tool now groups files by repository and commit, creating a single shared clone per group instead of attempting multiple simultaneous clones to the same directory. This resolves the "Command returned non-zero exit status 128" error that occurred when using default concurrency settings

Full Changelog: v1.2.1...v1.2.2

v1.2.1

10 Aug 01:26
Compare
Choose a tag to compare

Fixed

  • Commit hash cloning: Fixed failure when fetching files from specific commit hashes. The tool now properly distinguishes between commit hashes (40 hex characters) and branch/tag names when cloning repositories, resolving the "returned non-zero exit status 128" error

Full Changelog: v1.2.0...v1.2.1

v1.2.0

10 Aug 00:41
Compare
Choose a tag to compare

Fixed

  • Directory structure preservation: Fixed bug where glob patterns with target directories would flatten all files instead of preserving their original directory hierarchy
  • Dry-run target path calculation: Fixed inconsistent path handling between actual fetching and dry-run mode for glob patterns

Improved

  • Massive performance improvement for glob patterns: Reduced repository cloning from N+1 operations (1 for discovery + 1 per file) to just 1 clone operation total
  • Git-style error messages: Updated all error and warning messages to follow standard git command conventions:
    • Use fatal:, error:, and warning: prefixes appropriately
    • Lowercase message text (except proper nouns)
    • No trailing punctuation
    • Consistent tone and style with git commands

Added

  • Informative glob feedback: Added messages showing how many files match a glob pattern during fetching (e.g., "Found 71 files matching '**' in repository")

Full Changelog: v1.1.0...v1.2.0

v1.1.0

07 Aug 15:50
Compare
Choose a tag to compare

Add branch tracking (-b, --branch)

Full Changelog: v1.0.0...v1.1.0

v1.0.0

07 Aug 03:11
Compare
Choose a tag to compare