<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin/worktree.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-05T21:31:00Z</updated>
<entry>
<title>i18n: factorize "--foo requires --bar" and the like</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:19Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=6fa00ee843cb6c8e720180b4642590f5bcc9c8cf'/>
<id>urn:sha1:6fa00ee843cb6c8e720180b4642590f5bcc9c8cf</id>
<content type='text'>
They are all replaced by "the option '%s' requires '%s'", which is a
new string but replaces 17 previous unique strings.

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: refactor "%s, %s and %s are mutually exclusive"</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:15Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=c488182903d97da70b7a486e514ab871345067cc'/>
<id>urn:sha1:c488182903d97da70b7a486e514ab871345067cc</id>
<content type='text'>
Use placeholders for constant tokens. The strings are turned into
"cannot be used together"

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: refactor "foo and bar are mutually exclusive"</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:14Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=43ea635c35371b22a7a2010398d47040c5b95adc'/>
<id>urn:sha1:43ea635c35371b22a7a2010398d47040c5b95adc</id>
<content type='text'>
Use static strings for constant parts of the sentences. They are all
turned into "cannot be used together".

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>Merge branch 'es/worktree-chatty-to-stderr'</title>
<updated>2021-12-15T17:39:49Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-12-15T17:39:49Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=986eb34b7165b38cf34229a6f4e43f81b3bd5758'/>
<id>urn:sha1:986eb34b7165b38cf34229a6f4e43f81b3bd5758</id>
<content type='text'>
"git worktree add" showed "Preparing worktree" message to the
standard output stream, but when it failed, the message from die()
went to the standard error stream.  Depending on the order the
stdio streams are flushed at the program end, this resulted in
confusing output.  It has been corrected by sending all the chatty
messages to the standard error stream.

* es/worktree-chatty-to-stderr:
  git-worktree.txt: add missing `-v` to synopsis for `worktree list`
  worktree: send "chatty" messages to stderr
</content>
</entry>
<entry>
<title>worktree: send "chatty" messages to stderr</title>
<updated>2021-12-05T07:27:11Z</updated>
<author>
<name>Eric Sunshine</name>
<email>sunshine@sunshineco.com</email>
</author>
<published>2021-12-03T03:44:19Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=da8fb6be5594b4a06ef2cc2ff7a5363a6fac2b5a'/>
<id>urn:sha1:da8fb6be5594b4a06ef2cc2ff7a5363a6fac2b5a</id>
<content type='text'>
The order in which the stdout and stderr streams are flushed is not
guaranteed to be the same across platforms or `libc` implementations.
This lack of determinism can lead to anomalous and potentially confusing
output if normal (stdout) output is flushed after error (stderr) output.
For instance, the following output which clearly indicates a failure due
to a fatal error:

    % git worktree add ../foo bar
    Preparing worktree (checking out 'bar')
    fatal: 'bar' is already checked out at '.../wherever'

has been reported[1] on Microsoft Windows to appear as:

    % git worktree add ../foo bar
    fatal: 'bar' is already checked out at '.../wherever'
    Preparing worktree (checking out 'bar')

which may confuse the reader into thinking that the command somehow
recovered and ran to completion despite the error.

This problem crops up because the "chatty" status message "Preparing
worktree" is sent to stdout, whereas the "fatal" error message is sent
to stderr. One way to fix this would be to flush stdout manually before
git-worktree reports any errors to stderr.

However, common practice in Git is for "chatty" messages to be sent to
stderr. Therefore, a more appropriate fix is to adjust git-worktree to
conform to that practice by sending its "chatty" messages to stderr
rather than stdout as is currently the case.

There may be concern that relocating messages from stdout to stderr
could break existing tooling, however, these messages are already
internationalized, thus are unstable. And, indeed, the "Preparing
worktree" message has already been the subject of somewhat significant
changes in 2c27002a0a (worktree: improve message when creating a new
worktree, 2018-04-24). Moreover, there is existing precedent, such as
68b939b2f0 (clone: send diagnostic messages to stderr, 2013-09-18) which
likewise relocated "chatty" messages from stdout to stderr for
git-clone.

[1]: https://lore.kernel.org/git/CA+34VNLj6VB1kCkA=MfM7TZR+6HgqNi5-UaziAoCXacSVkch4A@mail.gmail.com/T/

Reported-by: Baruch Burstein &lt;bmburstein@gmail.com&gt;
Signed-off-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>run-command API: remove "env" member, always use "env_array"</title>
<updated>2021-11-26T06:15:08Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2021-11-25T22:52:24Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=c7c4bdeccf3e737e6e674cd9f0828922e629ab06'/>
<id>urn:sha1:c7c4bdeccf3e737e6e674cd9f0828922e629ab06</id>
<content type='text'>
Remove the "env" member from "struct child_process" in favor of always
using the "env_array". As with the preceding removal of "argv" in
favor of "args" this gets rid of current and future oddities around
memory management at the API boundary (see the amended API docs).

