<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin/clone.c, branch gitk-resize-error</title>
<subtitle>Fork of git SCM with my patches.</subtitle>
<id>http://git.kilabit.info/git/atom?h=gitk-resize-error</id>
<link rel='self' href='http://git.kilabit.info/git/atom?h=gitk-resize-error'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/'/>
<updated>2022-01-12T23:11:43Z</updated>
<entry>
<title>Merge branch 'ps/lockfile-cleanup-fix'</title>
<updated>2022-01-12T23:11:43Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-01-12T23:11:43Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=12f82b0dd70aaefdb9363a96403d41d13b97e5b0'/>
<id>urn:sha1:12f82b0dd70aaefdb9363a96403d41d13b97e5b0</id>
<content type='text'>
Some lockfile code called free() in signal-death code path, which
has been corrected.

* ps/lockfile-cleanup-fix:
  fetch: fix deadlock when cleaning up lockfiles in async signals
</content>
</entry>
<entry>
<title>Merge branch 'ja/i18n-similar-messages'</title>
<updated>2022-01-10T19:52:56Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-01-10T19:52:56Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=c17de5a505a2da23fcbfefdc8b0aad3f045a510f'/>
<id>urn:sha1:c17de5a505a2da23fcbfefdc8b0aad3f045a510f</id>
<content type='text'>
Similar message templates have been consolidated so that
translators need to work on fewer number of messages.

* ja/i18n-similar-messages:
  i18n: turn even more messages into "cannot be used together" ones
  i18n: ref-filter: factorize "%(foo) atom used without %(bar) atom"
  i18n: factorize "--foo outside a repository"
  i18n: refactor "unrecognized %(foo) argument" strings
  i18n: factorize "no directory given for --foo"
  i18n: factorize "--foo requires --bar" and the like
  i18n: tag.c factorize i18n strings
  i18n: standardize "cannot open" and "cannot read"
  i18n: turn "options are incompatible" into "cannot be used together"
  i18n: refactor "%s, %s and %s are mutually exclusive"
  i18n: refactor "foo and bar are mutually exclusive"
</content>
</entry>
<entry>
<title>fetch: fix deadlock when cleaning up lockfiles in async signals</title>
<updated>2022-01-07T21:49:19Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2022-01-07T10:55:47Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=58d4d7f1c5a665111f05c61901a11a555703fe11'/>
<id>urn:sha1:58d4d7f1c5a665111f05c61901a11a555703fe11</id>
<content type='text'>
When fetching packfiles, we write a bunch of lockfiles for the packfiles
we're writing into the repository. In order to not leave behind any
cruft in case we exit or receive a signal, we register both an exit
handler as well as signal handlers for common signals like SIGINT. These
handlers will then unlink the locks and free the data structure tracking
them. We have observed a deadlock in this logic though:

    (gdb) bt
    #0  __lll_lock_wait_private () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95
    #1  0x00007f4932bea2cd in _int_free (av=0x7f4932f2eb20 &lt;main_arena&gt;, p=0x3e3e4200, have_lock=0) at malloc.c:3969
    #2  0x00007f4932bee58c in __GI___libc_free (mem=&lt;optimized out&gt;) at malloc.c:2975
    #3  0x0000000000662ab1 in string_list_clear ()
    #4  0x000000000044f5bc in unlock_pack_on_signal ()
    #5  &lt;signal handler called&gt;
    #6  _int_free (av=0x7f4932f2eb20 &lt;main_arena&gt;, p=&lt;optimized out&gt;, have_lock=0) at malloc.c:4024
    #7  0x00007f4932bee58c in __GI___libc_free (mem=&lt;optimized out&gt;) at malloc.c:2975
    #8  0x000000000065afd5 in strbuf_release ()
    #9  0x000000000066ddb9 in delete_tempfile ()
    #10 0x0000000000610d0b in files_transaction_cleanup.isra ()
    #11 0x0000000000611718 in files_transaction_abort ()
    #12 0x000000000060d2ef in ref_transaction_abort ()
    #13 0x000000000060d441 in ref_transaction_prepare ()
    #14 0x000000000060e0b5 in ref_transaction_commit ()
    #15 0x00000000004511c2 in fetch_and_consume_refs ()
    #16 0x000000000045279a in cmd_fetch ()
    #17 0x0000000000407c48 in handle_builtin ()
    #18 0x0000000000408df2 in cmd_main ()
    #19 0x00000000004078b5 in main ()

The process was killed with a signal, which caused the signal handler to
kick in and try free the data structures after we have unlinked the
locks. It then deadlocks while calling free(3P).

The root cause of this is that it is not allowed to call certain
functions in async-signal handlers, as specified by signal-safety(7).
Next to most I/O functions, this list of disallowed functions also
includes memory-handling functions like malloc(3P) and free(3P) because
they may not be reentrant. As a result, if we execute such functions in
the signal handler, then they may operate on inconistent state and fail
in unexpected ways.

