ok/jj
1
0
Fork 0
forked from mirrors/jj

cli: rename --git-store to --git-repo

"store" is just used internally, it's not something we should expose
to users.
This commit is contained in:
Martin von Zweigbergk 2022-02-02 08:10:36 -08:00
parent 8fe21b0438
commit 51c351f272
3 changed files with 15 additions and 15 deletions

View file

@ -19,15 +19,15 @@ underlying Git repo will be inside of that directory (currently in
## Creating a repo backed by an existing Git repo
To create a Jujutsu repo backed by a Git repo you already have on disk, use
`jj init --git-store=<path to Git repo> <name>`. The repo will work similar to
a [Git worktree](https://git-scm.com/docs/git-worktree), meaning that the
working copies and the record of the current checkout will be separate, but the
commits will be accessible in both repos. Use `jj git import` to update the
Jujutsu repo with changes made in the Git repo. Use `jj git export` to update
the Git repo with changes made in the Jujutsu repo.
`jj init --git-repo=<path to Git repo> <name>`. The repo will work similar to a
[Git worktree](https://git-scm.com/docs/git-worktree), meaning that the working
copies and the record of the current checkout will be separate, but the commits
will be accessible in both repos. Use `jj git import` to update the Jujutsu repo
with changes made in the Git repo. Use `jj git export` to update the Git repo
with changes made in the Jujutsu repo.
If you create initialize the Jujutsu repo in the same working copy as the Git
repo by running `jj init --git-store=.`, then the import and export will happen
repo by running `jj init --git-repo=.`, then the import and export will happen
automatically on every command (because not doing that makes it very confusing
when the current checkout has changed in Git but not in Jujutsu or vice versa).
This mode is meant to make it easier to start using readonly `jj` commands in an

View file

@ -193,7 +193,7 @@ impl CommandHelper {
// it differently.
message += "
It looks like this is a git repo. You can create a jj repo backed by it by running this:
jj init --git-store=.";
jj init --git-repo=.";
}
return Err(CommandError::UserError(message));
}
@ -799,10 +799,10 @@ fn get_app<'help>() -> App<'help> {
.help("Use the Git backend, creating a jj repo backed by a Git repo"),
)
.arg(
Arg::new("git-store")
.long("git-store")
Arg::new("git-repo")
.long("git-repo")
.takes_value(true)
.help("Path to a .git/ directory the jj repo will be backed by"),
.help("Path to a git repo the jj repo will be backed by"),
);
let checkout_command = App::new("checkout")
.alias("co")
@ -1608,9 +1608,9 @@ fn add_to_git_exclude(ui: &mut Ui, git_repo: &git2::Repository) -> Result<(), Co
}
fn cmd_init(ui: &mut Ui, command: &CommandHelper, args: &ArgMatches) -> Result<(), CommandError> {
if args.is_present("git") && args.is_present("git-store") {
if args.is_present("git") && args.is_present("git-repo") {
return Err(CommandError::UserError(String::from(
"--git cannot be used with --git-store",
"--git cannot be used with --git-repo",
)));
}
let wc_path_str = args.value_of("destination").unwrap();
@ -1621,7 +1621,7 @@ fn cmd_init(ui: &mut Ui, command: &CommandHelper, args: &ArgMatches) -> Result<(
fs::create_dir(&wc_path).unwrap();
}
if let Some(git_store_str) = args.value_of("git-store") {
if let Some(git_store_str) = args.value_of("git-repo") {
let git_store_path = ui.cwd().join(git_store_str);
let (workspace, repo) =
Workspace::init_external_git(ui.settings(), wc_path.clone(), git_store_path)?;

View file

@ -48,7 +48,7 @@ fn test_init_git_external() {
let output = testutils::CommandRunner::new(temp_dir.path()).run(vec![
"init",
"repo",
"--git-store",
"--git-repo",
git_repo_path.to_str().unwrap(),
]);
assert_eq!(output.status, 0);