<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/setup.c, branch v2.6.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.6.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.6.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2015-09-01T23:31:07Z</updated>
<entry>
<title>Merge branch 'nd/fixup-linked-gitdir'</title>
<updated>2015-09-01T23:31:07Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-09-01T23:31:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=91d54694a4e1da804063ce64b9757d5d3148e6ad'/>
<id>urn:sha1:91d54694a4e1da804063ce64b9757d5d3148e6ad</id>
<content type='text'>
The code in "multiple-worktree" support that attempted to recover
from an inconsistent state updated an incorrect file.

* nd/fixup-linked-gitdir:
  setup: update the right file in multiple checkouts
</content>
</entry>
<entry>
<title>write_file(): drop caller-supplied LF from calls to create a one-liner file</title>
<updated>2015-08-25T19:49:19Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-08-24T20:20:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1f76a10b2d72245332ac41bd79249cb82f3946f0'/>
<id>urn:sha1:1f76a10b2d72245332ac41bd79249cb82f3946f0</id>
<content type='text'>
All of the callsites covered by this change call write_file() or
write_file_gently() to create a one-liner file.  Drop the caller
supplied LF and let these callees to append it as necessary.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>setup: update the right file in multiple checkouts</title>
<updated>2015-08-25T16:39:08Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2015-08-25T10:30:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=82fde87ff3be8d10854df18964e5816417a1d7cf'/>
<id>urn:sha1:82fde87ff3be8d10854df18964e5816417a1d7cf</id>
<content type='text'>
This code is introduced in 23af91d (prune: strategies for linked
checkouts - 2014-11-30), and it's supposed to implement this rule from
that commit's message:

 - linked checkouts are supposed to keep its location in $R/gitdir up
   to date. The use case is auto fixup after a manual checkout move.

Note the name, "$R/gitdir", not "$R/gitfile". Correct the path to be
updated accordingly.

While at there, make sure I/O errors are not silently dropped.

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>write_file(): drop "fatal" parameter</title>
<updated>2015-08-24T20:09:02Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-08-24T20:03:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=12d6ce1dba504dfc5279b8d24da3edb4865c2820'/>
<id>urn:sha1:12d6ce1dba504dfc5279b8d24da3edb4865c2820</id>
<content type='text'>
All callers except three passed 1 for the "fatal" parameter to ask
this function to die upon error, but to a casual reader of the code,
it was not all obvious what that 1 meant.  Instead, split the
function into two based on a common write_file_v() that takes the
flag, introduce write_file_gently() as a new way to attempt creating
a file without dying on error, and make three callers to call it.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ee/clean-remove-dirs'</title>
<updated>2015-08-03T18:01:13Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-08-03T18:01:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=54d673f25d571ac2d8f50b1ccea4a7d69ca8a056'/>
<id>urn:sha1:54d673f25d571ac2d8f50b1ccea4a7d69ca8a056</id>
<content type='text'>
Replace "is this subdirectory a separate repository that should not
be touched?" check "git clean" does by checking if it has .git/HEAD
using the submodule-related code with a more optimized check.

* ee/clean-remove-dirs:
  read_gitfile_gently: fix use-after-free
  clean: improve performance when removing lots of directories
  p7300: add performance tests for clean
  t7300: add tests to document behavior of clean and nested git
  setup: sanity check file size in read_gitfile_gently
  setup: add gentle version of read_gitfile
</content>
</entry>
<entry>
<title>read_gitfile_gently: fix use-after-free</title>
<updated>2015-06-26T16:23:08Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-06-26T09:03:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=38ae8784074852c8e7b651f4f6e44e07466da7e1'/>
<id>urn:sha1:38ae8784074852c8e7b651f4f6e44e07466da7e1</id>
<content type='text'>
The "dir" variable is a pointer into the "buf" array. When
we hit the cleanup_return path, the first thing we do is
free(buf); but one of the error messages prints "dir", which
will access the memory after the free.

