<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/worktree.h, branch v2.16.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.16.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.16.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2017-10-16T02:05:51Z</updated>
<entry>
<title>worktree: convert struct worktree to object_id</title>
<updated>2017-10-16T02:05:51Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2017-10-15T22:07:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0f05154c7064f82f122b845e0fe49a487d3a8d6e'/>
<id>urn:sha1:0f05154c7064f82f122b845e0fe49a487d3a8d6e</id>
<content type='text'>
Convert the head_sha1 member to be head_oid instead.  This is required
to convert resolve_ref_unsafe.

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>revision.c: --all adds HEAD from all worktrees</title>
<updated>2017-08-24T21:56:43Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2017-08-23T12:36:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d0c39a49ccb5dfe7feba4325c3374d99ab123c59'/>
<id>urn:sha1:d0c39a49ccb5dfe7feba4325c3374d99ab123c59</id>
<content type='text'>
Unless single_worktree is set, --all now adds HEAD from all worktrees.

Since reachable.c code does not use setup_revisions(), we need to call
other_head_refs_submodule() explicitly there to have the same effect on
"git prune", so that we won't accidentally delete objects needed by some
other HEADs.

A new FIXME is added because we would need something like

    int refs_other_head_refs(struct ref_store *, each_ref_fn, cb_data);

in addition to other_head_refs() to handle it, which might require

    int get_submodule_worktrees(const char *submodule, int flags);

It could be a separate topic to reduce the scope of this one.

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.c: kill parse_ref() in favor of refs_resolve_ref_unsafe()</title>
<updated>2017-04-25T04:28:55Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2017-04-24T10:01:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fa099d23227f88b5a1cd79c646551130d9b36e6d'/>
<id>urn:sha1:fa099d23227f88b5a1cd79c646551130d9b36e6d</id>
<content type='text'>
The manual parsing code is replaced with a call to refs_resolve_ref_unsafe().
The manual parsing code must die because only refs/files-backend.c
should do that.

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: check if a submodule uses worktrees</title>
<updated>2016-12-12T23:15:07Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2016-12-12T19:04:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1a248cf21d450eb911d01a89c84412c2da365e66'/>
<id>urn:sha1:1a248cf21d450eb911d01a89c84412c2da365e66</id>
<content type='text'>
In a later patch we want to move around the the git directory of
a submodule. Both submodules as well as worktrees are involved in
placing git directories at unusual places, so their functionality
may collide. To react appropriately to situations where worktrees
in submodules are in use, offer a new function to query the
a submodule if it uses the worktree feature.

An earlier approach:
  "Implement submodule_get_worktrees and just count them", however:
  This can be done cheaply (both in new code to write as well as run time)
  by obtaining the list of worktrees based off that submodules git
  directory. However as we have loaded the variables for the current
  repository, the values in the submodule worktree
  can be wrong, e.g.
  * core.ignorecase may differ between these two repositories
  * the ref resolution is broken (refs/heads/branch in the submodule
    resolves to the sha1 value of the `branch` in the current repository
    that may not exist or have another sha1)

The implementation here is just checking for any files in
$GIT_COMMON_DIR/worktrees for the submodule, which ought to be sufficient
if the submodule is using the current repository format, which we also
check.

Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>worktree list: keep the list sorted</title>
<updated>2016-11-28T21:18:51Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2016-11-28T09:36:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4df1d4d4666eb26b420d5b386010470729846b8c'/>
<id>urn:sha1:4df1d4d4666eb26b420d5b386010470729846b8c</id>
<content type='text'>
It makes it easier to write tests for. But it should also be good for
the user since locating a worktree by eye would be easier once they
notice this.

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.c: get_worktrees() takes a new flag argument</title>
<updated>2016-11-28T21:18:51Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2016-11-28T09:36:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4fff1ef7ffe0e370459242cf08c51177eeb4181f'/>
<id>urn:sha1:4fff1ef7ffe0e370459242cf08c51177eeb4181f</id>
<content type='text'>
This is another no-op patch, in preparation for get_worktrees() to do
optional things, like sorting.

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.c: add is_worktree_locked()</title>
<updated>2016-06-13T18:53:14Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2016-06-13T12:18:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=346ef53058ef25f5a7273ee77c03ebc5f732ad77'/>
<id>urn:sha1:346ef53058ef25f5a7273ee77c03ebc5f732ad77</id>
<content type='text'>
We need this later to avoid double locking a worktree, or unlocking one
when it's not even locked.

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.c: add is_main_worktree()</title>
<updated>2016-06-04T04:58:35Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2016-06-03T12:19:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=984ad9e56c9d884f7f1aa7d6b2052f3fb082ee5d'/>
<id>urn:sha1:984ad9e56c9d884f7f1aa7d6b2052f3fb082ee5d</id>
<content type='text'>
Main worktree _is_ different. You can lock (*) a linked worktree but not
the main one, for example. Provide an API for checking that.

(*) Add the file $GIT_DIR/worktrees/xxx/locked to avoid worktree xxx
from being removed or moved.

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.c: add find_worktree()</title>
<updated>2016-06-04T04:58:18Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2016-06-03T12:19:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6835314459794831a1b88bed56549653710e910c'/>
<id>urn:sha1:6835314459794831a1b88bed56549653710e910c</id>
<content type='text'>
So far we haven't needed to identify an existing worktree from command
line. Future commands such as lock or move will need it. The current
implementation identifies worktrees by path (*). In future, the function
could learn to identify by $(basename $path) or tags...

(*) We could probably go cheaper with comparing inode number (and
probably more reliable than paths when unicode enters the game). But not
all systems have good inode that so let's stick to something simple for
now.

Helped-by: Eric Sunshine &lt;sunshine@sunshineco.com&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>branch: do not rename a branch under bisect or rebase</title>
<updated>2016-04-22T21:09:39Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2016-04-22T13:01:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=14ace5b77b493506a1f8ffde96a2f49cc7bc4db0'/>
<id>urn:sha1:14ace5b77b493506a1f8ffde96a2f49cc7bc4db0</id>
<content type='text'>
The branch name in that case could be saved in rebase's head_name or
bisect's BISECT_START files. Ideally we should try to update them as
well. But it's trickier (*). Let's play safe and see if the user
complains about inconveniences before doing that.

(*) If we do it, bisect and rebase need to provide an API to rename
branches. We can't do it in worktree.c or builtin/branch.c because
when other people change rebase/bisect code, they may not be aware of
this code and accidentally break it (e.g. rename the branch file, or
refer to the branch in new files). It's a lot more work.

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>
</feed>