Fix this bug by not calling non-async-signal-safe functions when running
in the signal handler. We're about to re-raise the signal anyway and
will thus exit, so it's not much of a problem to keep the string list of
lockfiles untouched. Note that it's fine though to call unlink(2), so
we'll still clean up the lockfiles correctly.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Reviewed-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>i18n: turn even more messages into "cannot be used together" ones</title>
<updated>2022-01-05T21:31:00Z</updated>
<author>
<name>Jean-Noël Avila</name>
<email>jn.avila@free.fr</email>
</author>
<published>2022-01-05T20:02:24Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=246cac85055f513626159e8cd20b741eaf5f9f97'/>
<id>urn:sha1:246cac85055f513626159e8cd20b741eaf5f9f97</id>
<content type='text'>
Even if some of these messages are not subject to gettext i18n, this
helps bring a single style of message for a given error type.

Signed-off-by: Jean-Noël Avila &lt;jn.avila@free.fr&gt;
Reviewed-by: Johannes Sixt &lt;j6t@kdbg.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>i18n: turn "options are incompatible" into "cannot be used together"</title>
<updated>2022-01-05T21:29:23Z</updated>
<author>
<name>Jean-Noël Avila</name>
<email>jn.avila@free.fr</email>
</author>
<published>2022-01-05T20:02:16Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=12909b6b8a4a51e9d2b46610be4f93c782949c80'/>
<id>urn:sha1:12909b6b8a4a51e9d2b46610be4f93c782949c80</id>
<content type='text'>
Signed-off-by: Jean-Noël Avila &lt;jn.avila@free.fr&gt;
Reviewed-by: Johannes Sixt &lt;j6t@kdbg.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>clone: avoid using deprecated `sparse-checkout init`</title>
<updated>2021-12-15T19:48:22Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2021-12-14T04:09:12Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=d35954160a2c00a741e41030ff8449a9ae958439'/>
<id>urn:sha1:d35954160a2c00a741e41030ff8449a9ae958439</id>
<content type='text'>
The previous commits marked `sparse-checkout init` as deprecated; we
can just use `set` instead here and pass it no paths.

Reviewed-by: Derrick Stolee &lt;dstolee@microsoft.com&gt;
Reviewed-by: Victoria Dye &lt;vdye@github.com&gt;
Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>clone: fix a memory leak of the "git_dir" variable</title>
<updated>2021-10-23T17:45:25Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2021-10-22T08:55:42Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=27ff1fbc5dd5ca5f03a65bfc734c913703e8cdf7'/>
<id>urn:sha1:27ff1fbc5dd5ca5f03a65bfc734c913703e8cdf7</id>
<content type='text'>
At this point in cmd_clone the "git_dir" is always either an
xstrdup()'d string, or something we got from mkpathdup(). Let's free()
it before we clobber it.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'en/removing-untracked-fixes'</title>
<updated>2021-10-13T22:15:57Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-10-13T22:15:57Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=a7c2daa06d6f7d8fd13a1d72f23741acbaeba522'/>
<id>urn:sha1:a7c2daa06d6f7d8fd13a1d72f23741acbaeba522</id>
<content type='text'>
Various fixes in code paths that move untracked files away to make room.

* en/removing-untracked-fixes:
  Documentation: call out commands that nuke untracked files/directories
  Comment important codepaths regarding nuking untracked files/dirs
  unpack-trees: avoid nuking untracked dir in way of locally deleted file
  unpack-trees: avoid nuking untracked dir in way of unmerged file
  Change unpack_trees' 'reset' flag into an enum
  Remove ignored files by default when they are in the way
  unpack-trees: make dir an internal-only struct
  unpack-trees: introduce preserve_ignored to unpack_trees_options
  read-tree, merge-recursive: overwrite ignored files by default
  checkout, read-tree: fix leak of unpack_trees_options.dir
  t2500: add various tests for nuking untracked files
</content>
</entry>
<entry>
<title>Merge branch 'jk/clone-unborn-head-in-bare'</title>
<updated>2021-10-04T04:49:17Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-10-04T04:49:17Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=ac162a606b673e44cec602dfe259aae8e5e08554'/>
<id>urn:sha1:ac162a606b673e44cec602dfe259aae8e5e08554</id>
<content type='text'>
"git clone" from a repository whose HEAD is unborn into a bare
repository didn't follow the branch name the other side used, which
is corrected.

* jk/clone-unborn-head-in-bare:
  clone: handle unborn branch in bare repos
</content>
</entry>
<entry>
<title>Remove ignored files by default when they are in the way</title>
<updated>2021-09-27T20:38:37Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2021-09-27T16:33:43Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=1b5f37334a2603c7134da7accba76276d8d31cf6'/>
<id>urn:sha1:1b5f37334a2603c7134da7accba76276d8d31cf6</id>
<content type='text'>
Change several commands to remove ignored files by default when they are
in the way.  Since some commands (checkout, merge) take a
--no-overwrite-ignore option to allow the user to configure this, and it
may make sense to add that option to more commands (and in the case of
merge, actually plumb that configuration option through to more of the
backends than just the fast-forwarding special case), add little
comments about where such flags would be used.

Incidentally, this fixes a test failure in t7112.

Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
