Skip to content

Commit c1e5ca9

Browse files
committed
Merge branch 'es/worktree-add'
Remove remaining cruft from "git checkout --to", which transitioned to "git worktree add". * es/worktree-add: config: rename "gc.pruneWorktreesExpire" to "gc.worktreePruneExpire" Documentation/git-worktree: wordsmith worktree-related manpages Documentation/config: fix stale "git prune --worktree" reference Documentation/git-worktree: fix incorrect reference to file "locked" Documentation/git-worktree: consistently use term "linked working tree"
2 parents 71cc600 + 114ff88 commit c1e5ca9

File tree

4 files changed

+38
-38
lines changed

4 files changed

+38
-38
lines changed

Documentation/config.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,12 +1302,12 @@ gc.pruneExpire::
13021302
"now" may be used to disable this grace period and always prune
13031303
unreachable objects immediately.
13041304

1305-
gc.pruneWorktreesExpire::
1306-
When 'git gc' is run, it will call
1307-
'prune --worktrees --expire 3.months.ago'.
1308-
Override the grace period with this config variable. The value
1309-
"now" may be used to disable the grace period and prune
1310-
$GIT_DIR/worktrees immediately.
1305+
gc.worktreePruneExpire::
1306+
When 'git gc' is run, it calls
1307+
'git worktree prune --expire 3.months.ago'.
1308+
This config variable can be used to set a different grace
1309+
period. The value "now" may be used to disable the grace
1310+
period and prune $GIT_DIR/worktrees immediately.
13111311

13121312
gc.reflogExpire::
13131313
gc.<pattern>.reflogExpire::

Documentation/git-worktree.txt

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ git-worktree(1)
33

44
NAME
55
----
6-
git-worktree - Manage multiple worktrees
6+
git-worktree - Manage multiple working trees
77

88

99
SYNOPSIS
@@ -15,7 +15,7 @@ SYNOPSIS
1515
DESCRIPTION
1616
-----------
1717

18-
Manage multiple worktrees attached to the same repository.
18+
Manage multiple working trees attached to the same repository.
1919

2020
A git repository can support multiple working trees, allowing you to check
2121
out more than one branch at a time. With `git worktree add` a new working
@@ -27,19 +27,19 @@ bare repository) and zero or more linked working trees.
2727
When you are done with a linked working tree you can simply delete it.
2828
The working tree's administrative files in the repository (see
2929
"DETAILS" below) will eventually be removed automatically (see
30-
`gc.pruneworktreesexpire` in linkgit::git-config[1]), or you can run
30+
`gc.worktreePruneExpire` in linkgit::git-config[1]), or you can run
3131
`git worktree prune` in the main or any linked working tree to
3232
clean up any stale administrative files.
3333

34-
If you move a linked working directory to another file system, or
34+
If you move a linked working tree to another file system, or
3535
within a file system that does not support hard links, you need to run
36-
at least one git command inside the linked working directory
36+
at least one git command inside the linked working tree
3737
(e.g. `git status`) in order to update its administrative files in the
3838
repository so that they do not get automatically pruned.
3939

4040
If a linked working tree is stored on a portable device or network share
4141
which is not always mounted, you can prevent its administrative files from
42-
being pruned by creating a file named 'lock' alongside the other
42+
being pruned by creating a file named 'locked' alongside the other
4343
administrative files, optionally containing a plain text reason that
4444
pruning should be suppressed. See section "DETAILS" for more information.
4545

@@ -64,22 +64,22 @@ OPTIONS
6464

6565
-f::
6666
--force::
67-
By default, `add` refuses to create a new worktree when `<branch>`
68-
is already checked out by another worktree. This option overrides
67+
By default, `add` refuses to create a new working tree when `<branch>`
68+
is already checked out by another working tree. This option overrides
6969
that safeguard.
7070

7171
-b <new-branch>::
7272
-B <new-branch>::
7373
With `add`, create a new branch named `<new-branch>` starting at
74-
`<branch>`, and check out `<new-branch>` into the new worktree.
74+
`<branch>`, and check out `<new-branch>` into the new working tree.
7575
If `<branch>` is omitted, it defaults to HEAD.
7676
By default, `-b` refuses to create a new branch if it already
7777
exists. `-B` overrides this safeguard, resetting `<new-branch>` to
7878
`<branch>`.
7979

