<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/git-send-email.perl, 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>2021-10-28T16:06:15Z</updated>
<entry>
<title>send-email docs: add format-patch options</title>
<updated>2021-10-28T16:06:15Z</updated>
<author>
<name>Thiago Perrotta</name>
<email>tbperrotta@gmail.com</email>
</author>
<published>2021-10-25T21:27:07Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=a2ce60824481de986a56b8ea77b0a80fc342aef1'/>
<id>urn:sha1:a2ce60824481de986a56b8ea77b0a80fc342aef1</id>
<content type='text'>
git-send-email(1) does not mention that "git format-patch" options are
accepted. Augment SYNOPSIS and DESCRIPTION to mention it.

Update git-send-email.perl USAGE to be consistent with
git-send-email(1).

Signed-off-by: Thiago Perrotta &lt;tbperrotta@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>send-email: programmatically generate bash completions</title>
<updated>2021-10-28T16:04:24Z</updated>
<author>
<name>Thiago Perrotta</name>
<email>tbperrotta@gmail.com</email>
</author>
<published>2021-10-25T21:27:06Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=2b7b75850c6cffba3f33ce99e23bd05f95640e3f'/>
<id>urn:sha1:2b7b75850c6cffba3f33ce99e23bd05f95640e3f</id>
<content type='text'>
"git send-email --git-completion-helper" only prints "format-patch"
flags. Make it print "send-email" flags as well, extracting them
programmatically from its three existing "GetOptions".

Introduce a "uniq" subroutine, otherwise --cc-cover, --to-cover and
other flags would show up twice. In addition, deduplicate flags common
to both "send-email" and "format-patch", like --from.

Remove extraneous flags: --h and --git-completion-helper.

Add trailing "=" to options that expect an argument, inline with
the format-patch implementation.

Add a completion test for "send-email --validate", a send-email flag.

Signed-off-by: Thiago Perrotta &lt;tbperrotta@gmail.com&gt;
Based-on-patch-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 'ab/send-email-config-fix'</title>
<updated>2021-09-15T20:15:24Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-09-15T20:15:24Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=10de757a09414a06739478c687ea6a24234c8ee8'/>
<id>urn:sha1:10de757a09414a06739478c687ea6a24234c8ee8</id>
<content type='text'>
Regression fix.

* ab/send-email-config-fix:
  send-email: fix a "first config key wins" regression in v2.33.0
</content>
</entry>
<entry>
<title>Merge branch 'mh/send-email-reset-in-reply-to'</title>
<updated>2021-09-10T18:46:25Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-09-10T18:46:25Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=bd29bcf9136c6cb96dba3bb79c532b3b215fb9d8'/>
<id>urn:sha1:bd29bcf9136c6cb96dba3bb79c532b3b215fb9d8</id>
<content type='text'>
Even when running "git send-email" without its own threaded
discussion support, a threading related header in one message is
carried over to the subsequent message to result in an unwanted
threading, which has been corrected.

* mh/send-email-reset-in-reply-to:
  send-email: avoid incorrect header propagation
</content>
</entry>
<entry>
<title>send-email: fix a "first config key wins" regression in v2.33.0</title>
<updated>2021-09-07T20:18:55Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2021-09-06T07:33:29Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=b996f84989f78c8f6d2429b5f0b9785e13f7af23'/>
<id>urn:sha1:b996f84989f78c8f6d2429b5f0b9785e13f7af23</id>
<content type='text'>
Fix a regression in my c95e3a3f0b8 (send-email: move trivial config
handling to Perl, 2021-05-28) where we'd pick the first config key out
of multiple defined ones, instead of using the normal "last key wins"
semantics of "git config --get".

This broke e.g. cases where a .git/config would have a different
sendemail.smtpServer than ~/.gitconfig. We'd pick the ~/.gitconfig
over .git/config, instead of preferring the repository-local
version. The same would go for /etc/gitconfig etc.

The full list of impacted config keys (the %config_settings values
which are references to scalars, not arrays) is:

    sendemail.smtpencryption
    sendemail.smtpserver
    sendemail.smtpserverport
    sendemail.smtpuser
    sendemail.smtppass
    sendemail.smtpdomain
    sendemail.smtpauth
    sendemail.smtpbatchsize
    sendemail.smtprelogindelay
    sendemail.tocmd
    sendemail.cccmd
    sendemail.aliasfiletype
    sendemail.envelopesender
    sendemail.confirm
    sendemail.from
    sendemail.assume8bitencoding
    sendemail.composeencoding
    sendemail.transferencoding
    sendemail.sendmailcmd

I.e. having any of these set in say ~/.gitconfig and in-repo
.git/config regressed in v2.33.0 to prefer the --global one over the
--local.

To test this add a test of config priority to one of these config
variables, most don't have tests at all, but there was an existing one
for sendemail.8bitEncoding.

The "git config" (instead of "test_config") is somewhat of an
anti-pattern, but follows established conventions in
t9001-send-email.sh, likewise with any other pattern or idiom in this
test.

The populating of home/.gitconfig and setting of HOME= is copied from
a test in t0017-env-helper.sh added in 1ff750b128e (tests: make
GIT_TEST_GETTEXT_POISON a boolean, 2019-06-21). This test fails
without this bugfix, but now it works.

Reported-by: Eli Schwartz &lt;eschwartz@archlinux.org&gt;
Tested-by: Eli Schwartz &lt;eschwartz@archlinux.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>send-email: avoid incorrect header propagation</title>
<updated>2021-08-30T20:25:28Z</updated>
<author>
<name>Marvin Häuser</name>
<email>mhaeuser@posteo.de</email>
</author>
<published>2021-08-30T15:30:01Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=e0821134846b10952efc0737b9e32ca8226f0a4d'/>
<id>urn:sha1:e0821134846b10952efc0737b9e32ca8226f0a4d</id>
<content type='text'>
If multiple independent patches are sent with send-email, even if the
"In-Reply-To" and "References" headers are not managed by --thread or
--in-reply-to, their values may be propagated from prior patches to
subsequent patches with no such headers defined.

