<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin/worktree.c, branch v2.23.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.23.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.23.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2019-06-13T20:19:40Z</updated>
<entry>
<title>Merge branch 'nd/worktree-name-sanitization'</title>
<updated>2019-06-13T20:19:40Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-06-13T20:19:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0d107b19890db191c9281bff67180389fb53df24'/>
<id>urn:sha1:0d107b19890db191c9281bff67180389fb53df24</id>
<content type='text'>
In recent versions of Git, per-worktree refs are exposed in
refs/worktrees/&lt;wtname&gt;/ hierarchy, which means that worktree names
must be a valid refname component.  The code now sanitizes the names
given to worktrees, to make sure these refs are well-formed.

* nd/worktree-name-sanitization:
  worktree add: sanitize worktree names
</content>
</entry>
<entry>
<title>worktree add: sanitize worktree names</title>
<updated>2019-05-15T04:56:43Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2019-03-08T09:28:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1de16aecf51daf5794aa074f6dd133e088a12690'/>
<id>urn:sha1:1de16aecf51daf5794aa074f6dd133e088a12690</id>
<content type='text'>
Worktree names are based on $(basename $GIT_WORK_TREE). They aren't
significant until 3a3b9d8cde (refs: new ref types to make per-worktree
refs visible to all worktrees - 2018-10-21), where worktree name could
be part of a refname and must follow refname rules.

Update 'worktree add' code to remove special characters to follow
these rules. In the future the user will be able to specify the
worktree name by themselves if they're not happy with this dumb
character substitution.

Reported-by: Konstantin Kharlamov &lt;hi-angel@yandex.ru&gt;
Helped-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ms/worktree-add-atomic-mkdir'</title>
<updated>2019-04-09T17:14:24Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-04-09T17:14:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=20fe798b1bf301f78485a56381ad8dad48b2c670'/>
<id>urn:sha1:20fe798b1bf301f78485a56381ad8dad48b2c670</id>
<content type='text'>
"git worktree add" used to do a "find an available name with stat
and then mkdir", which is race-prone.  This has been fixed by using
mkdir and reacting to EEXIST in a loop.

* ms/worktree-add-atomic-mkdir:
  worktree: fix worktree add race
</content>
</entry>
<entry>
<title>worktree: fix worktree add race</title>
<updated>2019-03-12T06:56:11Z</updated>
<author>
<name>Michal Suchanek</name>
<email>msuchanek@suse.de</email>
</author>
<published>2019-02-20T16:16:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7af01f23678dbaeed37773e37737f2ef3db1cb49'/>
<id>urn:sha1:7af01f23678dbaeed37773e37737f2ef3db1cb49</id>
<content type='text'>
Git runs a stat loop to find a worktree name that's available and
then does mkdir on the found name. Turn it to mkdir loop to avoid
another invocation of worktree add finding the same free name and
creating the directory first.

Signed-off-by: Michal Suchanek &lt;msuchanek@suse.de&gt;
Acked-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>trace2:data: add trace2 hook classification</title>
<updated>2019-02-22T23:28:21Z</updated>
<author>
<name>Jeff Hostetler</name>
<email>jeffhost@microsoft.com</email>
</author>
<published>2019-02-22T22:25:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6206286e49b88bd4bb709c62e7b7455685c1993a'/>
<id>urn:sha1:6206286e49b88bd4bb709c62e7b7455685c1993a</id>
<content type='text'>
Classify certain child processes as hooks.

Signed-off-by: Jeff Hostetler &lt;jeffhost@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>worktree: allow to (re)move worktrees with uninitialized submodules</title>
<updated>2019-01-07T17:26:33Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2019-01-05T05:08:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=00a6d4d1d2260a07ca1372acfae692d9821f165f'/>
<id>urn:sha1:00a6d4d1d2260a07ca1372acfae692d9821f165f</id>
<content type='text'>
Uninitialized submodules have nothing valueable for us to be worried
about. They are just SHA-1. Let "worktree remove" and "worktree move"
continue in this case so that people can still use multiple worktrees
on repos with optional submodules that are never populated, like
sha1collisiondetection in git.git when checked out by doc-diff script.

Note that for "worktree remove", it is possible that a user
initializes a submodule (*), makes some commits (but not push), then
deinitializes it. At that point, the submodule is unpopulated, but the
precious new commits are still in

    $GIT_COMMON_DIR/worktrees/&lt;worktree&gt;/modules/&lt;submodule&gt;

directory and we should not allow removing the worktree or we lose
those commits forever. The new directory check is added to prevent
this.

(*) yes they are screwed anyway by doing this since "git submodule"
    would add submodule.* in $GIT_COMMON_DIR/config, which is shared
    across multiple worktrees. But it does not mean we let them be
    screwed even more.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>worktree: rename is_worktree_locked to worktree_lock_reason</title>
<updated>2018-10-31T02:41:47Z</updated>
<author>
<name>Nickolai Belakovski</name>
<email>nbelakovski@gmail.com</email>
</author>
<published>2018-10-30T06:24:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d236f12bdeb478bbaabf056bc611c34cf9218ca8'/>
<id>urn:sha1:d236f12bdeb478bbaabf056bc611c34cf9218ca8</id>
<content type='text'>
A function prefixed with 'is_' would be expected to return a boolean,
however this function returns a string.

Signed-off-by: Nickolai Belakovski &lt;nbelakovski@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>worktree: delete .git/worktrees if empty after 'remove'</title>
<updated>2018-08-30T16:28:02Z</updated>
<author>
<name>Eric Sunshine</name>
<email>sunshine@sunshineco.com</email>
</author>
<published>2018-08-28T21:20:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3a5404333c6c8b5897e78c9dcb711d623035791b'/>
<id>urn:sha1:3a5404333c6c8b5897e78c9dcb711d623035791b</id>
<content type='text'>
For cleanliness, "git worktree prune" deletes the .git/worktrees
directory if it is empty after pruning is complete.

For consistency, make "git worktree remove &lt;path&gt;" likewise delete
.git/worktrees if it is empty after the removal.

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 'remove' to override lock when --force given twice</title>
<updated>2018-08-30T16:28:02Z</updated>
<author>
<name>Eric Sunshine</name>
<email>sunshine@sunshineco.com</email>
</author>
<published>2018-08-28T21:20:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f4143101cbb26d189f63f2d29875f4acc07b2730'/>
<id>urn:sha1:f4143101cbb26d189f63f2d29875f4acc07b2730</id>
<content type='text'>
For consistency with "add -f -f" and "move -f -f" which override
the lock on a worktree, allow "remove -f -f" to do so, as well, as a
convenience.

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 'move' to override lock when --force given twice</title>
<updated>2018-08-30T16:28:02Z</updated>
<author>
<name>Eric Sunshine</name>
<email>sunshine@sunshineco.com</email>
</author>
<published>2018-08-28T21:20:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=68a6b3a1bd45eb1814a0c1cedfe347692c3f2ff7'/>
<id>urn:sha1:68a6b3a1bd45eb1814a0c1cedfe347692c3f2ff7</id>
<content type='text'>
For consistency with "add -f -f", which allows a missing but locked
worktree path to be re-used, allow "move -f -f" to override a lock,
as well, as a convenience.

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