Skip to content

Commit a92bd11

Browse files
authored
Merge pull request #12 from wrale/jmdots/dev
Ripping out all commit things, re: 2025-03-30-0007
2 parents aff7ef6 + f5c1ada commit a92bd11

File tree

19 files changed

+123
-407
lines changed

19 files changed

+123
-407
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "wrale-acdm"
3-
version = "0.1.0"
3+
version = "0.2.0"
44
edition = "2021"
55
description = "Wrale Agnostic Content Dependency Manager"
66
authors = ["Wrale LTD <contact@wrale.com>"]

GUIDANCE/seed/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Wrale Agnostic Content Dependency Manager
1818
- **Version Locking**: Pin dependencies to specific commits, branches, or tags
1919
- **Clean Git History**: Changes to vendored content appear as normal changes in your repository
2020
- **Multiple Protocol Support**: Clone via SSH and HTTPS with appropriate authentication
21-
- **Atomic Operations**: All content updates happen in a single atomic commit
21+
- **Git-Aware Operations**: Operates only within clean Git repositories
2222
- **Domain-Driven Design**: Clean architecture with proper separation of concerns for extensibility
2323

2424
## Core Concepts
@@ -67,9 +67,9 @@ Unlike Git submodules or tools that establish ongoing connections to external re
6767
2. Extract only the specified content based on sparse paths
6868
3. Clean the target mount point by removing all existing content (not using Git but native filesystem operations)
6969
4. Copy new content to the clean target location in your project
70-
5. Stage all changes (additions and removals) for Git
71-
6. Commit all changes in a single atomic transaction
72-
7. Clean up temporary data
70+
5. Clean up temporary data
71+
72+
After these operations, the user needs to manually stage and commit the changes if they wish to persist them.
7373

7474
This approach ensures your repository maintains a clean history without extra metadata or hidden connections to external repositories. The complete cleaning of the mount point (step 3) is crucial for maintaining the integrity of the dependency directory, ensuring a clean slate for each update without relying on git-specific commands.
7575

@@ -90,7 +90,7 @@ While [Gitman](../git/gitman.md) offers similar functionality for selective dire
9090
- Truly zero submodule footprint, with content appearing as normal files
9191
- More focused feature set without symlinks or post-checkout scripts
9292
- Clean architecture design for extensibility
93-
- Atomic operations for content updates
93+
- Git-aware operations that respect repository state
9494

9595
## Development Rationale
9696

@@ -140,8 +140,8 @@ A key aspect of the implementation is how content changes are handled:
140140
1. **Complete Mount Point Cleaning**: For each update, the entire target directory is completely cleared using OS-native operations
141141
2. **Filesystem Abstraction**: Directory removal operations are dependency-inverted to handle cross-OS differences
142142
3. **Clean Slate Approach**: Rather than tracking diffs, each update creates a pristine copy of the current dependency state
143-
4. **Conflict Detection**: Optional pre-cleaning checks for local modifications to vendored content
144-
5. **Atomic Transactions**: All changes are applied in a single Git transaction after filesystem operations are complete
143+
4. **Conflict Detection**: Pre-operation checks ensure the Git repository is in a clean state
144+
5. **Safe Operations**: The tool operates only when Git status is clean, preventing accidental overwrites of uncommitted changes
145145

146146
Example of dependency inversion for directory cleaning:
147147

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Wrale Agnostic Content Dependency Manager
1414
- **Version Locking**: Pin dependencies to specific commits, branches, or tags
1515
- **Clean Git History**: Changes to vendored content appear as normal changes in your repository
1616
- **Multiple Protocol Support**: Clone via SSH and HTTPS with appropriate authentication
17-
- **Atomic Operations**: All content updates happen in a single atomic commit
17+
- **Git-Aware Operations**: Operates only within clean Git repositories
1818
- **Safe Operations**: Verifies clean git status before making changes
1919
- **Interactive Workflow**: Prompts before potentially destructive actions (can be bypassed with --force)
2020
- **Verbose Logging**: Detailed logging for debugging (can be disabled with --quiet)
@@ -68,6 +68,15 @@ Update all dependencies:
6868
acdm update
6969
```
7070

71+
After running any command that modifies files, you'll need to review and commit the changes manually:
72+
73+
```bash
74+
git add .
75+
git commit -m "Update external dependencies"
76+
```
77+
78+
Note: `acdm` requires a clean git repository to perform updates. It will not automatically commit changes.
79+
7180
## Global Flags
7281

7382
The following flags can be used with any command:

docs/user-guide.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,11 @@ Update specific dependencies:
102102
acdm update dep1 dep2
103103
```
104104

105-
Automatically commit changes:
105+
After updating dependencies, you'll need to review and commit the changes manually:
106106

107107
```bash
108-
acdm update --message "Update external dependencies"
108+
git add .
109+
git commit -m "Update external dependencies"
109110
```
110111

111112
Notes:
@@ -162,15 +163,17 @@ RUST_LOG=trace acdm update
162163

163164
`acdm` implements several safety features to protect your repository:
164165