8080
--detach::
81-
With `add`, detach HEAD in the new worktree. See "DETACHED HEAD" in
82-
linkgit:git-checkout[1].
81+
With `add`, detach HEAD in the new working tree. See "DETACHED HEAD"
82+
in linkgit:git-checkout[1].
8383

8484
-n::
8585
--dry-run::
@@ -91,7 +91,7 @@ OPTIONS
9191
With `prune`, report all removals.
9292

9393
--expire <time>::
94-
With `prune`, only expire unused worktrees older than <time>.
94+
With `prune`, only expire unused working trees older than <time>.
9595

9696
DETAILS
9797
-------
@@ -139,9 +139,9 @@ EXAMPLES
139139
You are in the middle of a refactoring session and your boss comes in and
140140
demands that you fix something immediately. You might typically use
141141
linkgit:git-stash[1] to store your changes away temporarily, however, your
142-
worktree is in such a state of disarray (with new, moved, and removed files,
143-
and other bits and pieces strewn around) that you don't want to risk
144-
disturbing any of it. Instead, you create a temporary linked worktree to
142+
working tree is in such a state of disarray (with new, moved, and removed
143+
files, and other bits and pieces strewn around) that you don't want to risk
144+
disturbing any of it. Instead, you create a temporary linked working tree to
145145
make the emergency fix, remove it when done, and then resume your earlier
146146
refactoring session.
147147

@@ -164,12 +164,12 @@ checkouts of a superproject.
164164
git-worktree could provide more automation for tasks currently
165165
performed manually, such as:
166166

167-
- `remove` to remove a linked worktree and its administrative files (and
168-
warn if the worktree is dirty)
169-
- `mv` to move or rename a worktree and update its administrative files
170-
- `list` to list linked worktrees
167+
- `remove` to remove a linked working tree and its administrative files (and
168+
warn if the working tree is dirty)
169+
- `mv` to move or rename a working tree and update its administrative files
170+
- `list` to list linked working trees
171171
- `lock` to prevent automatic pruning of administrative files (for instance,
172-
for a worktree on a portable device)
172+
for a working tree on a portable device)
173173

174174
GIT
175175
---

Documentation/gitrepository-layout.txt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -251,25 +251,25 @@ modules::
251251
Contains the git-repositories of the submodules.
252252

253253
worktrees::
254-
Contains worktree specific information of linked
255-
checkouts. Each subdirectory contains the worktree-related
256-
part of a linked checkout. This directory is ignored if
257-
$GIT_COMMON_DIR is set and "$GIT_COMMON_DIR/worktrees" will be
258-
used instead.
254+
Contains administrative data for linked
255+
working trees. Each subdirectory contains the working tree-related
256+
part of a linked working tree. This directory is ignored if
257+
$GIT_COMMON_DIR is set, in which case
258+
"$GIT_COMMON_DIR/worktrees" will be used instead.
259259

260260
worktrees/<id>/gitdir::
261261
A text file containing the absolute path back to the .git file
262262
that points to here. This is used to check if the linked
263263
repository has been manually removed and there is no need to
264-
keep this directory any more. mtime of this file should be
264+
keep this directory any more. The mtime of this file should be
265265
updated every time the linked repository is accessed.
266266

267267
worktrees/<id>/locked::
268-
If this file exists, the linked repository may be on a
269-
portable device and not available. It does not mean that the
270-
linked repository is gone and `worktrees/<id>` could be
271-
removed. The file's content contains a reason string on why
272-
the repository is locked.
268+
If this file exists, the linked working tree may be on a
269+
portable device and not available. The presence of this file
270+
prevents `worktrees/<id>` from being pruned either automatically
271+
or manually by `git worktree prune`. The file may contain a string
272+
explaining why the repository is locked.
273273

274274
worktrees/<id>/link::
275275
If this file exists, it is a hard link to the linked .git

builtin/gc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ static void gc_config(void)
8585
git_config_get_int("gc.autopacklimit", &gc_auto_pack_limit);
8686
git_config_get_bool("gc.autodetach", &detach_auto);
8787
git_config_date_string("gc.pruneexpire", &prune_expire);
88-
git_config_date_string("gc.pruneworktreesexpire", &prune_worktrees_expire);
88+
git_config_date_string("gc.worktreepruneexpire", &prune_worktrees_expire);
8989
git_config(git_default_config, NULL);
9090
}
9191

0 commit comments

Comments
 (0)