<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/environment.c, branch v2.13.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.13.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.13.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2017-05-15T02:30:00Z</updated>
<entry>
<title>setup_git_env: convert die("BUG") to BUG()</title>
<updated>2017-05-15T02:30:00Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2017-05-13T03:29:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=588a538ae554f61a37d43c972da75d0f7c3ed484'/>
<id>urn:sha1:588a538ae554f61a37d43c972da75d0f7c3ed484</id>
<content type='text'>
Converting to BUG() makes it easier to detect and debug
cases where we hit this assertion. Coupled with a new test
in t1300, this shows that the test suite can detect such
corner cases.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/snprintf-cleanups'</title>
<updated>2017-04-17T06:29:26Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-04-17T06:29:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cb054eb26452e07a3cb34703e1579b97f5c7e6ab'/>
<id>urn:sha1:cb054eb26452e07a3cb34703e1579b97f5c7e6ab</id>
<content type='text'>
Code clean-up.

* jk/snprintf-cleanups:
  daemon: use an argv_array to exec children
  gc: replace local buffer with git_path
  transport-helper: replace checked snprintf with xsnprintf
  convert unchecked snprintf into xsnprintf
  combine-diff: replace malloc/snprintf with xstrfmt
  replace unchecked snprintf calls with heap buffers
  receive-pack: print --pack-header directly into argv array
  name-rev: replace static buffer with strbuf
  create_branch: use xstrfmt for reflog message
  create_branch: move msg setup closer to point of use
  avoid using mksnpath for refs
  avoid using fixed PATH_MAX buffers for refs
  fetch: use heap buffer to format reflog
  tag: use strbuf to format tag header
  diff: avoid fixed-size buffer for patch-ids
  odb_mkstemp: use git_path_buf
  odb_mkstemp: write filename into strbuf
  do not check odb_mkstemp return value for errors
</content>
</entry>
<entry>
<title>Merge branch 'jk/no-looking-at-dotgit-outside-repo-final'</title>
<updated>2017-03-30T21:07:13Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-03-30T21:07:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7a09a61e66e34d936c2cc628170031a754ce6e5f'/>
<id>urn:sha1:7a09a61e66e34d936c2cc628170031a754ce6e5f</id>
<content type='text'>
This is the endgame of the topic to avoid blindly falling back to
".git" when the setup sequence said we are _not_ in Git repository.
A corner case that happens to work right now may be broken by a
call to die("BUG").

* jk/no-looking-at-dotgit-outside-repo-final:
  setup_git_env: avoid blind fall-back to ".git"
</content>
</entry>
<entry>
<title>odb_mkstemp: use git_path_buf</title>
<updated>2017-03-28T22:28:04Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2017-03-28T19:45:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4aa7d75e48250026fce9b496cb5405c269331c31'/>
<id>urn:sha1:4aa7d75e48250026fce9b496cb5405c269331c31</id>
<content type='text'>
Since git_path_buf() is smart enough to replace "objects/"
with the correct object path, we can use it instead of
manually assembling the path. That's slightly shorter, and
will clean up any non-canonical bits in the path.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
</content>
</entry>
<entry>
<title>odb_mkstemp: write filename into strbuf</title>
<updated>2017-03-28T22:28:04Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2017-03-28T19:45:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=594fa9998c41277c579a94657100fa303160aa7e'/>
<id>urn:sha1:594fa9998c41277c579a94657100fa303160aa7e</id>
<content type='text'>
The odb_mkstemp() function expects the caller to provide a
fixed buffer to write the resulting tempfile name into. But
it creates the template using snprintf without checking the
return value. This means we could silently truncate the
filename.

In practice, it's unlikely that the truncation would end in
the template-pattern that mkstemp needs to open the file. So
we'd probably end up failing either way, unless the path was
specially crafted.

The simplest fix would be to notice the truncation and die.
However, we can observe that most callers immediately
xstrdup() the result anyway. So instead, let's switch to
using a strbuf, which is easier for them (and isn't a big
deal for the other 2 callers, who can just strbuf_release
when they're done with it).

Note that many of the callers used static buffers, but this
was purely to avoid putting a large buffer on the stack. We
never passed the static buffers out of the function, so
there's no complicated memory handling we need to change.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/pack-name-cleanups'</title>
<updated>2017-03-21T22:07:17Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-03-21T22:07:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=45cbc37c5f84fadd78cccf6b2ea82a9ef251cdc6'/>
<id>urn:sha1:45cbc37c5f84fadd78cccf6b2ea82a9ef251cdc6</id>
<content type='text'>
Code clean-up.

* jk/pack-name-cleanups:
  index-pack: make pointer-alias fallbacks safer
  replace snprintf with odb_pack_name()
  odb_pack_keep(): stop generating keepfile name
  sha1_file.c: make pack-name helper globally accessible
  move odb_* declarations out of git-compat-util.h
</content>
</entry>
<entry>
<title>odb_pack_keep(): stop generating keepfile name</title>
<updated>2017-03-16T18:17:00Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2017-03-16T14:27:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=eaeefc3276c45ff8f8c24775b7dd93155bef7d48'/>
<id>urn:sha1:eaeefc3276c45ff8f8c24775b7dd93155bef7d48</id>
<content type='text'>
The odb_pack_keep() function generates the name of a .keep
file and opens it. This has two problems:

  1. It requires a fixed-size buffer to create the filename
     and doesn't notice when the result is truncated.

  2. Of the two callers, one sometimes wants to open a
     filename it already has, which makes things awkward (it
     has to do so manually, and skips the leading-directory
     creation).

Instead, let's have odb_pack_keep() just open the file.
Generating the name isn't hard, and a future patch will
switch callers over to odb_pack_name() anyway.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</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://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>refs: add option core.logAllRefUpdates = always</title>
<updated>2017-01-31T18:01:24Z</updated>
<author>
<name>Cornelius Weig</name>
<email>cornelius.weig@tngtech.com</email>
</author>
<published>2017-01-27T10:09:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=341fb28621201c5e6c9d3fee5baf7c532fa8a618'/>
<id>urn:sha1:341fb28621201c5e6c9d3fee5baf7c532fa8a618</id>
<content type='text'>
When core.logallrefupdates is true, we only create a new reflog for refs
that are under certain well-known hierarchies. The reason is that we
know that some hierarchies (like refs/tags) are not meant to change, and
that unknown hierarchies might not want reflogs at all (e.g., a
hypothetical refs/foo might be meant to change often and drop old
history immediately).

However, sometimes it is useful to override this decision and simply log
for all refs, because the safety and audit trail is more important than
the performance implications of keeping the log around.

This patch introduces a new "always" mode for the core.logallrefupdates
option which will log updates to everything under refs/, regardless
where in the hierarchy it is (we still will not log things like
ORIG_HEAD and FETCH_HEAD, which are known to be transient).

Based-on-patch-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Cornelius Weig &lt;cornelius.weig@tngtech.com&gt;
Reviewed-by: Jeff King &lt;peff@peff.net&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://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>
</feed>
