<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/perl, branch v2.32.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.32.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.32.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2021-05-27T03:36:57Z</updated>
<entry>
<title>Merge branch 'ab/send-email-inline-hooks-path'</title>
<updated>2021-05-27T03:36:57Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-05-27T03:36:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f4d715b0acaf008d0f09c42378cac90acaadea8e'/>
<id>urn:sha1:f4d715b0acaf008d0f09c42378cac90acaadea8e</id>
<content type='text'>
Code simplification.

* ab/send-email-inline-hooks-path:
  send-email: move "hooks_path" invocation to git-send-email.perl
  send-email: don't needlessly abs_path() the core.hooksPath
</content>
</entry>
<entry>
<title>send-email: move "hooks_path" invocation to git-send-email.perl</title>
<updated>2021-05-27T00:00:59Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2021-05-26T11:21:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7cbc0455cc07702c5eeff1062c7e2a820758714f'/>
<id>urn:sha1:7cbc0455cc07702c5eeff1062c7e2a820758714f</id>
<content type='text'>
Move the newly added "hooks_path" API in Git.pm to its only user in
git-send-email.perl. This was added in c8243933c74 (git-send-email:
Respect core.hooksPath setting, 2021-03-23), meaning that it hasn't
yet made it into a non-rc release of git.

The consensus with Git.pm is that we need to be considerate of
out-of-tree users who treat it as a public documented interface. We
should therefore be less willing to add new functionality to it, least
we be stuck supporting it after our own uses for it disappear.

In this case the git-send-email.perl hook invocation will probably be
replaced by a future "git hook run" command, and in the commit
preceding this one the "hooks_path" become nothing but a trivial
wrapper for "rev-parse --git-path hooks" anyway (with no
Cwd::abs_path() call), so let's just inline this command in
git-send-email.perl itself.

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>send-email: don't needlessly abs_path() the core.hooksPath</title>
<updated>2021-05-27T00:00:57Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2021-05-26T11:21:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2815326f095a1126fe9b099c311fdde8d7b7b591'/>
<id>urn:sha1:2815326f095a1126fe9b099c311fdde8d7b7b591</id>
<content type='text'>
In c8243933c74 (git-send-email: Respect core.hooksPath setting,
2021-03-23) we started supporting core.hooksPath in "send-email". It's
been reported that on Windows[1] doing this by calling abs_path()
results in different canonicalizations of the absolute path.

This wasn't an issue in c8243933c74 itself, but was revealed by my
ea7811b37e0 (git-send-email: improve --validate error output,
2021-04-06) when we started emitting the path to the hook, which was
previously only internal to git-send-email.perl.

The just-landed 53753a37d09 (t9001-send-email.sh: fix expected
absolute paths on Windows, 2021-05-24) narrowly fixed this issue, but
I believe we can do better here. We should not be relying on whatever
changes Perl's abs_path() makes to the path "rev-parse --git-path
hooks" hands to us. Let's instead trust it, and hand it to Perl's
system() in git-send-email.perl. It will handle either a relative or
absolute path.

So let's revert most of 53753a37d09 and just have "hooks_path" return
what we get from "rev-parse" directly without modification. This has
the added benefit of making the error message friendlier in the common
case, we'll no longer print an absolute path for repository-local hook
errors.

1. http://lore.kernel.org/git/bb30fe2b-cd75-4782-24a6-08bb002a0367@kdbg.org

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>perl: use mock i18n functions under NO_GETTEXT=Y</title>
<updated>2021-05-06T03:58:33Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2021-05-05T12:21:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=256c2dc42c812e4868532b88155f60f0a269c821'/>
<id>urn:sha1:256c2dc42c812e4868532b88155f60f0a269c821</id>
<content type='text'>
Change the logic of the i18n functions I added in 5e9637c6297 (i18n:
add infrastructure for translating Git with gettext, 2011-11-18) to
use pass-through functions when NO_GETTEXT is defined.

This speeds up the compilation time of commands that use this library
when NO_GETTEXT=Y is in effect. Loading it and POSIX.pm is around 20ms
on my machine, whereas it takes 2ms to just instantiate perl itself.

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>git-send-email: Respect core.hooksPath setting</title>
<updated>2021-03-23T22:02:52Z</updated>
<author>
<name>Robert Foss</name>
<email>robert.foss@linaro.org</email>
</author>
<published>2021-03-23T17:33:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c8243933c74e0bebcc617f750ae3990ecca47759'/>
<id>urn:sha1:c8243933c74e0bebcc617f750ae3990ecca47759</id>
<content type='text'>
get-send-email currently makes the assumption that the
'sendemail-validate' hook exists inside of the repository.

Since the introduction of 'core.hooksPath' configuration option in
867ad08a261 (hooks: allow customizing where the hook directory is,
2016-05-04), this is no longer true.

