Skip to content

Commit 2d5bd4e

Browse files
committed
feat: Add tag temporal sorting for automatic chronological tag ordering
Implements automatic tag temporal sorting to eliminate manual ordering requirements for API Compatible Tags in recursive dependency resolution. Features: - New -EnableTagSorting parameter (disabled by default) - Automatic tag date fetching using git for-each-ref - Chronological tag sorting based on actual git tag creation dates - Priority-based tag selection algorithm favoring specified "Tag" values - Relaxed temporal ordering requirements when enabled - Comprehensive debug and verbose logging Benefits: - Eliminates manual temporal ordering burden for users - Reduces configuration errors and maintenance overhead - Enables flexible API Compatible Tags ordering - Provides accurate chronological selection using real git dates - Maintains full backward compatibility Technical Implementation: - Get-GitTagDates function for efficient tag date retrieval - Sort-TagsByDate function with PSCustomObject for reliable sorting - Enhanced Update-RepositoryDictionary with intelligent tag selection - Improved Get-TagUnion with temporal sorting support - Tag date caching in repository dictionary for performance Breaking Changes: None (opt-in feature, disabled by default)
1 parent 0b14463 commit 2d5bd4e

File tree

4 files changed

+563
-87
lines changed

4 files changed

+563
-87
lines changed

CHANGELOG.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,44 @@ All notable changes to LsiGitCheckout will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [4.2.0] - 2025-01-16
9+
10+
### Added
11+
- **Tag Temporal Sorting**: New `-EnableTagSorting` parameter enables automatic chronological tag ordering using actual git tag dates
12+
- Intelligent tag selection algorithm that prioritizes existing/new "Tag" values when resolving repository conflicts
13+
- `Get-GitTagDates` function for efficient tag date fetching using `git for-each-ref`
14+
- `Sort-TagsByDate` function for chronological tag sorting with comprehensive debug logging
15+
- Enhanced `Get-TagUnion` function with temporal sorting support when tag dates are available
16+
- Priority-based tag selection: prefers specified "Tag" values over other compatible tags when both are compatible
17+
- Fallback to chronologically most recent tag when neither existing nor new "Tag" is compatible
18+
- Comprehensive verbose and debug logging for tag temporal sorting operations
19+
- Tag date verification and temporal order display in verbose mode
20+
- Relaxed temporal ordering requirements when `-EnableTagSorting` is enabled
21+
- Tag date caching in repository dictionary for performance optimization
22+
23+
### Changed
24+
- Enhanced repository dictionary structure to include `TagDates` field for storing tag date mappings
25+
- Improved tag selection logic in all API compatibility scenarios (Strict-Strict, Strict-Permissive, Permissive-Permissive, Permissive-Strict)
26+
- Updated summary report to display tag temporal sorting status and statistics
27+
- Enhanced union algorithm to use temporal sorting when enabled, falling back to original logic when disabled
28+
- Improved error handling for tag date parsing and git command failures
29+
30+
### Fixed
31+
- PowerShell string interpolation issues with datetime formatting in log messages
32+
- Improved tag sorting object creation using `[PSCustomObject]` for reliable `Sort-Object` operations
33+
- Enhanced temporal verification logging with proper variable delimiting
34+
35+
### Performance
36+
- Minimal server impact: tag dates fetched only once per repository after initial checkout
37+
- Efficient `git for-each-ref` command usage instead of individual `git log` calls per tag
38+
- Tag date caching eliminates redundant git operations during recursive processing
39+
40+
### Backward Compatibility
41+
- **Non-breaking**: All existing configurations work without modification
42+
- **Default behavior**: `-EnableTagSorting` is disabled by default, maintaining v4.1.x behavior
43+
- **Opt-in feature**: New functionality only active when explicitly enabled
44+
- Manual temporal ordering requirements preserved when tag sorting is disabled
45+
846
## [4.1.1] - 2025-01-16
947

1048
### Fixed

0 commit comments

Comments
 (0)