<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin/worktree.c, branch v2.30.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.30.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.30.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2020-11-30T22:49:43Z</updated>
<entry>
<title>Merge branch 'mt/worktree-error-message-fix'</title>
<updated>2020-11-30T22:49:43Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-11-30T22:49:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f73ee0c6be1c4ce97c623ac6e7d4d2386817bfe0'/>
<id>urn:sha1:f73ee0c6be1c4ce97c623ac6e7d4d2386817bfe0</id>
<content type='text'>
Fix formulation of an error message with two placeholders in "git
worktree add" subcommand.

* mt/worktree-error-message-fix:
  worktree: fix order of arguments in error message
</content>
</entry>
<entry>
<title>worktree: fix order of arguments in error message</title>
<updated>2020-11-21T21:31:34Z</updated>
<author>
<name>Matheus Tavares</name>
<email>matheus.bernardino@usp.br</email>
</author>
<published>2020-11-20T15:09:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b86339b12bc7ef179e2ce4096a5d1ede257ca4d2'/>
<id>urn:sha1:b86339b12bc7ef179e2ce4096a5d1ede257ca4d2</id>
<content type='text'>
`git worktree add` (without --force) errors out when given a path
that is already registered as a worktree and the path is missing on
disk. But the `cmd` and `path` strings are switched on the error
message. Let's fix that.

Signed-off-by: Matheus Tavares &lt;matheus.bernardino@usp.br&gt;
Reviewed-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>worktree: teach `list` to annotate locked worktree</title>
<updated>2020-10-12T19:24:29Z</updated>
<author>
<name>Rafael Silva</name>
<email>rafaeloliveira.cs@gmail.com</email>
</author>
<published>2020-10-11T10:11:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c57b3367bed488469d24a21446731e9e71846ded'/>
<id>urn:sha1:c57b3367bed488469d24a21446731e9e71846ded</id>
<content type='text'>
The "git worktree list" shows the absolute path to the working tree,
the commit that is checked out and the name of the branch. It is not
immediately obvious which of the worktrees, if any, are locked.

"git worktree remove" refuses to remove a locked worktree with
an error message. If "git worktree list" told which worktrees
are locked in its output, the user would not even attempt to
remove such a worktree, or would realize that
"git worktree remove -f -f &lt;path&gt;" is required.

Teach "git worktree list" to append "locked" to its output.
The output from the command becomes like so:

    $ git worktree list
    /path/to/main             abc123 [master]
    /path/to/worktree         456def (detached HEAD)
    /path/to/locked-worktree  123abc (detached HEAD) locked

Helped-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Helped-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Rafael Silva &lt;rafaeloliveira.cs@gmail.com&gt;
Reviewed-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'es/wt-add-detach'</title>
<updated>2020-09-19T00:58:04Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-09-19T00:58:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=45f462b5c5a55039c35fc7001f2256329220bf4f'/>
<id>urn:sha1:45f462b5c5a55039c35fc7001f2256329220bf4f</id>
<content type='text'>
"git worktree add" learns that the "-d" is a synonym to "--detach"
option to create a new worktree without being on a branch.

* es/wt-add-detach:
  git-worktree.txt: discuss branch-based vs. throwaway worktrees
  worktree: teach `add` to recognize -d as shorthand for --detach
  git-checkout.txt: document -d short option for --detach
</content>
</entry>
<entry>
<title>Merge branch 'es/worktree-repair'</title>
<updated>2020-09-09T20:53:07Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-09-09T20:53:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=eb7460fd312511941d64007b5dfc4799a20a8d18'/>
<id>urn:sha1:eb7460fd312511941d64007b5dfc4799a20a8d18</id>
<content type='text'>
"git worktree" gained a "repair" subcommand to help users recover
after moving the worktrees or repository manually without telling
Git.  Also, "git init --separate-git-dir" no longer corrupts
administrative data related to linked worktrees.

* es/worktree-repair:
  init: make --separate-git-dir work from within linked worktree
  init: teach --separate-git-dir to repair linked worktrees
  worktree: teach "repair" to fix outgoing links to worktrees
  worktree: teach "repair" to fix worktree back-links to main worktree
  worktree: add skeleton "repair" command
</content>
</entry>
<entry>
<title>Merge branch 'jk/worktree-check-clean-leakfix'</title>
<updated>2020-09-09T20:53:07Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-09-09T20:53:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1aadb47aad7f4648a1de1e2de84cbcf235eeff59'/>
<id>urn:sha1:1aadb47aad7f4648a1de1e2de84cbcf235eeff59</id>
<content type='text'>
Leakfix.

* jk/worktree-check-clean-leakfix:
  worktree: fix leak in check_clean_worktree()
