<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin/worktree.c, branch v2.5.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.5.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.5.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2015-07-13T21:02:19Z</updated>
<entry>
<title>Merge branch 'es/worktree-add'</title>
<updated>2015-07-13T21:02:19Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-07-13T21:02:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=799767cc98b2f8e6f82d0de4bef9b5e8fcc16e97'/>
<id>urn:sha1:799767cc98b2f8e6f82d0de4bef9b5e8fcc16e97</id>
<content type='text'>
Update to the "linked checkout" in 2.5.0-rc1.

Instead of "checkout --to" that does not do what "checkout"
normally does, move the functionality to "git worktree add".

* es/worktree-add: (24 commits)
  Revert "checkout: retire --ignore-other-worktrees in favor of --force"
  checkout: retire --ignore-other-worktrees in favor of --force
  worktree: add: auto-vivify new branch when &lt;branch&gt; is omitted
  worktree: add: make -b/-B default to HEAD when &lt;branch&gt; is omitted
  worktree: extract basename computation to new function
  checkout: require worktree unconditionally
  checkout: retire --to option
  tests: worktree: retrofit "checkout --to" tests for "worktree add"
  worktree: add -b/-B options
  worktree: add --detach option
  worktree: add --force option
  worktree: introduce "add" command
  checkout: drop 'checkout_opts' dependency from prepare_linked_checkout
  checkout: make --to unconditionally verbose
  checkout: prepare_linked_checkout: drop now-unused 'new' argument
  checkout: relocate --to's "no branch specified" check
  checkout: fix bug with --to and relative HEAD
  Documentation/git-worktree: add EXAMPLES section
  Documentation/git-worktree: add high-level 'lock' overview
  Documentation/git-worktree: split technical info from general description
  ...
</content>
</entry>
<entry>
<title>Revert "checkout: retire --ignore-other-worktrees in favor of --force"</title>
<updated>2015-07-12T16:38:21Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-07-12T16:38:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c925fe23684455735c3bb1903803643a24a58d8f'/>
<id>urn:sha1:c925fe23684455735c3bb1903803643a24a58d8f</id>
<content type='text'>
This reverts commit 0d1a1517835a10818f2d40d8780a268dbb5e20ce.

When trying to switch to a different branch, that happens to be
checked out in another working tree, the user shouldn't have to
give up the other safety measures (like protecting the local changes
that overlap the difference between the branches) while defeating
the "no two checkouts of the same branch" safety.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>checkout: retire --ignore-other-worktrees in favor of --force</title>
<updated>2015-07-07T21:34:46Z</updated>
<author>
<name>Eric Sunshine</name>
<email>sunshine@sunshineco.com</email>
</author>
<published>2015-07-06T17:31:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0d1a1517835a10818f2d40d8780a268dbb5e20ce'/>
<id>urn:sha1:0d1a1517835a10818f2d40d8780a268dbb5e20ce</id>
<content type='text'>
As a safeguard, checking out a branch already checked out by a different
worktree is disallowed. This behavior can be overridden with
--ignore-other-worktrees, however, this option is neither obvious nor
particularly discoverable. As a common safeguard override, --force is
more likely to come to mind. Therefore, overload it to also suppress the
check for a branch already checked out elsewhere.

Signed-off-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>worktree: add: auto-vivify new branch when &lt;branch&gt; is omitted</title>
<updated>2015-07-07T21:34:32Z</updated>
<author>
<name>Eric Sunshine</name>
<email>sunshine@sunshineco.com</email>
</author>
<published>2015-07-06T17:30:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1eb07d829f3f0992c93c6b44fdcc4e95ebab12f3'/>
<id>urn:sha1:1eb07d829f3f0992c93c6b44fdcc4e95ebab12f3</id>
<content type='text'>
As a convenience, when &lt;branch&gt; is omitted from "git worktree &lt;path&gt;
&lt;branch&gt;" and neither -b nor -B is used, automatically create a new
branch named after &lt;path&gt;, as if "-b $(basename &lt;path&gt;)" was specified.
Thus, "git worktree add ../hotfix" creates a new branch named "hotfix"
and associates it with new worktree "../hotfix".