Instead of assuming a hardcoded repo relative path, query
git for the actual path of the hooks directory.

Signed-off-by: Robert Foss &lt;robert.foss@linaro.org&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>Merge branch 'jk/perl-warning'</title>
<updated>2020-11-09T22:06:25Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-11-09T22:06:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=65681e75c1e57cb3c575969b4703323e6bdd447f'/>
<id>urn:sha1:65681e75c1e57cb3c575969b4703323e6bdd447f</id>
<content type='text'>
Dev support.

* jk/perl-warning:
  perl: check for perl warnings while running tests
</content>
</entry>
<entry>
<title>Merge branch 'bc/svn-hash-oid-fix'</title>
<updated>2020-11-02T21:17:45Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-11-02T21:17:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=305fcf42b4dde316ba0b2e6433c1e5a1d6ef864f'/>
<id>urn:sha1:305fcf42b4dde316ba0b2e6433c1e5a1d6ef864f</id>
<content type='text'>
A recent oid-&gt;hash conversion missed one spot, breaking "git svn".

* bc/svn-hash-oid-fix:
  svn: use correct variable name for short OID
</content>
</entry>
<entry>
<title>perl: check for perl warnings while running tests</title>
<updated>2020-10-22T06:11:48Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2020-10-22T03:24:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5338ed2b26ebf91de246c59e525ad254dcbc7a84'/>
<id>urn:sha1:5338ed2b26ebf91de246c59e525ad254dcbc7a84</id>
<content type='text'>
We set "use warnings" in most of our perl code to catch problems. But as
the name implies, warnings just emit a message to stderr and don't
otherwise affect the program. So our tests are quite likely to miss that
warnings are being spewed, as most of them do not look at stderr.

We could ask perl to make all warnings fatal, but this is likely
annoying for non-developers, who would rather have a running program
with a warning than something that refuses to work at all.

So instead, let's teach the perl code to respect an environment variable
(GIT_PERL_FATAL_WARNINGS) to increase the severity of the warnings. This
can be set for day-to-day running if people want to be really pedantic,
but the primary use is to trigger it within the test suite.

We could also trigger that for every test run, but likewise even the
tests failing may be annoying to distro builders, etc (just as -Werror
would be for compiling C code). So we'll tie it to a special test-mode
variable (GIT_TEST_PERL_FATAL_WARNINGS) that can be set in the
environment or as a Makefile knob, and we'll automatically turn the knob
when DEVELOPER=1 is set. That should give developers and CI the more
careful view without disrupting normal users or packagers.

Note that the mapping from the GIT_TEST_* form to the GIT_* form in
test-lib.sh is necessary even if they had the same name: the perl
scripts need it to be normalized to a perl truth value, and we also have
to make sure it's exported (we might have gotten it from the
environment, but we might also have gotten it from GIT-BUILD-OPTIONS
directly).

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>svn: use correct variable name for short OID</title>
<updated>2020-10-22T06:03:31Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2020-10-22T01:18:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=03bb366de485e20585b65c48dddb417e0c200f7c'/>
<id>urn:sha1:03bb366de485e20585b65c48dddb417e0c200f7c</id>
<content type='text'>
The commit 9ab33150a0 ("perl: create and switch variables for hash
constants", 2020-06-22) converted each instance of the variable
$sha1_short into $oid_short in the Subversion code, since git-svn now
understands SHA-256.  However, one conversion was missed.

As a result, Perl complains about the use of this variable:

  Use of uninitialized value $sha1_short in regexp compilation at
  /usr/lib64/perl5/vendor_perl/5.30.3/Git/SVN/Log.pm line 301, &lt;$fh&gt;
  line 6.

Because we're parsing raw diff output here, the likelihood is very low
that we'll actually misparse the data, since the only lines we're going
to get starting with colons are the ones we're expecting.  Even if we
had a newline in a path, we'd end up with a quoted path.  Our regex is
just less strict than we'd like it to be.

However, it's obviously undesirable that our code is emitting Perl
warnings, so let's convert it to use the proper variable name.

Reported-by: Nikos Chantziaras &lt;realnc@gmail.com&gt;
Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-send-email: die if sendmail.* config is set</title>
<updated>2020-07-24T01:00:34Z</updated>
<author>
<name>Drew DeVault</name>
<email>sir@cmpwn.com</email>
</author>
<published>2020-07-24T00:44:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dd84e528a34c3822e7ab0473a95e411665b37681'/>
<id>urn:sha1:dd84e528a34c3822e7ab0473a95e411665b37681</id>
<content type='text'>
I've seen several people mis-configure git send-email on their first
attempt because they set the sendmail.* config options - not
sendemail.*. This patch detects this mistake and bails out with a
friendly warning.

Signed-off-by: Drew DeVault &lt;sir@cmpwn.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
