<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/worktree.c, branch v2.9.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.9.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.9.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2016-05-23T21:54:29Z</updated>
<entry>
<title>Merge branch 'nd/worktree-various-heads'</title>
<updated>2016-05-23T21:54:29Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-05-23T21:54:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=352d72a30e3d113064ebc194f49560eeae34b332'/>
<id>urn:sha1:352d72a30e3d113064ebc194f49560eeae34b332</id>
<content type='text'>
The experimental "multiple worktree" feature gains more safety to
forbid operations on a branch that is checked out or being actively
worked on elsewhere, by noticing that e.g. it is being rebased.

* nd/worktree-various-heads:
  branch: do not rename a branch under bisect or rebase
  worktree.c: check whether branch is bisected in another worktree
  wt-status.c: split bisect detection out of wt_status_get_state()
  worktree.c: check whether branch is rebased in another worktree
  worktree.c: avoid referencing to worktrees[i] multiple times
  wt-status.c: make wt_status_check_rebase() work on any worktree
  wt-status.c: split rebase detection out of wt_status_get_state()
  path.c: refactor and add worktree_git_path()
  worktree.c: mark current worktree
  worktree.c: make find_shared_symref() return struct worktree *
  worktree.c: store "id" instead of "git_dir"
  path.c: add git_common_path() and strbuf_git_common_path()
  dir.c: rename str(n)cmp_icase to fspath(n)cmp
</content>
</entry>
<entry>
<title>typofix: assorted typofixes in comments, documentation and messages</title>
<updated>2016-05-06T20:16:37Z</updated>
<author>
<name>Li Peng</name>
<email>lip@dtdream.com</email>
</author>
<published>2016-05-06T12:36:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=832c0e5e63a0f61c3788847d4a7abb82d9e86ef4'/>
<id>urn:sha1:832c0e5e63a0f61c3788847d4a7abb82d9e86ef4</id>
<content type='text'>
Many instances of duplicate words (e.g. "the the path") and
a few typoes are fixed, originally in multiple patches.

    wildmatch: fix duplicate words of "the"
    t: fix duplicate words of "output"
    transport-helper: fix duplicate words of "read"
    Git.pm: fix duplicate words of "return"
    path: fix duplicate words of "look"
    pack-protocol.txt: fix duplicate words of "the"
    precompose-utf8: fix typo of "sequences"
    split-index: fix typo
    worktree.c: fix typo
    remote-ext: fix typo
    utf8: fix duplicate words of "the"
    git-cvsserver: fix duplicate words

Signed-off-by: Li Peng &lt;lip@dtdream.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>
<entry>
<title>worktree.c: check whether branch is bisected in another worktree</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:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=04a3dfb8b5993fcb807fcbca8ed7ea608d30a204'/>
<id>urn:sha1:04a3dfb8b5993fcb807fcbca8ed7ea608d30a204</id>
<content type='text'>
Similar to the rebase case, we want to detect if "HEAD" in some worktree
is being bisected because

1) we do not want to checkout this branch in another worktree, after
   bisect is done it will want to go back to this branch

2) we do not want to delete the branch is either or git bisect will
   fail to return to the (long gone) branch

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: check whether branch is rebased in another worktree</title>
<updated>2016-04-22T21:09:38Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2016-04-22T13:01:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8d9fdd7087d0c2700a56e20043d5d79c9951f64f'/>
<id>urn:sha1:8d9fdd7087d0c2700a56e20043d5d79c9951f64f</id>
<content type='text'>
This function find_shared_symref() is used in a couple places:

1) in builtin/branch.c: it's used to detect if a branch is checked out
   elsewhere and refuse to delete the branch.

2) in builtin/notes.c: it's used to detect if a note is being merged in
   another worktree

3) in branch.c, the function die_if_checked_out() is actually used by
   "git checkout" and "git worktree add" to see if a branch is already
   checked out elsewhere and refuse the operation.

In cases 1 and 3, if a rebase is ongoing, "HEAD" will be in detached
mode, find_shared_symref() fails to detect it and declares "no branch is
checked out here", which is not really what we want.

This patch tightens the test. If the given symref is "HEAD", we try to
detect if rebase is ongoing. If so return the branch being rebased. This
makes checkout and branch delete operations safer because you can't
checkout a branch being rebased in another place, or delete it.

Special case for checkout. If the current branch is being rebased,
git-rebase.sh may use "git checkout" to abort and return back to the
original branch. The updated test in find_shared_symref() will prevent
that and "git rebase --abort" will fail as a result.
find_shared_symref() and die_if_checked_out() have to learn a new
option ignore_current_worktree to loosen the test a bit.

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: avoid referencing to worktrees[i] multiple times</title>
<updated>2016-04-22T21:09:38Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2016-04-22T13:01:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c8717148d02c48340ffd6a01ca52c31fa374bf3c'/>
<id>urn:sha1:c8717148d02c48340ffd6a01ca52c31fa374bf3c</id>
<content type='text'>
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: mark current worktree</title>
<updated>2016-04-22T21:09:38Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2016-04-22T13:01:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=750e8a60d69274acd820f812704c75927d82728e'/>
<id>urn:sha1:750e8a60d69274acd820f812704c75927d82728e</id>
<content type='text'>
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: make find_shared_symref() return struct worktree *</title>
<updated>2016-04-22T21:09:37Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2016-04-22T13:01:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d3b9ac07eb44974bb619d71fc6c81c9f2036b96c'/>
<id>urn:sha1:d3b9ac07eb44974bb619d71fc6c81c9f2036b96c</id>
<content type='text'>
This gives the caller more information and they can answer things like,
"is it the main worktree" or "is it the current worktree". The latter
question is needed for the "checkout a rebase branch" case later.

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: store "id" instead of "git_dir"</title>
<updated>2016-04-22T21:09:37Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2016-04-22T13:01:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=69dfe3b9420eb2a7f479a0a4cad663111af2b1f9'/>
<id>urn:sha1:69dfe3b9420eb2a7f479a0a4cad663111af2b1f9</id>
<content type='text'>
We can reconstruct git_dir from id quite easily. It's a bit hackier to
do the reverse.

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: fix indentation</title>
<updated>2016-01-19T19:22:29Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2016-01-18T11:21:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d4cddd66d7ab620fe449ab01382b27178c908c10'/>
<id>urn:sha1:d4cddd66d7ab620fe449ab01382b27178c908c10</id>
<content type='text'>
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>
