Skip to content

Commit b409aa3

Browse files
committed
colocation: rename from "colocated repo" to "colocated workspace"
Colocation is about sharing the working copy between jj and git. It's less important where the repo is stored. I therefore think we should not call it "colocated repo". I considered renaming it to "colocated working copy" but that sounded awkward in many places because we often talk about the whole workspace (repo + working copy), so "In colocated workspaces with a very large number of branches or other refs" sounds better than "In colocated working copies with a very large number of branches or other refs". Once we support colocate workspaces in non-main Git worktrees, I think this rename will be even more relevant because then all those workspaces share the same repo but only some of them may be colocated.
1 parent 3899e17 commit b409aa3

27 files changed

+117
-104
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ Here is how you can explore a GitHub repository with `jj`.
227227
<img src="demos/git_compat.png" />
228228

229229
You can even have a [colocated local
230-
repository](https://jj-vcs.github.io/jj/latest/git-compatibility#colocated-jujutsugit-repos)
230+
workspace](https://jj-vcs.github.io/jj/latest/git-compatibility#colocated-jujutsugit-repos)
231231
where you can use both `jj` and `git` commands interchangeably.
232232

233233
### The working copy is automatically committed

cli/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ fn main() {
2424
println!("cargo:rerun-if-env-changed=NIX_JJ_GIT_HASH");
2525
let git_hash = get_git_hash_from_nix().or_else(|| {
2626
if Path::new(GIT_HEAD_PATH).exists() {
27-
// In colocated repo, .git/HEAD should reflect the working-copy parent.
27+
// In colocated workspace, .git/HEAD should reflect the working-copy parent.
2828
println!("cargo:rerun-if-changed={GIT_HEAD_PATH}");
2929
} else if Path::new(JJ_OP_HEADS_PATH).exists() {
3030
// op_heads changes when working-copy files are mutated, which is way more

cli/src/commands/file/untrack.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub(crate) struct FileUntrackArgs {
3636
/// Paths to untrack. They must already be ignored.
3737
///
3838
/// The paths could be ignored via a .gitignore or .git/info/exclude (in
39-
/// colocated repos).
39+
/// colocated workspaces).
4040
#[arg(
4141
required = true,
4242
value_name = "FILESETS",

cli/src/commands/git/clone.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ pub struct GitCloneArgs {
8181
/// operating on the repo. The Git repository that stores most of the repo
8282
/// data will be hidden inside a sub-directory of the `.jj` directory.
8383
///
84-
/// See [colocation docs] for some minor advantages of non-colocated repos.
84+
/// See [colocation docs] for some minor advantages of non-colocated
85+
/// workspaces.
8586
///
8687
/// [colocation docs]:
8788
/// https://jj-vcs.github.io/jj/latest/git-compatibility/#colocated-jujutsugit-repos

cli/src/commands/git/colocation.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ pub fn cmd_git_colocation(
7272
/// Check that the repository supports colocation commands
7373
/// which means that the repo is backed by git, is not
7474
/// already colocated, and is a main workspace
75-
fn repo_supports_git_colocation_commands(
75+
fn workspace_supports_git_colocation_commands(
7676
workspace_command: &crate::cli_util::WorkspaceCommandHelper,
7777
) -> Result<(), CommandError> {
7878
// Check if backend is Git (will show an error otherwise)
@@ -95,22 +95,22 @@ fn cmd_git_colocation_status(
9595
) -> Result<(), CommandError> {
9696
let workspace_command = command.workspace_helper(ui)?;
9797

98-
// Make sure that the repository supports git colocation commands
99-
repo_supports_git_colocation_commands(&workspace_command)?;
98+
// Make sure that the workspace supports git colocation commands
99+
workspace_supports_git_colocation_commands(&workspace_command)?;
100100

101101
let is_colocated =
102102
is_colocated_git_workspace(workspace_command.workspace(), workspace_command.repo());
103103

104104
if is_colocated {
105-
writeln!(ui.stdout(), "Repository is currently colocated with Git.")?;
105+
writeln!(ui.stdout(), "Workspace is currently colocated with Git.")?;
106106
writeln!(
107107
ui.hint_default(),
108108
"To disable colocation, run: `jj git colocation disable`"
109109
)?;
110110
} else {
111111
writeln!(
112112
ui.stdout(),
113-
"Repository is currently not colocated with Git."
113+
"Workspace is currently not colocated with Git."
114114
)?;
115115
writeln!(
116116
ui.hint_default(),
@@ -128,12 +128,12 @@ fn cmd_git_colocation_enable(
128128
) -> Result<(), CommandError> {
129129
let workspace_command = command.workspace_helper(ui)?;
130130

131-
// Make sure that the repository supports git colocation commands
132-
repo_supports_git_colocation_commands(&workspace_command)?;
131+
// Make sure that the workspace supports git colocation commands
132+
workspace_supports_git_colocation_commands(&workspace_command)?;
133133

134-
// Then ensure that the repo is not already colocated before proceeding
134+
// Then ensure that the workspace is not already colocated before proceeding
135135
if is_colocated_git_workspace(workspace_command.workspace(), workspace_command.repo()) {
136-
writeln!(ui.status(), "Repository is already colocated with Git.")?;
136+
writeln!(ui.status(), "Workspace is already colocated with Git.")?;
137137
return Ok(());
138138
}
139139

@@ -156,7 +156,7 @@ fn cmd_git_colocation_enable(
156156
user_error("A .git directory already exists in the workspace root. Cannot colocate.")
157157
}
158158
_ => user_error_with_message(
159-
"Failed to move Git repository from .jj/repo/store/git to repository root directory.",
159+
"Failed to move Git repository from .jj/repo/store/git to workspace root directory.",
160160
err,
161161
),
162162
})?;
@@ -181,7 +181,7 @@ fn cmd_git_colocation_enable(
181181

182182
writeln!(
183183
ui.status(),
184-
"Repository successfully converted into a colocated Jujutsu/Git repository."
184+
"Workspace successfully converted into a colocated Jujutsu/Git workspace."
185185
)?;
186186

187187
Ok(())
@@ -195,11 +195,11 @@ fn cmd_git_colocation_disable(
195195
let workspace_command = command.workspace_helper(ui)?;
196196

197197
// Make sure that the repository supports git colocation commands
198-
repo_supports_git_colocation_commands(&workspace_command)?;
198+
workspace_supports_git_colocation_commands(&workspace_command)?;
199199

200200
// Then ensure that the repo is colocated before proceeding
201201
if !is_colocated_git_workspace(workspace_command.workspace(), workspace_command.repo()) {
202-
writeln!(ui.status(), "Repository is already not colocated with Git.")?;
202+
writeln!(ui.status(), "Workspace is already not colocated with Git.")?;
203203
return Ok(());
204204
}
205205

@@ -236,7 +236,7 @@ fn cmd_git_colocation_disable(
236236

237237
writeln!(
238238
ui.status(),
239-
"Repository successfully converted into a non-colocated Jujutsu/Git repository."
239+
"Workspace successfully converted into a non-colocated Jujutsu/Git workspace."
240240
)?;
241241

242242
Ok(())

cli/src/commands/git/export.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ use crate::ui::Ui;
2121

2222
/// Update the underlying Git repo with changes made in the repo
2323
///
24-
/// There is no need to run this command if you're in colocated repo because the
25-
/// export happens automatically there.
24+
/// There is no need to run this command if you're in colocated workspace
25+
/// because the export happens automatically there.
2626
#[derive(clap::Args, Clone, Debug)]
2727
pub struct GitExportArgs {}
2828

cli/src/commands/git/import.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ use crate::ui::Ui;
2424
/// If a working-copy commit gets abandoned, it will be given a new, empty
2525
/// commit. This is true in general; it is not specific to this command.
2626
///
27-
/// There is no need to run this command if you're in colocated repo because the
28-
/// import happens automatically there.
27+
/// There is no need to run this command if you're in colocated workspace
28+
/// because the import happens automatically there.
2929
#[derive(clap::Args, Clone, Debug)]
3030
pub struct GitImportArgs {}
3131

@@ -37,7 +37,7 @@ pub fn cmd_git_import(
3737
let mut workspace_command = command.workspace_helper(ui)?;
3838
let git_settings = workspace_command.settings().git_settings()?;
3939
let mut tx = workspace_command.start_transaction();
40-
// In non-colocated repo, Git HEAD will never be moved internally by jj.
40+
// In non-colocated workspace, Git HEAD will never be moved internally by jj.
4141
// That's why cmd_git_export() doesn't export the HEAD ref.
4242
git::import_head(tx.repo_mut())?;
4343
let stats = git::import_refs(tx.repo_mut(), &git_settings)?;

cli/src/commands/git/init.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ pub struct GitInitArgs {
8080
/// operating on the repo. The Git repository that stores most of the repo
8181
/// data will be hidden inside a sub-directory of the `.jj` directory.
8282
///
83-
/// See [colocation docs] for some minor advantages of non-colocated repos.
83+
/// See [colocation docs] for some minor advantages of non-colocated
84+
/// workspaces.
8485
///
8586
/// [colocation docs]:
8687
/// https://jj-vcs.github.io/jj/latest/git-compatibility/#colocated-jujutsugit-repos
@@ -93,7 +94,7 @@ pub struct GitInitArgs {
9394
/// If the specified `--git-repo` path happens to be the same as
9495
/// the `jj` repo path (both .jj and .git directories are in the
9596
/// same working directory), then both `jj` and `git` commands
96-
/// will work on the same repo. This is called a colocated repo.
97+
/// will work on the same repo. This is called a colocated workspace.
9798
///
9899
/// This option is mutually exclusive with `--colocate`.
99100
#[arg(long, conflicts_with = "colocate", value_hint = clap::ValueHint::DirPath)]

cli/tests/[email protected]

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,7 +1156,7 @@ Stop tracking specified paths in the working copy
11561156

11571157
* `<FILESETS>` — Paths to untrack. They must already be ignored.
11581158

1159-
The paths could be ignored via a .gitignore or .git/info/exclude (in colocated repos).
1159+
The paths could be ignored via a .gitignore or .git/info/exclude (in colocated workspaces).
11601160

11611161

11621162

@@ -1331,7 +1331,7 @@ Create a new repo backed by a clone of a Git repo
13311331

13321332
Prevent Git tools that are unaware of `jj` and regular Git commands from operating on the repo. The Git repository that stores most of the repo data will be hidden inside a sub-directory of the `.jj` directory.
13331333

1334-
See [colocation docs] for some minor advantages of non-colocated repos.
1334+
See [colocation docs] for some minor advantages of non-colocated workspaces.
13351335

13361336
[colocation docs]: https://jj-vcs.github.io/jj/latest/git-compatibility/#colocated-jujutsugit-repos
13371337
* `--depth <DEPTH>` — Create a shallow clone of the given depth
@@ -1401,7 +1401,7 @@ Show the current colocation status
14011401

14021402
Update the underlying Git repo with changes made in the repo
14031403

1404-
There is no need to run this command if you're in colocated repo because the export happens automatically there.
1404+
There is no need to run this command if you're in colocated workspace because the export happens automatically there.
14051405

14061406
**Usage:** `jj git export`
14071407

@@ -1440,7 +1440,7 @@ Update repo with changes made in the underlying Git repo
14401440

14411441
If a working-copy commit gets abandoned, it will be given a new, empty commit. This is true in general; it is not specific to this command.
14421442

1443-
There is no need to run this command if you're in colocated repo because the import happens automatically there.
1443+
There is no need to run this command if you're in colocated workspace because the import happens automatically there.
14441444

14451445
**Usage:** `jj git import`
14461446

@@ -1477,12 +1477,12 @@ Create a new Git backed repo
14771477

14781478
Prevent Git tools that are unaware of `jj` and regular Git commands from operating on the repo. The Git repository that stores most of the repo data will be hidden inside a sub-directory of the `.jj` directory.
14791479

1480-
See [colocation docs] for some minor advantages of non-colocated repos.
1480+
See [colocation docs] for some minor advantages of non-colocated workspaces.
14811481

14821482
[colocation docs]: https://jj-vcs.github.io/jj/latest/git-compatibility/#colocated-jujutsugit-repos
14831483
* `--git-repo <GIT_REPO>` — Specifies a path to an **existing** git repository to be used as the backing git repo for the newly created `jj` repo.
14841484

1485-
If the specified `--git-repo` path happens to be the same as the `jj` repo path (both .jj and .git directories are in the same working directory), then both `jj` and `git` commands will work on the same repo. This is called a colocated repo.
1485+
If the specified `--git-repo` path happens to be the same as the `jj` repo path (both .jj and .git directories are in the same working directory), then both `jj` and `git` commands will work on the same repo. This is called a colocated workspace.
14861486

14871487
This option is mutually exclusive with `--colocate`.
14881488

cli/tests/common/test_environment.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ impl Default for TestEnvironment {
6363
command_number: RefCell::new(0),
6464
};
6565
// Use absolute timestamps in the operation log to make tests independent of the
66-
// current time. Use non-colocated repos by default for simplicity.
66+
// current time. Use non-colocated workspaces by default for simplicity.
6767
env.add_config(
6868
r#"
6969
[template-aliases]

0 commit comments

Comments
 (0)