Signed-off-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>worktree: add: make -b/-B default to HEAD when &lt;branch&gt; is omitted</title>
<updated>2015-07-06T18:07:48Z</updated>
<author>
<name>Eric Sunshine</name>
<email>sunshine@sunshineco.com</email>
</author>
<published>2015-07-06T17:30:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0f4af3b9ea1fc62e445271bb2e7fbb8e1ac230b7'/>
<id>urn:sha1:0f4af3b9ea1fc62e445271bb2e7fbb8e1ac230b7</id>
<content type='text'>
As a convenience, like "git branch" and "git checkout -b", make
"git worktree add -b &lt;newbranch&gt; &lt;path&gt; &lt;branch&gt;" default to HEAD when
&lt;branch&gt; is omitted.

Signed-off-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>worktree: extract basename computation to new function</title>
<updated>2015-07-06T18:07:48Z</updated>
<author>
<name>Eric Sunshine</name>
<email>sunshine@sunshineco.com</email>
</author>
<published>2015-07-06T17:30:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f5682b2a861cbde6e9aca324caa5e2d36c49569a'/>
<id>urn:sha1:f5682b2a861cbde6e9aca324caa5e2d36c49569a</id>
<content type='text'>
A subsequent patch will also need to compute the basename of the new
worktree, so factor out this logic into a new function.

Signed-off-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>checkout: retire --to option</title>
<updated>2015-07-06T18:07:47Z</updated>
<author>
<name>Eric Sunshine</name>
<email>sunshine@sunshineco.com</email>
</author>
<published>2015-07-06T17:30:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b979d95027242455b10e6f566b0e96c5f30cc908'/>
<id>urn:sha1:b979d95027242455b10e6f566b0e96c5f30cc908</id>
<content type='text'>
Now that "git worktree add" has achieved user-facing feature-parity with
"git checkout --to", retire the latter.

Move the actual linked worktree creation functionality,
prepare_linked_checkout() and its helpers, verbatim from checkout.c to
worktree.c.

This effectively reverts changes to checkout.c by 529fef2 (checkout:
support checking out into a new working directory, 2014-11-30) with the
exception of merge_working_tree() and switch_branches() which still
require specialized knowledge that a the checkout is occurring in a
newly-created linked worktree (signaled to them by the private
GIT_CHECKOUT_NEW_WORKTREE environment variable).

Signed-off-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>worktree: add -b/-B options</title>
<updated>2015-07-06T18:07:47Z</updated>
<author>
<name>Eric Sunshine</name>
<email>sunshine@sunshineco.com</email>
</author>
<published>2015-07-06T17:30:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cbdf60fa183e3a2330849046846b400ef4a99c3b'/>
<id>urn:sha1:cbdf60fa183e3a2330849046846b400ef4a99c3b</id>
<content type='text'>
One of git-worktree's roles is to populate the new worktree, much like
git-checkout, and thus, for convenience, ought to support several of the
same shortcuts. Toward this goal, add -b/-B options to create a new
branch and check it out in the new worktree.

(For brevity, only -b is mentioned in the synopsis; -B is omitted.)

Signed-off-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>worktree: add --detach option</title>
<updated>2015-07-06T18:07:46Z</updated>
<author>
<name>Eric Sunshine</name>
<email>sunshine@sunshineco.com</email>
</author>
<published>2015-07-06T17:30:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=39ecb27436296361371d3caadcc9bc4a4e0b556d'/>
<id>urn:sha1:39ecb27436296361371d3caadcc9bc4a4e0b556d</id>
<content type='text'>
One of git-worktree's roles is to populate the new worktree, much like
git-checkout, and thus, for convenience, ought to support several of the
same shortcuts. Toward this goal, add a --detach option to detach HEAD
in the new worktree.

Signed-off-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>worktree: add --force option</title>
<updated>2015-07-06T18:07:46Z</updated>
<author>
<name>Eric Sunshine</name>
<email>sunshine@sunshineco.com</email>
</author>
<published>2015-07-06T17:30:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f43254440d56da1fd52216cbebd5c285b20985e6'/>
<id>urn:sha1:f43254440d56da1fd52216cbebd5c285b20985e6</id>
<content type='text'>
By default, "git worktree add" refuses to create a new worktree when
the requested branch is already checked out elsewhere. Add a --force
option to override this safeguard.

Signed-off-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
