Skip to content

Add --git option for explicit git mv control#226

Merged
BenjaminMichaelis merged 6 commits intomainfrom
copilot/evaluate-git-mv-option
Feb 8, 2026
Merged

Add --git option for explicit git mv control#226
BenjaminMichaelis merged 6 commits intomainfrom
copilot/evaluate-git-mv-option

Conversation

Copy link
Contributor

Copilot AI commented Feb 8, 2026

Issue #84 requested evaluation of git mv benefits and adding it as an option. GitStorageManager (using LibGit2Sharp's Commands.Move) already existed but was only available via auto-detection. This adds explicit control via --git flag.

Changes

  • New --git flag on update command: Forces use of GitStorageManager, errors if not in a git repository
  • New constructor: ListingManager(DirectoryInfo, bool useGit) for explicit storage manager selection
  • Fixed git detection: Changed from Repository.IsValid() to Repository.Discover() to properly detect repos from subdirectories
  • Maintained backward compatibility: Default constructor auto-detects, preferring GitStorageManager when available

Behavior

# Force git mv (errors if not in repo)
ListingManager update Chapter03 --git

# Auto-detect (existing behavior, now works from subdirs)
ListingManager update Chapter03
Scenario Result
--git in git repo Uses GitStorageManager
--git outside git repo Error with clear message
No --git in git repo Auto-detects, uses GitStorageManager
No --git outside git repo Auto-detects, uses OSStorageManager

Why git mv matters

Preserves file rename history for git log --follow, blame, and code review.

Original prompt

This section details on the original issue you should resolve

<issue_title>Move files using git mv</issue_title>
<issue_description>Evaluate if git mv provides a significant difference in the way moved files are treated by git, and consider adding it as an option. I.E: --git

This was started in #84 . There may not be, but see if enhancements can be made</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 5 commits February 8, 2026 07:07
Co-authored-by: BenjaminMichaelis <22186029+BenjaminMichaelis@users.noreply.github.com>
Co-authored-by: BenjaminMichaelis <22186029+BenjaminMichaelis@users.noreply.github.com>
Co-authored-by: BenjaminMichaelis <22186029+BenjaminMichaelis@users.noreply.github.com>
Co-authored-by: BenjaminMichaelis <22186029+BenjaminMichaelis@users.noreply.github.com>
Co-authored-by: BenjaminMichaelis <22186029+BenjaminMichaelis@users.noreply.github.com>
Copilot AI changed the title [WIP] Evaluate significance of git mv for file management Add --git option for explicit git mv control Feb 8, 2026
@BenjaminMichaelis BenjaminMichaelis marked this pull request as ready for review February 8, 2026 07:18
@BenjaminMichaelis BenjaminMichaelis merged commit 1c00408 into main Feb 8, 2026
2 checks passed
@BenjaminMichaelis BenjaminMichaelis deleted the copilot/evaluate-git-mv-option branch February 8, 2026 07:19
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.

Move files using git mv

2 participants

Comments