165-
1. **Git Status Check**: Operations will fail if your git repository has uncommitted changes, ensuring a clean state before making modifications.
166+
1. **Git Repository Requirement**: Operations will only run within a Git repository, ensuring you can track changes.
166167

167-
2. **Mount Point Confirmation**: Before purging mount points during updates, you'll be prompted to confirm the operation.
168+
2. **Git Status Check**: Operations will fail if your Git repository has uncommitted changes, ensuring a clean state before making modifications.
168169

169-
3. **Atomic Operations**: All changes are staged together, ensuring consistent updates.
170+
3. **Mount Point Confirmation**: Before purging mount points during updates, you'll be prompted to confirm the operation.
170171

171172
4. **Verbose Logging**: Detailed logs help troubleshoot issues and understand what's happening.
172173

173-
These safety features can be bypassed with the `--force` flag when necessary, but this should be used with caution.
174+
The mount point confirmation can be bypassed with the `--force` flag when necessary, but this should be used with caution.
175+
176+
Note: Unlike previous versions, `acdm` will not automatically stage or commit any changes. After running operations that modify files, you'll need to stage and commit the changes manually.
174177

175178
## Best Practices
176179

@@ -184,11 +187,13 @@ These safety features can be bypassed with the `--force` flag when necessary, bu
184187

185188
5. **Keep a clean git repository**: Commit your changes before running `acdm` operations.
186189

187-
6. **Use atomic updates**: Update all dependencies at once to ensure consistency.
190+
6. **Batch updates**: Update all dependencies at once to ensure consistency.
188191

189192
7. **Version lock**: Update dependencies deliberately, not automatically.
190193

191-
8. **Review before committing**: After updates, review the changes before committing them.
194+
8. **Review and commit manually**: After updates, review all changes and commit them manually.
195+
196+
9. **Create atomic commits**: For cleaner history, commit dependency updates separately from your own code changes.
192197

193198
## Troubleshooting
194199

src/application/dto.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ pub struct IncludePathsDto {
2727
pub struct UpdateDependenciesDto {
2828
pub config_path: PathBuf,
2929
pub dependencies: Option<Vec<String>>,
30-
pub commit_message: Option<String>,
3130
pub force: bool,
32-
pub skip_commit: bool,
3331
}
3432

3533
/// DTO for dependency status

src/application/status.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ impl<C: ConfigurationRepository> GetDependencyStatusQuery<C> {
2626
// Join with current directory to get absolute path
2727
std::env::current_dir()
2828
.map_err(|e| {
29-
DomainError::ConfigurationError(
30-
format!("Failed to get current directory: {}", e).into(),
31-
)
29+
DomainError::ConfigurationError(format!(
30+
"Failed to get current directory: {}",
31+
e
32+
))
3233
})?
3334
.join(config_path)
3435
};
@@ -45,9 +46,7 @@ impl<C: ConfigurationRepository> GetDependencyStatusQuery<C> {
4546
} else {
4647
// This should rarely happen with absolute paths, but handle it anyway
4748
std::env::current_dir().map_err(|e| {
48-
DomainError::ConfigurationError(
49-
format!("Failed to get current directory: {}", e).into(),
50-
)
49+
DomainError::ConfigurationError(format!("Failed to get current directory: {}", e))
5150
})?
5251
};
5352

src/application/use_cases.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -210,13 +210,7 @@ where
210210

211211
// Update all dependencies
212212
self.dependency_manager
213-
.update_all(
214-
&dependencies_to_update,
215-
repo_root,
216-
dto.commit_message.as_deref(),
217-
dto.force,
218-
dto.skip_commit,
219-
)
213+
.update_all(&dependencies_to_update, repo_root, dto.force)
220214
.map_err(|e| anyhow::anyhow!("Failed to update dependencies: {}", e))?;
221215

222216
Ok(())

src/cli/commands/add.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ pub struct AddCommand {
2424
/// Target location for the dependency
2525
#[clap(long)]
2626
target: String,
27-
28-
/// Skip automatically committing changes
29-
#[clap(long)]
30-
skip_commit: bool,
3127
}
3228

3329
impl AddCommand {
@@ -45,7 +41,6 @@ impl AddCommand {
4541
self.repository_url.clone(),
4642
self.rev.clone(),
4743
self.target.clone(),
48-
self.skip_commit,
4944
force,
5045
)?;
5146

src/cli/commands/include.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ pub struct IncludeCommand {
1515

1616
/// Paths to include
1717
paths: Vec<String>,
18-
19-
/// Skip automatically committing changes
20-
#[clap(long)]
21-
skip_commit: bool,
2218
}
2319

2420
impl IncludeCommand {
@@ -28,12 +24,7 @@ impl IncludeCommand {
2824
debug!("Force mode: {}", force);
2925

3026
let adapter = CliAdapter::new(config_path.to_path_buf());
31-
adapter.include_paths(
32-
self.dependency_name.clone(),
33-
self.paths.clone(),
34-
self.skip_commit,
35-
force,
36-
)?;
27+
adapter.include_paths(self.dependency_name.clone(), self.paths.clone(), force)?;
3728

3829
info!("Paths included successfully");
3930
Ok(())

0 commit comments

Comments
 (0)