mbox series

[0/2] give range-diff at the end of single patch output

Message ID 20240523225007.2871766-1-gitster@pobox.com (mailing list archive)
Headers show
Series give range-diff at the end of single patch output | expand

Message

Junio C Hamano May 23, 2024, 10:50 p.m. UTC
When running "format-patch" on a multiple patch series, the output
coming from "--interdiff" and "--range-diff" options is inserted
after the "shortlog" list of commits and the overall diffstat.

The idea is that shortlog/diffstat are shorter and with denser
information content, which gives a better overview before the
readers dive into more details of range/inter diff.

When working on a single patch, however, we stuff the inter/range
diff output before the actual patch, next to the diffstat.  This
pushes down the patch text way down with inter/range diff output,
distracting readers.

Move the inter/range diff output to the very end of the output,
after all the patch text is shown.

The first patch is a no-op refactoring, the second patch makes the
actual behaviour change.

Junio C Hamano (2):
  show_log: factor out interdiff/range-diff generation
  format-patch: move range/inter diff at the end of a single patch
    output

 log-tree.c              | 89 ++++++++++++++++++++++-------------------
 t/t4014-format-patch.sh | 17 +++++---
 2 files changed, 59 insertions(+), 47 deletions(-)

Comments

Dragan Simic May 23, 2024, 11:22 p.m. UTC | #1
On 2024-05-24 00:50, Junio C Hamano wrote:
> When running "format-patch" on a multiple patch series, the output
> coming from "--interdiff" and "--range-diff" options is inserted
> after the "shortlog" list of commits and the overall diffstat.
> 
> The idea is that shortlog/diffstat are shorter and with denser
> information content, which gives a better overview before the
> readers dive into more details of range/inter diff.
> 
> When working on a single patch, however, we stuff the inter/range
> diff output before the actual patch, next to the diffstat.  This
> pushes down the patch text way down with inter/range diff output,
> distracting readers.
> 
> Move the inter/range diff output to the very end of the output,
> after all the patch text is shown.

Hmm...  I think this should be made configurable, with the current
behavior being the default.  Without that, we could easily disrupt
many people's workflows, because the power of "muscle memory" is
often really strong.

If it were just about moving a few lines up or down, making it
configurable wouldn't make much sense, but with moving this large
chunks of text...  It's a different story.
Junio C Hamano May 23, 2024, 11:25 p.m. UTC | #2
Dragan Simic <dsimic@manjaro.org> writes:

> Hmm...  I think this should be made configurable, with the current
> behavior being the default.  Without that, we could easily disrupt
> many people's workflows, because the power of "muscle memory" is
> often really strong.

I would view this more like "Porcelain layers reserve the right to
change the behaviour to suit human-end-user needs, without having to
complicate the system with extra configuration knobs."

But if other people want to do a follow-up patch to cleanly add such
a configuration, I would not object to it.  The main desire of this
patch is *not* to make the option to have range-diff at the end of a
single patch "series" available, but to make that the default.

Thanks.
Dragan Simic May 23, 2024, 11:35 p.m. UTC | #3
On 2024-05-24 01:25, Junio C Hamano wrote:
> Dragan Simic <dsimic@manjaro.org> writes:
> 
>> Hmm...  I think this should be made configurable, with the current
>> behavior being the default.  Without that, we could easily disrupt
>> many people's workflows, because the power of "muscle memory" is
>> often really strong.
> 
> I would view this more like "Porcelain layers reserve the right to
> change the behaviour to suit human-end-user needs, without having to
> complicate the system with extra configuration knobs."
> 
> But if other people want to do a follow-up patch to cleanly add such
> a configuration, I would not object to it.  The main desire of this
> patch is *not* to make the option to have range-diff at the end of a
> single patch "series" available, but to make that the default.

I see.  Personally, I find the range diffs placed _after_ the actual
patches more pleasant, but I'm just concerned about other people that
might not like such an arrangement that much.

To me, a range diff is like an additional description of the actual 
patch,
or like a really long footnote, so to me it makes more sense to put it
at the end of the "document".  Sometimes I don't even want or need to 
look
at that footnote, so not needing to scroll down is another plus.
Junio C Hamano May 24, 2024, 3:56 a.m. UTC | #4
Dragan Simic <dsimic@manjaro.org> writes:

> To me, a range diff is like an additional description of the
> actual patch, or like a really long footnote, so to me it makes
> more sense to put it at the end of the "document".  Sometimes I
> don't even want or need to look at that footnote, so not needing
> to scroll down is another plus.

That apparently makes the three of us, counting Patrick [*].

Personally, for a single-patch "series", I find that interdiff is
often easier to see than the range diff, but that is a separate
story.

[Reference]
 * https://lore.kernel.org/git/Zk7UsJjhY_FV2z8C@tanuki/