<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/git-send-email.perl, branch v2.41.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.41.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.41.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2024-05-24T23:57:02Z</updated>
<entry>
<title>Merge branch 'fixes/2.45.1/2.40' into fixes/2.45.1/2.41</title>
<updated>2024-05-24T23:57:02Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-05-24T23:57:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4f215d214f15b1dbecd9816aea740b0df37b3fa5'/>
<id>urn:sha1:4f215d214f15b1dbecd9816aea740b0df37b3fa5</id>
<content type='text'>
* fixes/2.45.1/2.40:
  Revert "fsck: warn about symlink pointing inside a gitdir"
  Revert "Add a helper function to compare file contents"
  clone: drop the protections where hooks aren't run
  tests: verify that `clone -c core.hooksPath=/dev/null` works again
  Revert "core.hooksPath: add some protection while cloning"
  init: use the correct path of the templates directory again
  hook: plug a new memory leak
  ci: stop installing "gcc-13" for osx-gcc
  ci: avoid bare "gcc" for osx-gcc job
  ci: drop mention of BREW_INSTALL_PACKAGES variable
  send-email: avoid creating more than one Term::ReadLine object
  send-email: drop FakeTerm hack
</content>
</entry>
<entry>
<title>Merge branch 'jc/fix-2.45.1-and-friends-for-2.39' into fixes/2.45.1/2.40</title>
<updated>2024-05-24T19:29:36Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-05-24T19:29:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=48440f60a730b93b2a39449a69cb56db5e7114c7'/>
<id>urn:sha1:48440f60a730b93b2a39449a69cb56db5e7114c7</id>
<content type='text'>
Revert overly aggressive "layered defence" that went into 2.45.1
and friends, which broke "git-lfs", "git-annex", and other use
cases, so that we can rebuild necessary counterparts in the open.

* jc/fix-2.45.1-and-friends-for-2.39:
  Revert "fsck: warn about symlink pointing inside a gitdir"
  Revert "Add a helper function to compare file contents"
  clone: drop the protections where hooks aren't run
  tests: verify that `clone -c core.hooksPath=/dev/null` works again
  Revert "core.hooksPath: add some protection while cloning"
  init: use the correct path of the templates directory again
  hook: plug a new memory leak
  ci: stop installing "gcc-13" for osx-gcc
  ci: avoid bare "gcc" for osx-gcc job
  ci: drop mention of BREW_INSTALL_PACKAGES variable
  send-email: avoid creating more than one Term::ReadLine object
  send-email: drop FakeTerm hack
</content>
</entry>
<entry>
<title>send-email: avoid creating more than one Term::ReadLine object</title>
<updated>2024-05-21T19:33:07Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2023-08-08T18:15:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d11c51eec8a77e7f9af214b0d0c0e1d1ff951883'/>
<id>urn:sha1:d11c51eec8a77e7f9af214b0d0c0e1d1ff951883</id>
<content type='text'>
Every time git-send-email calls its ask() function to prompt the user,
we call term(), which instantiates a new Term::ReadLine object. But in
v1.46 of Term::ReadLine::Gnu (which provides the Term::ReadLine
interface on some platforms), its constructor refuses to create a second
instance[1]. So on systems with that version of the module, most
git-send-email instances will fail (as we usually prompt for both "to"
and "in-reply-to" unless the user provided them on the command line).

We can fix this by keeping a single instance variable and returning it
for each call to term(). In perl 5.10 and up, we could do that with a
"state" variable. But since we only require 5.008, we'll do it the
old-fashioned way, with a lexical "my" in its own scope.

Note that the tests in t9001 detect this problem as-is, since the
failure mode is for the program to die. But let's also beef up the
"Prompting works" test to check that it correctly handles multiple
inputs (if we had chosen to keep our FakeTerm hack in the previous
commit, then the failure mode would be incorrectly ignoring prompts
after the first).

[1] For discussion of why multiple instances are forbidden, see:
    https://github.com/hirooih/perl-trg/issues/16

[jc: cherry-picked from v2.42.0-rc2~6^2]

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Acked-by: Taylor Blau &lt;me@ttaylorr.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>send-email: drop FakeTerm hack</title>
<updated>2024-05-21T19:33:07Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2023-08-08T18:14:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fde2b4b9bce53445c84155fddeb65e3777f6938f'/>
<id>urn:sha1:fde2b4b9bce53445c84155fddeb65e3777f6938f</id>
<content type='text'>
Back in 280242d1cc (send-email: do not barf when Term::ReadLine does not
like your terminal, 2006-07-02), we added a fallback for when
Term::ReadLine's constructor failed: we'd have a FakeTerm object
instead, which would then die if anybody actually tried to call
readline() on it. Since we instantiated the $term variable at program
startup, we needed this workaround to let the program run in modes when
we did not prompt the user.

But later, in f4dc9432fd (send-email: lazily load modules for a big
speedup, 2021-05-28), we started loading Term::ReadLine lazily only when
ask() is called. So at that point we know we're trying to prompt the
user, and we can just die if ReadLine instantiation fails, rather than
making this fake object to lazily delay showing the error.