For some of the conversions we can replace patterns like:

    child.env = env-&gt;v;

With:

    strvec_pushv(&amp;child.env_array, env-&gt;v);

But for others we need to guard the strvec_pushv() with a NULL check,
since we're not passing in the "v" member of a "struct strvec",
e.g. in the case of tmp_objdir_env()'s return value.

Ideally we'd rename the "env_array" member to simply "env" as a
follow-up, since it and "args" are now inconsistent in not having an
"_array" suffix, and seemingly without any good reason, unless we look
at the history of how they came to be.

But as we've currently got 122 in-tree hits for a "git grep env_array"
let's leave that for now (and possibly forever). Doing that rename
would be too disruptive.

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>worktree: stop being overly intimate with run_command() internals</title>
<updated>2021-11-26T06:15:07Z</updated>
<author>
<name>Eric Sunshine</name>
<email>sunshine@sunshineco.com</email>
</author>
<published>2021-11-25T22:52:16Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=33c997a411b14b0ac54452d79c6951cbf109475c'/>
<id>urn:sha1:33c997a411b14b0ac54452d79c6951cbf109475c</id>
<content type='text'>
add_worktree() reuses a `child_process` for three run_command()
invocations, but to do so, it has overly-intimate knowledge of
run-command.c internals. In particular, it knows that it must reset
child_process::argv to NULL for each subsequent invocation[*] in order
for start_command() to latch the newly-populated child_process::args for
each invocation, even though this behavior is not a part of the
documented API. Beyond having overly-intimate knowledge of run-command.c
internals, the reuse of one `child_process` for three run_command()
invocations smells like an unnecessary micro-optimization. Therefore,
stop sharing one `child_process` and instead use a new one for each
run_command() call.

[*] If child_process::argv is not reset to NULL, then subsequent
run_command() invocations will instead incorrectly access a dangling
pointer to freed memory which had been allocated by child_process::args
on the previous run. This is due to the following code in
start_command():

    if (!cmd-&gt;argv)
        cmd-&gt;argv = cmd-&gt;args.v;

Signed-off-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
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>hook.[ch]: move find_hook() from run-command.c to hook.c</title>
<updated>2021-09-27T16:44:54Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2021-09-26T19:03:26Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=5e3aba33da26803e48b0099c9dabfd327f7f8b8b'/>
<id>urn:sha1:5e3aba33da26803e48b0099c9dabfd327f7f8b8b</id>
<content type='text'>
Move the find_hook() function from run-command.c to a new hook.c
library. This change establishes a stub library that's pretty
pointless right now, but will see much wider use with Emily Shaffer's
upcoming "configuration-based hooks" series.

Eventually all the hook related code will live in hook.[ch]. Let's
start that process by moving the simple find_hook() function over
as-is.

Signed-off-by: Emily Shaffer &lt;emilyshaffer@google.com&gt;
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>worktree: teach `add` to accept --reason &lt;string&gt; with --lock</title>
<updated>2021-07-15T20:30:59Z</updated>
<author>
<name>Stephen Manz</name>
<email>smanz@alum.mit.edu</email>
</author>
<published>2021-07-15T02:32:30Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=0db4961c49bb70cef89ed3d7c90f8f5d9dfc822d'/>
<id>urn:sha1:0db4961c49bb70cef89ed3d7c90f8f5d9dfc822d</id>
<content type='text'>
The default reason stored in the lock file, "added with --lock",
is unlikely to be what the user would have given in a separate
`git worktree lock` command. Allowing `--reason` to be specified
along with `--lock` when adding a working tree gives the user control
over the reason for locking without needing a second command.

Signed-off-by: Stephen Manz &lt;smanz@alum.mit.edu&gt;
Reviewed-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>worktree: mark lock strings with `_()` for translation</title>
<updated>2021-07-14T16:29:59Z</updated>
<author>
<name>Stephen Manz</name>
<email>smanz@alum.mit.edu</email>
</author>
<published>2021-07-11T00:27:19Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=f7c35ea2a1292d581ca79d395fc978f92a3aec5b'/>
<id>urn:sha1:f7c35ea2a1292d581ca79d395fc978f92a3aec5b</id>
<content type='text'>
- default lock string, "added with --lock"
- temporary lock string, "initializing"

Signed-off-by: Stephen Manz &lt;smanz@alum.mit.edu&gt;
Reviewed-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
