Message ID | 8a9f4927aab96f2f62e2467e59fb6150d7e931fc.1712367983.git.dsimic@manjaro.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [v4] send-email: make it easy to discern the messages for each patch | expand |
Dragan Simic <dsimic@manjaro.org> writes: > Following the approach of making the produced output more readable, also > emit additional vertical whitespace after the "Send this email [y/n/...]?" > prompt. Hmph. I'd prefer to see you try not to endlessly extend the scope of a topic. By including the above change, the patch no longer is small and focused enough, which was the reason why we said that the "let's move the final newline out of the translatable string" can be done as a "while at it" change. Besides, because of the switch to separator semantics, that hunk lost the reason to exist as part of the "use a blank line between output for each message"---the change no longer is needed to support the feature. Even though it is a good change to have, and it deserves to be justified by its merit alone. The whole thing deserves to be a three-patch series, the first one being a preliminarly "let's move the final newline out of the translatable string" step, followed by "let's have a gap between output for each patch sent out". Perhaps another "even during sending a single patch, we may want extra blank lines when use of editor and other user interation is involved" patch on top. I haven't formed an opinion on that last step, and I do not think I can spend any time to think about that new part of the feature for some time (others can review that part and give their opinion on it, of course, while I'll be working on other topics). It would mean you are adding yet another feature to delay the base improvement to stabilize. You really do not want to do that. In any case, this [v4], as a single ball of wax, is not something I can confidently say "I reviewed this and looks OK". Thanks.
On 2024-04-06 07:40, Junio C Hamano wrote: > Dragan Simic <dsimic@manjaro.org> writes: > >> Following the approach of making the produced output more readable, >> also >> emit additional vertical whitespace after the "Send this email >> [y/n/...]?" >> prompt. > > Hmph. I'd prefer to see you try not to endlessly extend the scope > of a topic. > > By including the above change, the patch no longer is small and > focused enough, which was the reason why we said that the "let's > move the final newline out of the translatable string" can be done > as a "while at it" change. > > Besides, because of the switch to separator semantics, that hunk > lost the reason to exist as part of the "use a blank line between > output for each message"---the change no longer is needed to support > the feature. > > Even though it is a good change to have, and it deserves to be > justified by its merit alone. > > The whole thing deserves to be a three-patch series, the first one > being a preliminarly "let's move the final newline out of the > translatable string" step, followed by "let's have a gap between > output for each patch sent out". Perhaps another "even during > sending a single patch, we may want extra blank lines when use of > editor and other user interation is involved" patch on top. > > I haven't formed an opinion on that last step, and I do not think I > can spend any time to think about that new part of the feature for > some time (others can review that part and give their opinion on it, > of course, while I'll be working on other topics). It would mean > you are adding yet another feature to delay the base improvement to > stabilize. You really do not want to do that. Quite frankly, I think all these changes are small enough and understandable enough to be fine for being squashed into a single patch. See, I love perfection and I'm also kind of a perfectionist, but such an approach can sometimes actually become counterproductive. That's what I usually refer to as being pragmatic, in the sense of making things a bit less perfect but still fine, in the interest of "getting things done", so to speak. I hope it makes sense. However, if you insist I'm also perfectly fine with splitting this patch into a three-patch series. That would make it perfect, there's no doubt about it, but would it be a pragmatic approach, worth the additional time and effort? Perhaps not. > In any case, this [v4], as a single ball of wax, is not something I > can confidently say "I reviewed this and looks OK".
On 2024-04-06 10:56, Dragan Simic wrote: > On 2024-04-06 07:40, Junio C Hamano wrote: >> Dragan Simic <dsimic@manjaro.org> writes: >> >>> Following the approach of making the produced output more readable, >>> also >>> emit additional vertical whitespace after the "Send this email >>> [y/n/...]?" >>> prompt. >> >> Hmph. I'd prefer to see you try not to endlessly extend the scope >> of a topic. >> >> By including the above change, the patch no longer is small and >> focused enough, which was the reason why we said that the "let's >> move the final newline out of the translatable string" can be done >> as a "while at it" change. >> >> Besides, because of the switch to separator semantics, that hunk >> lost the reason to exist as part of the "use a blank line between >> output for each message"---the change no longer is needed to support >> the feature. >> >> Even though it is a good change to have, and it deserves to be >> justified by its merit alone. >> >> The whole thing deserves to be a three-patch series, the first one >> being a preliminarly "let's move the final newline out of the >> translatable string" step, followed by "let's have a gap between >> output for each patch sent out". Perhaps another "even during >> sending a single patch, we may want extra blank lines when use of >> editor and other user interation is involved" patch on top. >> >> I haven't formed an opinion on that last step, and I do not think I >> can spend any time to think about that new part of the feature for >> some time (others can review that part and give their opinion on it, >> of course, while I'll be working on other topics). It would mean >> you are adding yet another feature to delay the base improvement to >> stabilize. You really do not want to do that. > > Quite frankly, I think all these changes are small enough and > understandable enough to be fine for being squashed into a single > patch. See, I love perfection and I'm also kind of a perfectionist, > but such an approach can sometimes actually become counterproductive. > That's what I usually refer to as being pragmatic, in the sense of > making things a bit less perfect but still fine, in the interest > of "getting things done", so to speak. I hope it makes sense. > > However, if you insist I'm also perfectly fine with splitting this > patch into a three-patch series. That would make it perfect, there's > no doubt about it, but would it be a pragmatic approach, worth the > additional time and effort? Perhaps not. After thinking a bit more about it, I agree that splitting this patch into a three-patch series is the right thing to do. As you described it above, changes introduced in some versions of the patch made the original assumptions about squashing the changes together no longer apply. I'll split this patch into three separate patches and send those over. As a note, I think that making the outputs of "git send-mail" more readable is quite important, because we've seen people complaining about the whole process of sending patches to mailing lists. Making the outputs more readable can only help, if you agree. >> In any case, this [v4], as a single ball of wax, is not something I >> can confidently say "I reviewed this and looks OK".
Junio C Hamano <gitster@pobox.com> writes: > The whole thing deserves to be a three-patch series, the first one > being a preliminarly "let's move the final newline out of the > translatable string" step, followed by "let's have a gap between > output for each patch sent out". Perhaps another "even during > sending a single patch, we may want extra blank lines when use of > editor and other user interation is involved" patch on top. Or the latter two could be done in a single patch. I'll have to re-review the thing (if I were the only reviewer of the topic) so doing so would delay the completion of the topic, though.
On 2024-04-06 19:05, Junio C Hamano wrote: > Junio C Hamano <gitster@pobox.com> writes: > >> The whole thing deserves to be a three-patch series, the first one >> being a preliminarly "let's move the final newline out of the >> translatable string" step, followed by "let's have a gap between >> output for each patch sent out". Perhaps another "even during >> sending a single patch, we may want extra blank lines when use of >> editor and other user interation is involved" patch on top. > > Or the latter two could be done in a single patch. I'll have to > re-review the thing (if I were the only reviewer of the topic) so > doing so would delay the completion of the topic, though. Huh, I've already separated this patch into three patches, and IMHO they look nice and make everything less error prone. Would you agree with the three-patch approach, please?
Dragan Simic <dsimic@manjaro.org> writes: > On 2024-04-06 19:05, Junio C Hamano wrote: >> Junio C Hamano <gitster@pobox.com> writes: >> >>> The whole thing deserves to be a three-patch series, the first one >>> being a preliminarly "let's move the final newline out of the >>> translatable string" step, followed by "let's have a gap between >>> output for each patch sent out". Perhaps another "even during >>> sending a single patch, we may want extra blank lines when use of >>> editor and other user interation is involved" patch on top. >> Or the latter two could be done in a single patch. I'll have to >> re-review the thing (if I were the only reviewer of the topic) so >> doing so would delay the completion of the topic, though. > > Huh, I've already separated this patch into three patches, and IMHO > they look nice and make everything less error prone. Would you agree > with the three-patch approach, please? My "or the latter two could be done in a single patch" was "alternatively you can", so either way is fine as long as the result is well structured. I know how to explain "insert a gap between patches" well. I do not know which one is easier to explain, between (1) now we have "insert a gap between patches" with patch [2/3], but when editor invocation and confirmation prompts are involved, there are these three cases where we want to tweak the logic to show gaps. Here in patch [3/3] I explain how each of these three affect the logic from the previous step. or (2) We want to insert a gap before showing the second and subsequent patches, unless in such and such cases. We also want to insert a gap when we do this and that. We do all of these in this patch [2/2]. So doing it in three-patches results in a series easier to understand by readers, by all means, please do. Thanks.
Hello Junio, On 2024-04-08 18:01, Junio C Hamano wrote: > Dragan Simic <dsimic@manjaro.org> writes: > >> On 2024-04-06 19:05, Junio C Hamano wrote: >>> Junio C Hamano <gitster@pobox.com> writes: >>> >>>> The whole thing deserves to be a three-patch series, the first one >>>> being a preliminarly "let's move the final newline out of the >>>> translatable string" step, followed by "let's have a gap between >>>> output for each patch sent out". Perhaps another "even during >>>> sending a single patch, we may want extra blank lines when use of >>>> editor and other user interation is involved" patch on top. >>> Or the latter two could be done in a single patch. I'll have to >>> re-review the thing (if I were the only reviewer of the topic) so >>> doing so would delay the completion of the topic, though. >> >> Huh, I've already separated this patch into three patches, and IMHO >> they look nice and make everything less error prone. Would you agree >> with the three-patch approach, please? > > My "or the latter two could be done in a single patch" was > "alternatively you can", so either way is fine as long as the result > is well structured. Great, thanks. I really appreciate your highly detailed approach to reviewing the patches. > I know how to explain "insert a gap between > patches" well. I do not know which one is easier to explain, > between > > (1) now we have "insert a gap between patches" with patch [2/3], > but when editor invocation and confirmation prompts are > involved, there are these three cases where we want to tweak > the logic to show gaps. Here in patch [3/3] I explain how each > of these three affect the logic from the previous step. In my opinion, the insertion of vertical whitespace can also be seen rather independently when it comes to separating the patches, and separating the prompts from the patches. > (2) We want to insert a gap before showing the second and > subsequent patches, unless in such and such cases. We also > want to insert a gap when we do this and that. We do all of > these in this patch [2/2]. > > So doing it in three-patches results in a series easier to > understand by readers, by all means, please do. As I mentioned above, the rather independent nature of the insertion of the two "classes" of vertical whitespace makes the three-patch approach look more suitable to me. I think it's also a better option if some regression is discovered later, because the patches can be applied and tested separately. I already went ahead and submitted the three-patch series, [1] please have a look. I hope you'll like it. [1] https://lore.kernel.org/git/cover.1712486910.git.dsimic@manjaro.org/T/#u
diff --git a/git-send-email.perl b/git-send-email.perl index 821b2b3a135a..a09bc7fd6b96 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -212,6 +212,7 @@ sub format_2822_time { my $compose_filename; my $force = 0; my $dump_aliases = 0; +my $needs_separator = 0; # Variables to prevent short format-patch options from being captured # as abbreviated send-email options @@ -1361,7 +1362,6 @@ sub smtp_host_string { # Returns 1 if authentication succeeded or was not necessary # (smtp_user was not specified), and 0 otherwise. - sub smtp_auth_maybe { if (!defined $smtp_authuser || $auth || (defined $smtp_auth && $smtp_auth eq "none")) { return 1; @@ -1510,6 +1510,7 @@ sub gen_header { sub send_message { my ($recipients_ref, $to, $date, $gitversion, $cc, $ccline, $header) = gen_header(); my @recipients = @$recipients_ref; + my $prompt_separator = 0; my @sendmail_parameters = ('-i', @recipients); my $raw_from = $sender; @@ -1554,7 +1555,11 @@ sub send_message { exit(0); } elsif (/^a/i) { $confirm = 'never'; + $needs_separator = 1; } + $prompt_separator = 1; + } else { + $needs_separator = 1; } unshift (@sendmail_parameters, @smtp_server_options); @@ -1576,7 +1581,6 @@ sub send_message { print $sm "$header\n$message"; close $sm or die $!; } else { - if (!defined $smtp_server) { die __("The required SMTP server is not properly defined.") } @@ -1663,6 +1667,7 @@ sub send_message { $smtp->dataend() or die $smtp->message; $smtp->code =~ /250|200/ or die sprintf(__("Failed to send %s\n"), $subject).$smtp->message; } + print "\n" if ($prompt_separator); if ($quiet) { printf($dry_run ? __("Dry-Sent %s\n") : __("Sent %s\n"), $subject); } else { @@ -1686,10 +1691,11 @@ sub send_message { print $header, "\n"; if ($smtp) { print __("Result: "), $smtp->code, ' ', - ($smtp->message =~ /\n([^\n]+\n)$/s), "\n"; + ($smtp->message =~ /\n([^\n]+\n)$/s); } else { - print __("Result: OK\n"); + print __("Result: OK"); } + print "\n"; } return 1; @@ -1920,7 +1926,8 @@ sub pre_process_file { sub process_file { my ($t) = @_; - pre_process_file($t, $quiet); + pre_process_file($t, $quiet); + print "\n" if ($needs_separator); my $message_was_sent = send_message(); if ($message_was_sent == -1) {