This should be OK even if there is no tty (e.g., we're in a cron job),
because Term::ReadLine will return a stub object in that case whose "IN"
and "OUT" functions return undef. And since 5906f54e47 (send-email:
don't attempt to prompt if tty is closed, 2009-03-31), we check for that
case and skip prompting.

And we can be sure that FakeTerm was not kicking in for such a
situation, because it has actually been broken since that commit! It
does not define "IN" or "OUT" methods, so perl would barf with an error.
If FakeTerm was in use, we were neither honoring what 5906f54e47 tried
to do, nor producing the readable message that 280242d1cc intended.

So we're better off just dropping FakeTerm entirely, and letting the
error reported by constructing Term::ReadLine through.

[jc: cherry-picked from v2.42.0-rc2~6^2~1]

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Acked-by: Taylor Blau &lt;me@ttaylorr.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jc/send-email-pre-process-fix'</title>
<updated>2023-05-19T16:27:06Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-05-19T16:27:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b04671b638745ecdad70d3f22e9f5032f41fc26d'/>
<id>urn:sha1:b04671b638745ecdad70d3f22e9f5032f41fc26d</id>
<content type='text'>
When "git send-email" that uses the validate hook is fed a message
without and then with Message-ID, it failed to auto-assign a unique
Message-ID to the former and instead reused the Message-ID from the
latter, which has been corrected.  This was a fix for a recent
regression caught before the release, so no need to mention it in
the release notes.

* jc/send-email-pre-process-fix:
  t9001: mark the script as no longer leak checker clean
  send-email: clear the $message_id after validation
</content>
</entry>
<entry>
<title>send-email: clear the $message_id after validation</title>
<updated>2023-05-17T21:11:38Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-05-17T21:10:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3ece9bf0f9e24909b090cf348d89e8920bd4f82f'/>
<id>urn:sha1:3ece9bf0f9e24909b090cf348d89e8920bd4f82f</id>
<content type='text'>
Recently git-send-email started parsing the same message twice, once
to validate _all_ the message before sending even the first one, and
then after the validation hook is happy and each message gets sent,
to read the contents to find out where to send to etc.

Unfortunately, the effect of reading the messages for validation
lingered even after the validation is done.  Namely $message_id gets
assigned if exists in the input files but the variable is global,
and it is not cleared before pre_process_file runs.  This causes
reading a message without a message-id followed by reading a message
with a message-id to misbehave---the sub reports as if the message
had the same id as the previously written one.

Clear the variable before starting to read the headers in
pre_process_file.

Tested-by: Douglas Anderson &lt;dianders@chromium.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'mc/send-email-header-cmd'</title>
<updated>2023-05-15T20:59:03Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-05-15T20:59:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=64477d20d713fa72b14bb0101f37fb41063f9d99'/>
<id>urn:sha1:64477d20d713fa72b14bb0101f37fb41063f9d99</id>
<content type='text'>
"git send-email" learned "--header-cmd=&lt;cmd&gt;" that can inject
arbitrary e-mail header lines to the outgoing messages.

* mc/send-email-header-cmd:
  send-email: detect empty blank lines in command output
  send-email: add --header-cmd, --no-header-cmd options
  send-email: extract execute_cmd from recipients_cmd
</content>
</entry>
<entry>
<title>Merge branch 'ms/send-email-feed-header-to-validate-hook'</title>
<updated>2023-05-10T17:23:28Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-05-10T17:23:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b6e9521956b752be4c666efedd7b91bdd05f9756'/>
<id>urn:sha1:b6e9521956b752be4c666efedd7b91bdd05f9756</id>
<content type='text'>
"git send-email" learned to give the e-mail headers to the validate
hook by passing an extra argument from the command line.

* ms/send-email-feed-header-to-validate-hook:
  send-email: expose header information to git-send-email's sendemail-validate hook
  send-email: refactor header generation functions
</content>
</entry>
<entry>
<title>send-email: detect empty blank lines in command output</title>
<updated>2023-05-01T15:55:52Z</updated>
<author>
<name>Maxim Cournoyer</name>
<email>maxim.cournoyer@gmail.com</email>
</author>
<published>2023-05-01T14:38:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3a7a18a045cd94a13ed04ef715dcd1b91547a0af'/>
<id>urn:sha1:3a7a18a045cd94a13ed04ef715dcd1b91547a0af</id>
<content type='text'>
The email format does not allow blank lines in headers; detect such
input and report it as malformed and add a test for it.

Signed-off-by: Maxim Cournoyer &lt;maxim.cournoyer@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>send-email: add --header-cmd, --no-header-cmd options</title>
<updated>2023-05-01T15:55:52Z</updated>
<author>
<name>Maxim Cournoyer</name>
<email>maxim.cournoyer@gmail.com</email>
</author>
<published>2023-05-01T14:38:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ba92106e93c66e41af5180ac1b6ad0f959f72bb4'/>
<id>urn:sha1:ba92106e93c66e41af5180ac1b6ad0f959f72bb4</id>
<content type='text'>
Sometimes, adding a header different than CC or TO is desirable; for
example, when using Debbugs, it is best to use 'X-Debbugs-Cc' headers
to keep people in CC; this is an example use case enabled by the new
'--header-cmd' option.

The header unfolding logic is extracted to a subroutine so that it can
be reused; a test is added for coverage.

Signed-off-by: Maxim Cournoyer &lt;maxim.cournoyer@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