</content>
</entry>
<entry>
<title>worktree: teach `add` to recognize -d as shorthand for --detach</title>
<updated>2020-09-07T01:53:56Z</updated>
<author>
<name>Eric Sunshine</name>
<email>sunshine@sunshineco.com</email>
</author>
<published>2020-09-07T00:02:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c670aa47dff9829360cc69174f8dd0d82f096011'/>
<id>urn:sha1:c670aa47dff9829360cc69174f8dd0d82f096011</id>
<content type='text'>
Like `git switch` and `git checkout`, `git worktree add` can check out a
branch or set up a detached HEAD. However, unlike those other commands,
`git worktree add` does not understand -d as shorthand for --detach,
which may confound users accustomed to using -d for this purpose.
Address this shortcoming by teaching `add` to recognize -d for --detach,
thus bringing it in line with the other commands.

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: teach "repair" to fix outgoing links to worktrees</title>
<updated>2020-08-31T18:47:45Z</updated>
<author>
<name>Eric Sunshine</name>
<email>sunshine@sunshineco.com</email>
</author>
<published>2020-08-31T06:57:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b214ab5aa597e748c228e657d4eb7c18960e6a67'/>
<id>urn:sha1:b214ab5aa597e748c228e657d4eb7c18960e6a67</id>
<content type='text'>
The .git/worktrees/&lt;id&gt;/gitdir file points at the location of a linked
worktree's .git file. Its content must be of the form
/path/to/worktree/.git (from which the location of the worktree itself
can be derived by stripping the "/.git" suffix). If the gitdir file is
deleted or becomes corrupted or outdated, then Git will be unable to
find the linked worktree. An easy way for the gitdir file to become
outdated is for the user to move the worktree manually (without using
"git worktree move"). Although it is possible to manually update the
gitdir file to reflect the new linked worktree location, doing so
requires a level of knowledge about worktree internals beyond what a
user should be expected to know offhand.

Therefore, teach "git worktree repair" how to repair broken or outdated
.git/worktrees/&lt;id&gt;/gitdir files automatically. (For this to work, the
command must either be invoked from within the worktree whose gitdir
file requires repair, or from within the main or any linked worktree by
providing the path of the broken worktree as an argument to "git
worktree repair".)

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: teach "repair" to fix worktree back-links to main worktree</title>
<updated>2020-08-31T18:47:45Z</updated>
<author>
<name>Eric Sunshine</name>
<email>sunshine@sunshineco.com</email>
</author>
<published>2020-08-31T06:57:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bdd1f3e4da716012a52194cdfbc9c80dfdce87d4'/>
<id>urn:sha1:bdd1f3e4da716012a52194cdfbc9c80dfdce87d4</id>
<content type='text'>
The .git file in a linked worktree is a "gitfile" which points back to
the .git/worktrees/&lt;id&gt; entry in the main worktree or bare repository.
If a worktree's .git file is deleted or becomes corrupted or outdated,
then the linked worktree won't know how to find the repository or any of
its own administrative files (such as 'index', 'HEAD', etc.). An easy
way for the .git file to become outdated is for the user to move the
main worktree or bare repository. Although it is possible to manually
update each linked worktree's .git file to reflect the new repository
location, doing so requires a level of knowledge about worktree
internals beyond what a user should be expected to know offhand.

Therefore, teach "git worktree repair" how to repair broken or outdated
worktree .git files automatically. (For this to work, the command must
be invoked from within the main worktree or bare repository, or from
within a worktree which has not become disconnected from the repository
-- such as one which was created after the repository was moved.)

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 skeleton "repair" command</title>
<updated>2020-08-27T15:59:13Z</updated>
<author>
<name>Eric Sunshine</name>
<email>sunshine@sunshineco.com</email>
</author>
<published>2020-08-27T08:21:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e8e1ff24c5cf885c8d0ac208b58ccaf3760e8bfa'/>
<id>urn:sha1:e8e1ff24c5cf885c8d0ac208b58ccaf3760e8bfa</id>
<content type='text'>
Worktree administrative files can become corrupted or outdated due to
external factors. Although, it is often possible to recover from such
situations by hand-tweaking these files, doing so requires intimate
knowledge of worktree internals. While information necessary to make
such repairs manually can be obtained from git-worktree.txt and
gitrepository-layout.txt, we can assist users more directly by teaching
git-worktree how to repair its administrative files itself (at least to
some extent). Therefore, add a "git worktree repair" command which
attempts to correct common problems which may arise due to factors
beyond Git's control.

At this stage, the "repair" command is a mere skeleton; subsequent
commits will flesh out the functionality.

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