To mitigate this and potential future issues, make sure all global
patch-specific variables are always either handled by
command-specific code (e.g. threading), or are reset to their default
values for every iteration.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Marvin Häuser &lt;mhaeuser@posteo.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ab/send-email-optim'</title>
<updated>2021-07-22T20:05:54Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-07-22T20:05:54Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=8de2e2e41b23c466793a67966d20bad67b1263cd'/>
<id>urn:sha1:8de2e2e41b23c466793a67966d20bad67b1263cd</id>
<content type='text'>
"git send-email" optimization.

* ab/send-email-optim:
  perl: nano-optimize by replacing Cwd::cwd() with Cwd::getcwd()
  send-email: move trivial config handling to Perl
  perl: lazily load some common Git.pm setup code
  send-email: lazily load modules for a big speedup
  send-email: get rid of indirect object syntax
  send-email: use function syntax instead of barewords
  send-email: lazily shell out to "git var"
  send-email: lazily load config for a big speedup
  send-email: copy "config_regxp" into git-send-email.perl
  send-email: refactor sendemail.smtpencryption config parsing
  send-email: remove non-working support for "sendemail.smtpssl"
  send-email tests: test for boolean variables without a value
  send-email tests: support GIT_TEST_PERL_FATAL_WARNINGS=true
</content>
</entry>
<entry>
<title>Merge branch 'ga/send-email-sendmail-cmd'</title>
<updated>2021-06-14T04:33:26Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-06-14T04:33:26Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=135997254a87f527bc7b29fa1803d9e0da517551'/>
<id>urn:sha1:135997254a87f527bc7b29fa1803d9e0da517551</id>
<content type='text'>
"git send-email" learned the "--sendmail-cmd" command line option
and the "sendemail.sendmailCmd" configuration variable, which is a
more sensible approach than the current way of repurposing the
"smtp-server" that is meant to name the server to instead name the
command to talk to the server.

* ga/send-email-sendmail-cmd:
  git-send-email: add option to specify sendmail command
</content>
</entry>
<entry>
<title>send-email: move trivial config handling to Perl</title>
<updated>2021-05-28T09:38:07Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2021-05-28T09:23:51Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=c95e3a3f0b8107b5dc7eac9dfdb9e5238280c9fb'/>
<id>urn:sha1:c95e3a3f0b8107b5dc7eac9dfdb9e5238280c9fb</id>
<content type='text'>
Optimize the startup time of git-send-email by using an amended
config_regexp() function to retrieve the list of config keys and
values we're interested in.

For boolean keys we can handle the [true|false] case ourselves, and
the "--get" case didn't need any parsing. Let's leave "--path" and
other "--bool" cases to "git config". I'm not bothering with the
"undef" or "" case (true and false, respectively), let's just punt on
those and others and have "git config --type=bool" handle it.

The "grep { defined } @values" here covers a rather subtle case. For
list values such as sendemail.to it is possible as with any other
config key to provide a plain "-c sendemail.to", i.e. to set the key
as a boolean true. In that case the Git::config() API will return an
empty string, but this new parser will correctly return "undef".

However, that means we can end up with "undef" in the middle of a
list. E.g. for sendemail.smtpserveroption in conjuction with
sendemail.smtpserver as a path this would have produce a warning. For
most of the other keys we'd behave the same despite the subtle change
in the value, e.g. sendemail.to would behave the same because
Mail::Address-&gt;parse() happens to return an empty list if fed
"undef". For the boolean values we were already prepared to handle
these variables being initialized as undef anyway.

This brings the runtime of "git send-email" from ~60-~70ms to a very
steady ~40ms on my test box. We now run just one "git config"
invocation on startup instead of 8, the exact number will differ based
on the local sendemail.* config. I happen to have 8 of those set.

This brings the runtime of t9001-send-email.sh from ~13s down to ~12s
for me. The change there is less impressive as many of those tests set
various config values, and we're also getting to the point of
diminishing returns for optimizing "git send-email" 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>perl: nano-optimize by replacing Cwd::cwd() with Cwd::getcwd()</title>
<updated>2021-05-28T09:38:07Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2021-05-28T09:23:52Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=17530b2ed2eac62706b8bbbcf93f62866f651ffd'/>
<id>urn:sha1:17530b2ed2eac62706b8bbbcf93f62866f651ffd</id>
<content type='text'>
It has been pointed out[1] that cwd() invokes "pwd(1)" while getcwd()
is a Perl-native XS function. For what we're using these for we can
use getcwd().

The performance difference is miniscule, we're saving on the order of
a millisecond or so, see [2] below for the benchmark. I don't think
this matters in practice for optimizing git-send-email or perl
execution (unlike the patches leading up to this one).

But let's do it regardless of that, if only so we don't have to think
about this as a low-hanging fruit anymore.

1. https://lore.kernel.org/git/20210512180517.GA11354@dcvr/
2.
    $ perl -MBenchmark=:all -MCwd -wE 'cmpthese(10000, { getcwd =&gt; sub { getcwd }, cwd =&gt; sub { cwd }, pwd =&gt; sub { system "pwd &gt;/dev/null" }})'
                (warning: too few iterations for a reliable count)
                             Rate                  pwd                 cwd    getcwd
    pwd                     982/s                   --                -48%     -100%
    cwd                    1890/s                  92%                  --     -100%
    getcwd 10000000000000000000/s 1018000000000000000% 529000000000000064%        -

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>
</feed>
