git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git-send-email.perl: Fixed sending of many/huge changes/patches

From
Stefan Agner <stefan@agner.ch>
Date
Oct 1, 2015, 23:43 UTC
Message-ID
<ddfab710e6ee78f6890b92d5b8af3bee@agner.ch>
In-Reply-To
<xmqqr3lf94o2.fsf@gitster.mtv.corp.google.com>
On 2015-09-30 10:51, Junio C Hamano wrote:
Show 32 quoted lines
> Lars Wendler <polynomial-c@gentoo.org> writes:
> 
>> It seems to me that there is a size limit, after cutting down the patch
>> to ~16K, sending started to work. I cut it twice, once by removing lines
>> from the head and once from the bottom, in both cases at the size of
>> around 16K I could send the patch.
>>
>> See also original report:
>> http://permalink.gmane.org/gmane.comp.version-control.git/274569
>>
>> Reported-by: Juston Li <juston.h.li@gmail.com>
>> Tested-by: Markos Chandras <hwoarang@gentoo.org>
>> Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
>> ---
>>  git-send-email.perl | 6 +++++-
>>  1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/git-send-email.perl b/git-send-email.perl
>> index e3ff44b..e907e0ea 100755
>> --- a/git-send-email.perl
>> +++ b/git-send-email.perl
>> @@ -1365,7 +1365,11 @@ Message-Id: $message_id
>>  		$smtp->mail( $raw_from ) or die $smtp->message;
>>  		$smtp->to( @recipients ) or die $smtp->message;
>>  		$smtp->data or die $smtp->message;
>> -		$smtp->datasend("$header\n$message") or die $smtp->message;
>> +		$smtp->datasend("$header\n") or die $smtp->message;
>> +		my @lines = split /^/, $message;
>> +		foreach my $line (@lines) {
>> +			$smtp->datasend("$line") or die $smtp->message;
>> +		}
> 
Hi,
> Thanks.  One and a half comments.
> 
>  * If 16k is the limit, and smtp payload line limit is much much
>    shorter than that, is it sensible to send data line by line?

It was a easy and quick way which popped into my mind. The 16k limit has been evaluated just by trying out some patch sizes, not sure whether that is really right and where that really comes from. I guess before using this as split size one would need to understand what causes that limit actually...

>  * Has this been reported to Net::Cmd::datasend() upstream?
Not by me. I also have to admit that I am not a perl hacker at all...

-- Stefan

> 
>>  		$smtp->dataend() or die $smtp->message;
>>  		$smtp->code =~ /250|200/ or die "Failed to send $subject\n".$smtp->message;
>>  	}
Previous: Junio C HamanoNext: Stefan Agner
Message 4 of 5 in “git-send-email.perl: Fixed sending of many/huge changes/patches”
  1. git-send-email.perl: Fixed sending of many/huge changes/patchesLars Wendler, Sep 30, 2015
  2. Johannes SchindelinSep 30, 2015
  3. Junio C HamanoSep 30, 2015
  4. Stefan AgnerOct 1, 2015
  5. Stefan AgnerNov 24, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.