Skip to content

Commit f095087

Browse files
committed
Add floating versions documentation to README and migration guide (#14)
- Add floating version syntax (x.y.*, x.*) documentation to README SemVer section - Include configuration examples demonstrating automatic version updates - Document mixed-mode selection behavior in SemVer mode - Add comprehensive SemVer floating versions section to migration guide - Create "Handling Shared Dependencies Version Changes (SemVer Mode)" scenarios - Demonstrate zero-configuration automatic updates for compatible changes - Add floating version strategy tables and best practices - Include troubleshooting guidance for version conflicts - Show realistic workflows highlighting advantages over Agnostic mode Provides complete documentation for floating versions feature added in v7.1.0 Fixes #14
1 parent 7136a16 commit f095087

3 files changed

Lines changed: 569 additions & 385 deletions

File tree

CHANGELOG.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,39 @@ 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+
## [7.1.0] - 2025-09-02
9+
10+
### Added
11+
- Floating versions support for SemVer dependency resolution mode
12+
- New version pattern `x.y.*` for automatic patch version updates (e.g., `"Version": "2.1.*"`)
13+
- New version pattern `x.*` for automatic minor and patch version updates (e.g., `"Version": "2.*"`)
14+
- Mixed specification mode: when any dependency uses floating versions, automatically select highest compatible version
15+
- `Parse-VersionPattern` function to handle floating version pattern parsing and validation
16+
- Enhanced `Test-SemVerCompatibility` function to support floating pattern compatibility testing
17+
- `Select-VersionFromIntersection` function for intelligent version selection based on pattern types
18+
- `Get-CompatibleVersionsForPattern` function for floating pattern version resolution
19+
- Comprehensive floating version examples in documentation and migration guide
20+
21+
### Changed
22+
- SemVer version selection behavior: now selects highest compatible version when floating patterns are present
23+
- Enhanced error messages to display floating pattern types and detailed compatibility information
24+
- Updated migration guide with floating version examples for all SemVer scenarios
25+
- Improved debug logging to show floating pattern types and selection reasoning
26+
27+
### Fixed
28+
- Version selection now properly handles mixed floating and fixed version requirements
29+
- SemVer conflict resolution provides clearer error messages with pattern type information
30+
31+
### Deprecated
32+
- None
33+
34+
### Removed
35+
- None
36+
37+
### Security
38+
- None
39+
40+
841
## [7.0.0] - 2025-01-27
942

1043
### Added

README.md

Lines changed: 142 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# LsiGitCheckout
22

3-
A PowerShell script for managing multiple Git repositories with support for tags, SSH authentication via PuTTY, Git LFS, and submodules. Features advanced recursive dependency resolution with API compatibility checking, Semantic Versioning (SemVer) support, flexible compatibility modes, intelligent automatic tag temporal sorting, custom dependency file configurations, and post-checkout PowerShell script execution for integration with external dependency management systems.
3+
A PowerShell script for managing multiple Git repositories with support for tags, SSH authentication via PuTTY, Git LFS, and submodules. Features advanced recursive dependency resolution with API compatibility checking, Semantic Versioning (SemVer) support with floating versions, flexible compatibility modes, intelligent automatic tag temporal sorting, custom dependency file configurations, and post-checkout PowerShell script execution for integration with external dependency management systems.
44

55
## Table of Contents
66

@@ -35,6 +35,7 @@ A PowerShell script for managing multiple Git repositories with support for tags
3535
- **Dry Run Mode**: Preview operations without making changes
3636
- **Recursive Dependencies**: Discover and process nested repository dependencies with API compatibility checking
3737
- **Dependency Resolution Modes**: Choose between Agnostic (tag-based) and SemVer (Semantic Versioning) resolution
38+
- **Floating Versions**: Support for SemVer floating version patterns (x.y.*, x.*) for automatic latest version selection
3839
- **Flexible Compatibility Modes**: Choose between Strict and Permissive API compatibility modes
3940
- **Intelligent Tag Temporal Sorting**: Always-on automatic chronological tag ordering using actual git tag dates with optimized performance
4041
- **Custom Dependency Files**: Per-repository custom dependency file paths and names with proper isolation
@@ -161,7 +162,7 @@ Contains repository configurations without any credential information:
161162
- **API Compatible Tags** (optional, Agnostic mode): List of API-compatible tags (can be in any order - automatic chronological sorting)
162163
- **API Compatibility** (optional): "Strict" or "Permissive" (defaults to script parameter when absent)
163164
- **Dependency Resolution** (optional): "Agnostic" (default) or "SemVer" - see [Dependency Resolution Modes](#dependency-resolution-modes)
164-
- **Version** (required for SemVer mode): Semantic version requirement (e.g., "2.1.0")
165+
- **Version** (required for SemVer mode): Semantic version requirement (e.g., "2.1.0", "2.1.*", "2.*")
165166
- **Version Regex** (optional, SemVer mode): Custom regex pattern for version extraction from tags
166167
- **Skip LFS** (optional): Skip Git LFS downloads for this repository and all submodules
167168
- **Dependency File Path** (optional): Custom subdirectory within repository for dependency file
@@ -289,7 +290,7 @@ At this point, the script must determine:
289290
LsiGitCheckout provides two powerful approaches to solve this challenge:
290291

291292
1. **Agnostic Mode**: Uses explicit "API Compatible Tags" lists with intelligent intersection/union algorithms
292-
2. **SemVer Mode**: Automatically resolves compatible versions based on Semantic Versioning 2.0.0 rules
293+
2. **SemVer Mode**: Automatically resolves compatible versions based on Semantic Versioning 2.0.0 rules with floating version support
293294

294295
Both modes use sophisticated conflict resolution algorithms that consider the compatibility requirements of all callers and select the optimal version that satisfies everyone's needs.
295296

@@ -301,7 +302,8 @@ Each mode offers distinct advantages and is suited for different scenarios:
301302
- **Zero maintenance overhead**: Compatible updates require no configuration changes
302303
- **Automatic conflict detection**: Clear error messages when version requirements conflict
303304
- **Immediate availability**: Entire dependency tree benefits from compatible updates as soon as they're released
304-
- **Simplified configuration**: Only need to specify minimum version requirements
305+
- **Simplified configuration**: Only need to specify minimum version requirements or floating patterns
306+
- **Floating versions**: Automatically select latest compatible versions using patterns like `2.1.*` or `2.*`
305307
- **Industry standard**: Follows well-understood Semantic Versioning 2.0.0 rules
306308

307309
#### Agnostic Mode Advantages
@@ -315,6 +317,7 @@ Each mode offers distinct advantages and is suited for different scenarios:
315317
- You want to minimize configuration maintenance overhead
316318
- Your team understands and follows SemVer 2.0.0 principles
317319
- You prefer automatic compatibility resolution with clear, predictable rules
320+
- You want to leverage floating versions for automatic latest version selection
318321
- You're starting a new project or can enforce semantic versioning discipline
319322

320323
#### When to Choose Agnostic Mode
@@ -353,15 +356,18 @@ The traditional tag-based resolution using exact tags and explicit API Compatibl
353356

354357
### SemVer Mode
355358

356-
Automatic version resolution based on Semantic Versioning 2.0.0 rules. This mode eliminates the need to maintain explicit compatibility lists by leveraging semantic versioning conventions.
359+
Automatic version resolution based on Semantic Versioning 2.0.0 rules. This mode eliminates the need to maintain explicit compatibility lists by leveraging semantic versioning conventions and supports floating version patterns for automatic latest version selection.
357360

358361
**Key Features:**
359362
- Automatic compatibility resolution using SemVer rules
363+
- Floating version patterns for automatic latest version selection
360364
- Support for custom version tag patterns
361365
- Intelligent conflict detection and reporting
362-
- Lowest compatible version selection for stability
366+
- Mixed specification mode: floating patterns select highest compatible versions
363367

364-
**Configuration Example:**
368+
**Configuration Examples:**
369+
370+
#### Lowest Applicable Version (traditional)
365371
```json
366372
{
367373
"Repository URL": "https://github.com/org/library.git",
@@ -372,8 +378,55 @@ Automatic version resolution based on Semantic Versioning 2.0.0 rules. This mode
372378
}
373379
```
374380

381+
#### Floating Patch Version (new in v7.1.0)
382+
```json
383+
{
384+
"Repository URL": "https://github.com/org/library.git",
385+
"Base Path": "libs/library",
386+
"Dependency Resolution": "SemVer",
387+
"Version": "2.1.*"
388+
}
389+
```
390+
391+
#### Floating Minor Version (new in v7.1.0)
392+
```json
393+
{
394+
"Repository URL": "https://github.com/org/library.git",
395+
"Base Path": "libs/library",
396+
"Dependency Resolution": "SemVer",
397+
"Version": "2.*"
398+
}
399+
```
400+
375401
### SemVer Mode Details
376402

403+
#### Version Specification Patterns
404+
405+
SemVer mode supports three version specification patterns:
406+
407+
1. **Lowest Applicable Version (`x.y.z`)**: Select minimum version that satisfies compatibility requirements
408+
- Example: `"Version": "2.1.0"` → Compatible: 2.1.0, 2.1.1, 2.2.0 → Selects: 2.1.0
409+
410+
2. **Floating Patch Version (`x.y.*`)**: Select latest patch version within specified major.minor
411+
- Example: `"Version": "2.1.*"` → Compatible: 2.1.0, 2.1.1, 2.1.5 → Selects: 2.1.5
412+
413+
3. **Floating Minor Version (`x.*`)**: Select latest minor.patch version within specified major
414+
- Example: `"Version": "2.*"` → Compatible: 2.1.0, 2.3.2, 2.5.0 → Selects: 2.5.0
415+
416+
#### Mixed Specification Mode
417+
418+
When multiple repositories declare the same dependency with different specification patterns:
419+
420+
- **If ANY dependency uses floating patterns** → select **highest** compatible version
421+
- **If ALL dependencies use lowest-applicable** → select **lowest** compatible version
422+
423+
**Example Mixed Mode Scenario:**
424+
```
425+
Repository A: "Version": "3.0.0" (lowest-applicable)
426+
Repository B: "Version": "3.*" (floating minor)
427+
Result: System selects highest 3.x.x version that satisfies both requirements
428+
```
429+
377430
#### Version Compatibility Rules
378431

379432
SemVer mode follows standard Semantic Versioning 2.0.0 rules:
@@ -389,10 +442,6 @@ SemVer mode follows standard Semantic Versioning 2.0.0 rules:
389442
- PATCH must be >= the requested version
390443
- Example: Request `0.2.1` → Compatible: `0.2.1`, `0.2.5`, NOT `0.3.0`
391444

392-
#### Version Selection
393-
394-
When multiple compatible versions exist, the script selects the **lowest compatible version** to ensure stability and predictable behavior.
395-
396445
#### Custom Version Tag Formats
397446

398447
If your repositories use non-standard version tag formats, you can specify a custom regex:
@@ -412,15 +461,15 @@ If your repositories use non-standard version tag formats, you can specify a cus
412461

413462
If multiple repositories depend on the same library with incompatible version requirements, the script will report a detailed conflict error showing:
414463
- All repositories requesting the conflicting dependency
415-
- Their individual version requirements
464+
- Their individual version requirements and pattern types
416465
- The compatible versions for each requirement
417466

418467
**Example conflict:**
419468
```
420469
SemVer conflict for repository 'https://github.com/org/shared-lib.git':
421470
No version satisfies all requirements:
422-
- https://github.com/org/app-a.git requests: 2.1.0 (compatible: v2.1.0, v2.1.1, v2.2.0)
423-
- https://github.com/org/app-b.git requests: 3.0.0 (compatible: v3.0.0, v3.1.0)
471+
- https://github.com/org/app-a.git requests: 2.1.0 (type: LowestApplicable, compatible: v2.1.0, v2.1.1, v2.2.0)
472+
- https://github.com/org/app-b.git requests: 3.* (type: FloatingMinor, compatible: v3.0.0, v3.1.0, v3.2.0)
424473
```
425474

426475
### Mixed Mode Support
@@ -440,7 +489,7 @@ You can use both Agnostic and SemVer modes in the same dependency tree. Each rep
440489
"Repository URL": "https://github.com/org/lib-core.git",
441490
"Base Path": "libs/core",
442491
"Dependency Resolution": "SemVer",
443-
"Version": "2.3.0"
492+
"Version": "2.3.*"
444493
},
445494
{
446495
"Repository URL": "https://github.com/org/lib-utils.git",
@@ -454,10 +503,12 @@ You can use both Agnostic and SemVer modes in the same dependency tree. Each rep
454503
### Best Practices
455504

456505
1. **Choose SemVer mode** when your repositories follow semantic versioning consistently
457-
2. **Use Agnostic mode** when you need fine-grained control over compatibility or don't follow strict semver
458-
3. **Mix modes appropriately** - use SemVer for well-versioned libraries and Agnostic for experimental or legacy components
459-
4. **Test your dependency tree** with `-DryRun` before actual checkouts
460-
5. **Use consistent version tag formats** across your organization when using SemVer mode
506+
2. **Use floating versions** (`x.y.*`, `x.*`) when you want automatic latest version selection
507+
3. **Use lowest-applicable versions** (`x.y.z`) when you need stability and predictable versions
508+
4. **Use Agnostic mode** when you need fine-grained control over compatibility or don't follow strict semver
509+
5. **Mix modes appropriately** - use SemVer for well-versioned libraries and Agnostic for experimental or legacy components
510+
6. **Test your dependency tree** with `-DryRun` before actual checkouts
511+
7. **Use consistent version tag formats** across your organization when using SemVer mode
461512

462513
## API Compatibility Modes
463514

@@ -818,25 +869,32 @@ Write-Host "Dependency setup completed for $env:LSIGIT_REPOSITORY_PATH"
818869
- Verify version requirements are compatible
819870
- Check that version tags follow your specified regex pattern
820871
- Review conflict details in error messages for resolution guidance
872+
- Consider using floating versions (x.y.*, x.*) for more flexible version selection
821873

822-
7. **Tag temporal sorting issues**
874+
7. **Floating version pattern errors**
875+
- Ensure floating patterns use correct syntax: `x.y.*` or `x.*`
876+
- Verify repository tags match the specified Version Regex pattern
877+
- Check that compatible versions exist for floating patterns
878+
- Review debug logs for pattern parsing and version selection details
879+
880+
8. **Tag temporal sorting issues**
823881
- Verify git tags exist in repositories
824882
- Check debug logs for tag date fetching errors
825883
- Ensure repositories are accessible for tag date queries
826884
- Review verbose output for tag selection decisions
827885

828-
8. **Custom dependency file not found**
886+
9. **Custom dependency file not found**
829887
- Verify the custom path and filename are correct
830888
- Check that the dependency file exists in the specified location
831889
- Remember that paths are relative to repository root
832890
- Use debug logging to see resolved paths
833891

834-
9. **Repository path conflicts**
835-
- Ensure the same repository isn't referenced with different relative paths
836-
- Check that custom dependency file paths don't create conflicting layouts
837-
- Verify relative paths resolve correctly from repository roots
892+
10. **Repository path conflicts**
893+
- Ensure the same repository isn't referenced with different relative paths
894+
- Check that custom dependency file paths don't create conflicting layouts
895+
- Verify relative paths resolve correctly from repository roots
838896

839-
10. **Post-checkout script issues**
897+
11. **Post-checkout script issues**
840898
- Verify script file exists at the specified location
841899
- Ensure script has .ps1 extension
842900
- Check script execution permissions
@@ -860,6 +918,8 @@ Check the generated debug log file for:
860918
- Compatibility mode interactions
861919
- Tag date fetching operations and chronological sorting
862920
- SemVer version parsing and conflict resolution
921+
- Version pattern recognition (LowestApplicable, FloatingPatch, FloatingMinor)
922+
- Mixed specification mode selection logic
863923
- Custom dependency file path resolution
864924
- Repository root path usage for relative path resolution
865925
- Post-checkout script discovery and execution details
@@ -878,9 +938,65 @@ This provides:
878938
- Line numbers and function names where errors occurred
879939
- Detailed error context for complex dependency resolution scenarios
880940
- Enhanced troubleshooting information for SemVer conflicts
941+
- Floating version pattern parsing and resolution diagnostics
881942

882943
## Migration Guide
883944

945+
### From Version 7.0.0 to 7.1.0
946+
947+
Version 7.1.0 introduces Floating Versions support for SemVer mode:
948+
949+
#### New Features Available
950+
- **Floating Patch Versions (`x.y.*`)**: Automatically select latest patch versions
951+
- **Floating Minor Versions (`x.*`)**: Automatically select latest minor.patch versions
952+
- **Mixed Specification Mode**: Intelligent selection between lowest-applicable and highest-compatible based on pattern types
953+
- **Enhanced logging**: Shows version pattern types and selection reasoning
954+
955+
#### Migration Steps
956+
1. **Immediate**: All existing v7.0.0 configurations work without changes
957+
2. **Optional**: Convert appropriate SemVer specifications to floating patterns for automatic latest version selection
958+
3. **Enhanced workflows**: Leverage floating versions for dependency currency while maintaining stability where needed
959+
960+
#### Floating Version Examples
961+
962+
**Before (Lowest Applicable):**
963+
```json
964+
{
965+
"Repository URL": "https://github.com/org/library.git",
966+
"Dependency Resolution": "SemVer",
967+
"Version": "2.1.0"
968+
}
969+
```
970+
971+
**After (Floating Patch - optional):**
972+
```json
973+
{
974+
"Repository URL": "https://github.com/org/library.git",
975+
"Dependency Resolution": "SemVer",
976+
"Version": "2.1.*"
977+
}
978+
```
979+
980+
**After (Floating Minor - optional):**
981+
```json
982+
{
983+
"Repository URL": "https://github.com/org/library.git",
984+
"Dependency Resolution": "SemVer",
985+
"Version": "2.*"
986+
}
987+
```
988+
989+
#### Benefits of Floating Versions
990+
- **Automatic updates**: Get latest patches/minors without manual configuration changes
991+
- **Flexible dependency management**: Mix fixed and floating patterns as appropriate
992+
- **Reduced maintenance**: Less frequent dependency file updates required
993+
- **Better currency**: Stay up-to-date with compatible improvements
994+
995+
#### Non-Breaking Changes
996+
- **Zero configuration changes required**: All existing dependency files work without modification
997+
- **Backward compatibility**: Traditional `x.y.z` patterns remain the default
998+
- **Gradual adoption**: Convert to floating patterns as appropriate for your stability requirements
999+
8841000
### From Version 6.2.x to 7.0.0
8851001

8861002
Version 7.0.0 introduces Semantic Versioning (SemVer) support alongside the existing Agnostic mode:

0 commit comments

Comments
 (0)