We can fix this by reorganizing the error path a little. We
act on the fatal, error-printing conditions first, as they
want to access memory and do not care about freeing. Then we
free any memory, and finally return.

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/die-on-bogus-worktree-late'</title>
<updated>2015-06-16T21:27:06Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-06-16T21:27:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=103b6f9c2b2bbafdbde694f9390fb203f70977f0'/>
<id>urn:sha1:103b6f9c2b2bbafdbde694f9390fb203f70977f0</id>
<content type='text'>
The setup code used to die when core.bare and core.worktree are set
inconsistently, even for commands that do not need working tree.

* jk/die-on-bogus-worktree-late:
  setup_git_directory: delay core.bare/core.worktree errors
</content>
</entry>
<entry>
<title>setup: sanity check file size in read_gitfile_gently</title>
<updated>2015-06-15T20:14:01Z</updated>
<author>
<name>Erik Elfström</name>
<email>erik.elfstrom@gmail.com</email>
</author>
<published>2015-06-15T19:39:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=921bdd96afc17ca055af261066eabdf026cb2195'/>
<id>urn:sha1:921bdd96afc17ca055af261066eabdf026cb2195</id>
<content type='text'>
read_gitfile_gently will allocate a buffer to fit the entire file that
should be read. Add a sanity check of the file size before opening to
avoid allocating a potentially huge amount of memory if we come across
a large file that someone happened to name ".git". The limit is set to
a sufficiently unreasonable size that should never be exceeded by a
genuine .git file.

Signed-off-by: Erik Elfström &lt;erik.elfstrom@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>setup: add gentle version of read_gitfile</title>
<updated>2015-06-09T19:29:22Z</updated>
<author>
<name>Erik Elfström</name>
<email>erik.elfstrom@gmail.com</email>
</author>
<published>2015-06-09T18:24:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a93bedada88dc15b0143708e1cb87c8fe9b9c705'/>
<id>urn:sha1:a93bedada88dc15b0143708e1cb87c8fe9b9c705</id>
<content type='text'>
read_gitfile will die on most error cases. This makes it unsuitable
for speculative calls. Extract the core logic and provide a gentle
version that returns NULL on failure.

The first usecase of the new gentle version will be to probe for
submodules during git clean.

Helped-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Helped-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Erik Elfström &lt;erik.elfstrom@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>setup_git_directory: delay core.bare/core.worktree errors</title>
<updated>2015-05-29T16:27:27Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-05-29T06:49:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fada767463b599951b37bd544379a1d18dcf9370'/>
<id>urn:sha1:fada767463b599951b37bd544379a1d18dcf9370</id>
<content type='text'>
If both core.bare and core.worktree are set, we complain
about the bogus config and die. Dying is good, because it
avoids commands running and doing damage in a potentially
incorrect setup. But dying _there_ is bad, because it means
that commands which do not even care about the work tree
cannot run. This can make repairing the situation harder:

  [setup]
  $ git config core.bare true
  $ git config core.worktree /some/path

  [OK, expected.]
  $ git status
  fatal: core.bare and core.worktree do not make sense

  [Hrm...]
  $ git config --unset core.worktree
  fatal: core.bare and core.worktree do not make sense

  [Nope...]
  $ git config --edit
  fatal: core.bare and core.worktree do not make sense

  [Gaaah.]
  $ git help config
  fatal: core.bare and core.worktree do not make sense

Instead, let's issue a warning about the bogus config when
we notice it (i.e., for all commands), but only die when the
command tries to use the work tree (by calling setup_work_tree).
So we now get:

  $ git status
  warning: core.bare and core.worktree do not make sense
  fatal: unable to set up work tree using invalid config

  $ git config --unset core.worktree
  warning: core.bare and core.worktree do not make sense

We have to update t1510 to accomodate this; it uses
symbolic-ref to check whether the configuration works or
not, but of course that command does not use the working
tree. Instead, we switch it to use `git status`, as it
requires a work-tree, does not need any special setup, and
is read-only (so a failure will not adversely affect further
tests).

In addition, we add a new test that checks the desired
behavior (i.e., that running "git config" with the bogus
config does in fact work).

Reported-by: SZEDER Gábor &lt;szeder@ira.uka.de&gt;
Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
