Skip to content

Commit 5d2c197

Browse files
committed
Merge pull request #85 from git/git-worktree
Git worktree article
2 parents dcb2eea + 1fc2e1f commit 5d2c197

File tree

1 file changed

+58
-2
lines changed

1 file changed

+58
-2
lines changed

rev_news/drafts/edition-5.md

+58-2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,61 @@ This edition covers what happened during the month of June 2015.
2525

2626
### Reviews
2727

28+
* [New `git worktree` command](http://thread.gmane.org/gmane.comp.version-control.git/272949) (*written by Eric Sunshine*)
29+
30+
The linked-worktree facility allows multiple working directories to share a
31+
single repository, with (typically) a different branch checked out in each
32+
worktree. Introduced more than half a year ago to provide integrated and
33+
platform-agnostic support for similar functionality long supplied by the
34+
Unix-only and somewhat fragile `contrib/git-new-workdir` script,
35+
linked-worktrees recently migrated to the *master* branch, but is not
36+
yet part of any release.
37+
38+
Creation of linked-worktrees is accomplished via `git checkout --to <path>
39+
<branch>`, and cleanup of leftover administrative files, after `<path>` is
40+
deleted, is done with `git prune --worktrees`. However, a recent unrelated
41+
change to `git prune` led to a
42+
[discussion](http://thread.gmane.org/gmane.comp.version-control.git/272447/focus=272546)
43+
that concluded that worktree-related maintenance functionality doesn't
44+
belong in `git prune`.
45+
46+
Consequently, Nguyễn Thái Ngọc Duy submitted a
47+
[patch](http://thread.gmane.org/gmane.comp.version-control.git/272949)
48+
which introduces a new `git worktree` command, and relocates `git prune
49+
--worktrees` functionality to `git worktree prune`.
50+
51+
Eric Sunshine then further fleshed out `git worktree` with a
52+
[patch](http://article.gmane.org/gmane.comp.version-control.git/273032)
53+
which relocates `git checkout --to` functionality to `git worktree new`.
54+
A lengthy
55+
[discussion](http://thread.gmane.org/gmane.comp.version-control.git/273032)
56+
ensued, which eventually led to a second version, consisting of [23
57+
patches](http://thread.gmane.org/gmane.comp.version-control.git/273316),
58+
and which names the command `git worktree add`, rather than `git worktree
59+
new`, and gives the documentation some needed attention.
60+
61+
Aside from documentation updates, several other user-visible changes arrive
62+
with the second version. For instance, while preparing worktree-creation
63+
functionality for the move from `git checkout` to `git worktree`, Eric
64+
discovered and fixed a bug where `git checkout --to <path> HEAD~1` would
65+
instead incorrectly checkout `HEAD~2` at `<path>`.
66+
67+
The second version also introduces convenience enhancements. In
68+
particular, the `<branch>` in `git worktree add <path> <branch>`, is now
69+
optional. When omitted, a new branch is created automatically based upon
70+
`<path>`, as if `-b $(basename <path>)` had been provided (where `-b
71+
<new-branch>` creates a new branch). For example, given `git worktree add
72+
../hotfix`, a new branch named *hotfix* is created and checked out into new
73+
worktree `../hotfix`, as if `git worktree -b hotfix ../hotfix HEAD` had
74+
been specified.
75+
76+
Finally, the question was
77+
[raised](http://article.gmane.org/gmane.comp.version-control.git/273107)
78+
whether `git checkout --ignore-other-worktrees` should be retired and `git
79+
checkout --force` overloaded to subsume its duties, however, Junio was [not
80+
thrilled](http://article.gmane.org/gmane.comp.version-control.git/273108)
81+
by the idea.
82+
2883
* [Warning when charset conversion did not happen due to iconv compiled out](http://thread.gmane.org/gmane.comp.version-control.git/270952/)
2984

3085
Max Kirillov proposed a patch to warn when a conversion from a
@@ -206,6 +261,7 @@ to process the format passed in `--date=format:...`, a discussion
206261
about how to manage a potential strftime() failure when it is passed a
207262
bogus format ensued.
208263

264+
209265
## Releases
210266

211267
* [git-multimail](https://github.com/git-multimail/git-multimail) [1.1.0](https://github.com/git-multimail/git-multimail/releases/tag/1.1.0) and [1.1.1](https://github.com/git-multimail/git-multimail/releases/tag/1.1.1) were released. git-multimail is a tool to send notification emails for pushes to a git repository. It is also available in the `contrib/hooks/multimail/` directory of Git's source tree (the new version will be distributed with Git 2.5).
@@ -282,5 +338,5 @@ __Git tools and sites__
282338
## Credits
283339

284340
This edition of Git Rev News was curated by Christian Couder &lt;<[email protected]>&gt;,
285-
Thomas Ferris Nicolaisen &lt;<[email protected]>&gt; and Nicola Paolucci &lt;<[email protected]>&gt;
286-
with help from Junio C Hamano, Matthieu Moy and Johannes Schindelin.
341+
Thomas Ferris Nicolaisen &lt;<[email protected]>&gt; and Nicola Paolucci &lt;<[email protected]>&gt;,
342+
with help from Eric Sunshine &lt;<[email protected]>&gt;, Junio C Hamano, Matthieu Moy and Johannes Schindelin.

0 commit comments

Comments
 (0)