<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/worktree.c, branch v2.11.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.11.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.11.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2016-11-28T21:18:51Z</updated>
<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>get_worktrees() must return main worktree as first item even on error</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:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a234563a3b329c8513fabbe9d8f9435987f10eb6'/>
<id>urn:sha1:a234563a3b329c8513fabbe9d8f9435987f10eb6</id>
<content type='text'>
This is required by git-worktree.txt, stating that the main worktree is
the first line (especially in --porcelain mode when we can't just change
behavior at will).

There's only one case when get_worktrees() may skip main worktree, when
parse_ref() fails. Update the code so that we keep first item as main
worktree and return something sensible in this case:

 - In user-friendly mode, since we're not constraint by anything,
   returning "(error)" should do the job (we already show "(detached
   HEAD)" which is not machine-friendly). Actually errors should be
   printed on stderr by parse_ref() (*)

 - In plumbing mode, we do not show neither 'bare', 'detached' or
   'branch ...', which is possible by the format description if I read
   it right.

Careful readers may realize that when the local variable "head_ref" in
get_main_worktree() is emptied, add_head_info() will do nothing to
wt-&gt;head_sha1. But that's ok because head_sha1 is zero-ized in the
previous patch.

(*) Well, it does not. But it's supposed to be a stop gap implementation
    until we can reuse refs code to parse "ref: " stuff in HEAD, from
    resolve_refs_unsafe(). Now may be the time since refs refactoring is
    mostly done.

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: zero new 'struct worktree' on allocation</title>
<updated>2016-11-23T16:53:11Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2016-11-22T10:00:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f054996d8370c3213f8c8cbde908545ba6c0f854'/>
<id>urn:sha1:f054996d8370c3213f8c8cbde908545ba6c0f854</id>
<content type='text'>
This keeps things a bit simpler when we add more fields, knowing that
default values are always zero.

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: allow the main brach of a bare repository to be checked out</title>
<updated>2016-10-14T16:58:58Z</updated>
<author>
<name>Dennis Kaarsemaker</name>
<email>dennis@kaarsemaker.net</email>
</author>
<published>2016-10-12T16:41:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=171c646f8c6484cca76933ebe8a6af52df47277d'/>
<id>urn:sha1:171c646f8c6484cca76933ebe8a6af52df47277d</id>
<content type='text'>
In bare repositories, get_worktrees() still returns the main repository,
so git worktree list can show it. ignore it in find_shared_symref so we
can still check out the main branch.

Signed-off-by: Dennis Kaarsemaker &lt;dennis@kaarsemaker.net&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>Merge branch 'nd/worktree-lock'</title>
<updated>2016-07-28T17:34:42Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-07-28T17:34:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2c608e0f7c1f0fb9fb3e42eb737d7b8543e11400'/>
<id>urn:sha1:2c608e0f7c1f0fb9fb3e42eb737d7b8543e11400</id>
<content type='text'>
"git worktree prune" protected worktrees that are marked as
"locked" by creating a file in a known location.  "git worktree"
command learned a dedicated command pair to create and remove such
a file, so that the users do not have to do this with editor.

* nd/worktree-lock:
  worktree.c: find_worktree() search by path suffix
  worktree: add "unlock" command
  worktree: add "lock" command
  worktree.c: add is_worktree_locked()
  worktree.c: add is_main_worktree()
  worktree.c: add find_worktree()
</content>
</entry>
<entry>
<title>Merge branch 'rs/worktree-use-strbuf-absolute-path'</title>
<updated>2016-07-25T21:13:37Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-07-25T21:13:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fc08d2d4add543b88d7e1573cb4be01adedfed00'/>
<id>urn:sha1:fc08d2d4add543b88d7e1573cb4be01adedfed00</id>
<content type='text'>
Code simplification.

* rs/worktree-use-strbuf-absolute-path:
  worktree: use strbuf_add_absolute_path() directly
</content>
</entry>
<entry>
<title>worktree: use strbuf_add_absolute_path() directly</title>
<updated>2016-07-12T22:11:01Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2016-07-09T15:43:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fd2e7dafdeef4e9ba3c023427deb4e21ba5b31a8'/>
<id>urn:sha1:fd2e7dafdeef4e9ba3c023427deb4e21ba5b31a8</id>
<content type='text'>
absolute_path() is a wrapper for strbuf_add_absolute_path().  Call the
latter directly for adding absolute paths to a strbuf.  That's shorter
and avoids an extra string copy.

Signed-off-by: Rene Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>worktree.c: find_worktree() search by path suffix</title>
<updated>2016-07-08T22:31:04Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2016-06-13T12:18:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=080739ba1db7897dde53427937acc011ea98a006'/>
<id>urn:sha1:080739ba1db7897dde53427937acc011ea98a006</id>
<content type='text'>
This allows the user to do something like "worktree lock foo" or
"worktree lock to/foo" instead of "worktree lock /long/path/to/foo" if
it's unambiguous.

With completion support it could be quite convenient. While this base
name search can be done in the same worktree iteration loop, the code is
split into a separate function for clarity.

Suggested-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>Merge branch 'nd/worktree-cleanup-post-head-protection'</title>
<updated>2016-07-06T20:38:11Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-07-06T20:38:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7a738b40f67fc44c2a2c1abcffe474241af3d30e'/>
<id>urn:sha1:7a738b40f67fc44c2a2c1abcffe474241af3d30e</id>
<content type='text'>
Further preparatory clean-up for "worktree" feature continues.

* nd/worktree-cleanup-post-head-protection:
  worktree: simplify prefixing paths
  worktree: avoid 0{40}, too many zeroes, hard to read
  worktree.c: use is_dot_or_dotdot()
  git-worktree.txt: keep subcommand listing in alphabetical order
  worktree.c: rewrite mark_current_worktree() to avoid strbuf
  completion: support git-worktree
</content>
</entry>
</feed>
