Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ my-api/
├── comline.toml # where `generate` writes code and how (all-commented by default)
├── src/
│ └── main.ids # a sample enum + struct to build on
└── .gitignore # ignores .comline/
└── .gitignore # ignores .comline/deps-cache/
```

`config.idp` starts as:
Expand All @@ -91,8 +91,9 @@ reduced to a valid Comline identifier (letters, digits and `_`), so

After the first `comline build`, a `.comline/` directory appears next to
`config.idp`. It holds the content-addressable store (`objects/`) and the version
ref (`refs/heads/main`). It is build output — keep it out of version control (the
scaffold's `.gitignore` already does).
ref (`refs/heads/main`). It is the package's version history, so commit it.
Only `.comline/deps-cache/`, where git dependencies are fetched, is a local cache;
the scaffold's `.gitignore` ignores that and nothing else.

## Versioning model

Expand Down
5 changes: 3 additions & 2 deletions src/commands/new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ struct Greeting {
";

const GITIGNORE: &str = "\
# Comline build artifacts
.comline/
# `.comline/` holds the package's version history: commit it.
# Fetched git dependencies are a local cache.
.comline/deps-cache/
";

/// Consumer-owned code-generation config. Committed. All-commented by default —
Expand Down
8 changes: 7 additions & 1 deletion tests/cli/new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ fn scaffolds_a_buildable_project() {
assert!(root.join("config.idp").exists());
assert!(root.join("comline.toml").exists());
assert!(root.join("src/greeting.ids").exists());
assert!(root.join(".gitignore").exists());
// The version history is committed; only fetched dependencies are ignored.
let gitignore = fs::read_to_string(root.join(".gitignore")).unwrap();
assert!(
gitignore.lines().any(|l| l == ".comline/deps-cache/"),
"{gitignore}"
);
assert!(!gitignore.lines().any(|l| l == ".comline/"), "{gitignore}");

let config = fs::read_to_string(root.join("config.idp")).unwrap();
assert!(config.contains("congregation my_api"));
Expand Down
Loading