<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/worktree.c, branch v2.12.3</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://www.git.shady.money/git/atom?h=v2.12.3</id>
<link rel='self' href='https://www.git.shady.money/git/atom?h=v2.12.3'/>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/'/>
<updated>2017-03-28T20:52:19Z</updated>
<entry>
<title>Merge branch 'rs/strbuf-add-real-path' into maint</title>
<updated>2017-03-28T20:52:19Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-03-28T20:52:19Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=cd27bc7a0bdb7e62090c503b9e8ab4b4a6bb3d06'/>
<id>urn:sha1:cd27bc7a0bdb7e62090c503b9e8ab4b4a6bb3d06</id>
<content type='text'>
An helper function to make it easier to append the result from
real_path() to a strbuf has been added.

* rs/strbuf-add-real-path:
  strbuf: add strbuf_add_real_path()
  cocci: use ALLOC_ARRAY
</content>
</entry>
<entry>
<title>real_pathdup(): fix callsites that wanted it to die on error</title>
<updated>2017-03-08T22:38:41Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2017-03-08T15:43:40Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=ce83eadd9a2c63db6263df91933da1b1b865d26a'/>
<id>urn:sha1:ce83eadd9a2c63db6263df91933da1b1b865d26a</id>
<content type='text'>
In 4ac9006f832 (real_path: have callers use real_pathdup and
strbuf_realpath, 2016-12-12), we changed the xstrdup(real_path())
pattern to use real_pathdup() directly.

The problem with this change is that real_path() calls
strbuf_realpath() with die_on_error = 1 while real_pathdup() calls
it with die_on_error = 0. Meaning that in cases where real_path()
causes Git to die() with an error message, real_pathdup() is silent
and returns NULL instead.

The callers, however, are ill-prepared for that change, as they expect
the return value to be non-NULL (and otherwise the function died
with an appropriate error message).

Fix this by extending real_pathdup()'s signature to accept the
die_on_error flag and simply pass it through to strbuf_realpath(),
and then adjust all callers after a careful audit whether they would
handle NULLs well.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>cocci: use ALLOC_ARRAY</title>
<updated>2017-02-27T19:02:05Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2017-02-25T10:30:03Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=3f64699ffde6cd2152db2106505a2310601a207f'/>
<id>urn:sha1:3f64699ffde6cd2152db2106505a2310601a207f</id>
<content type='text'>
Add a semantic patch for using ALLOC_ARRAY to allocate arrays and apply
the transformation on the current source tree.  The macro checks for
multiplication overflow and infers the element size automatically; the
result is shorter and safer code.

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>Merge branch 'rs/absolute-pathdup'</title>
<updated>2017-02-02T21:36:55Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-02-02T21:36:55Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=6f1c08bdb75b37ad30103f0f12339780fdc004e2'/>
<id>urn:sha1:6f1c08bdb75b37ad30103f0f12339780fdc004e2</id>
<content type='text'>
Code cleanup.

* rs/absolute-pathdup:
  use absolute_pathdup()
  abspath: add absolute_pathdup()
</content>
</entry>
<entry>
<title>use absolute_pathdup()</title>
<updated>2017-01-27T18:18:15Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2017-01-26T17:54:23Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=0aaad415bcbdd7ccdfbb27eafb2f5926540455fa'/>
<id>urn:sha1:0aaad415bcbdd7ccdfbb27eafb2f5926540455fa</id>
<content type='text'>
Apply the semantic patch for converting callers that duplicate the
result of absolute_path() to call absolute_pathdup() instead, which
avoids an extra string copy to a static buffer.

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>Merge branch 'bw/grep-recurse-submodules'</title>
<updated>2017-01-18T23:12:11Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-01-18T23:12:11Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=55d128ae06b7b82f867961b677984620612a201c'/>
<id>urn:sha1:55d128ae06b7b82f867961b677984620612a201c</id>
<content type='text'>
"git grep" has been taught to optionally recurse into submodules.

* bw/grep-recurse-submodules:
  grep: search history of moved submodules
  grep: enable recurse-submodules to work on &lt;tree&gt; objects
  grep: optionally recurse into submodules
  grep: add submodules as a grep source type
  submodules: load gitmodules file from commit sha1
  submodules: add helper to determine if a submodule is initialized
  submodules: add helper to determine if a submodule is populated
  real_path: canonicalize directory separators in root parts
  real_path: have callers use real_pathdup and strbuf_realpath
  real_path: create real_pathdup
  real_path: convert real_path_internal to strbuf_realpath
  real_path: resolve symlinks by hand
</content>
</entry>
<entry>
<title>worktree: initialize return value for submodule_uses_worktrees</title>
<updated>2016-12-27T21:59:49Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2016-12-27T17:50:13Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=7c4be458b1c7ba81b0cc63d76a144261eb2395be'/>
<id>urn:sha1:7c4be458b1c7ba81b0cc63d76a144261eb2395be</id>
<content type='text'>
When the worktrees directory is empty, the `ret` will be returned
uninitialized. Fix it by initializing the value.

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>real_path: have callers use real_pathdup and strbuf_realpath</title>
<updated>2016-12-12T23:22:32Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2016-12-12T18:16:55Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=4ac9006f832d98ca1f25d956e12f3ff79e0d25bc'/>
<id>urn:sha1:4ac9006f832d98ca1f25d956e12f3ff79e0d25bc</id>
<content type='text'>
Migrate callers of real_path() who duplicate the retern value to use
real_pathdup or strbuf_realpath.

Signed-off-by: Brandon Williams &lt;bmwill@google.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://www.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://www.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>
</feed>
