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

[PATCH 0/2] format-patch: pre-2.20 range-diff regression fix

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Nov 22, 2018, 21:12 UTC
Message-ID
<20181122211248.24546-1-avarab@gmail.com>
In-Reply-To
<CAPig+cSzyT5N5=YeX+VgRq1t0VbWqXLHSB=g=V=O-nLdCWrE9g@mail.gmail.com>
[Dropping LKML & git-packagers from CC]
On Thu, Nov 22 2018, Eric Sunshine wrote:
Show 28 quoted lines
> On Thu, Nov 22, 2018 at 10:58 AM Ævar Arnfjörð Bjarmason
> <avarab@gmail.com> wrote:
>> There's a regression related to this that I wanted to send a headsup
>> for, but don't have time to fix today. Now range-diff in format-patch
>> includes --stat output. See e.g. my
>> https://public-inbox.org/git/20181122132823.9883-1-avarab@gmail.com/
>
> Umf. Unfortunate fallout from [1].
>
>> diff --git a/builtin/log.c b/builtin/log.c
>> @@ -1094,9 +1094,12 @@ static void make_cover_letter(struct rev_info *rev, int use_stdout,
>>         if (rev->rdiff1) {
>> +               const int oldfmt = rev->diffopt.output_format;
>>                 fprintf_ln(rev->diffopt.file, "%s", rev->rdiff_title);
>> +               rev->diffopt.output_format &= ~(DIFF_FORMAT_DIFFSTAT | DIFF_FORMAT_SUMMARY);
>>                 show_range_diff(rev->rdiff1, rev->rdiff2,
>>                                 rev->creation_factor, 1, &rev->diffopt);
>> +               rev->diffopt.output_format = oldfmt;
>>         }
>>  }
>
> A few questions/observations:
>
> Does this same "fix" need to be applied to the --interdiff case just
> above this --range-diff block?
>
> Does the same "fix" need to be applied to the --interdiff and
> --range-diff cases in log-tree.c:show_log()?

No, that seems to do the right thing, but perhaps tests are lacking there too. I haven't looked.

> Aside from fixing the broken --no-patches option[2], a goal of the
> series was to some day make --stat do something useful. Doesn't this
> "fix" go against that goal?

The goal was to fix the regression introduced in 73a834e9e2 ("range-diff: relieve callers of low-level configuration burden", 2018-07-22). One aspect of having fixed that is we might in the future do stuff with --stat.

Show 9 quoted lines
> The way this change needs to be spread around at various locations is
> making it feel like a BandAid "fix" rather than a proper solution. It
> seems like it should be fixed at a different level, though I'm not
> sure yet if that level is higher (where the options get set) or lower
> (where they actually affect the operation).
>
> Until we figure out the answers to these questions, I wonder if a more
> sensible short-term solution would be to back out [1] and just keep
> [2], which fixed the --no-patches regression.

I think that patch leaves range-diff itself in a good state without any bugs, and it would be a mistake to revert it.

But this interaction with format-patch --range-diff is another matter. As noted in 2/2 I think in practice this series sweeps the current bugs under the rug.

But as also noted there I think re-using what we get from setup_revisions() in format-patch for the range-diff was a mistake, and is always going to lead to some confusion. It should be split up so we can supply those diff options independently.

> [...]
> [1]: https://public-inbox.org/git/20181113185558.23438-4-avarab@gmail.com/
> [2]: https://public-inbox.org/git/20181113185558.23438-3-avarab@gmail.com/
Ævar Arnfjörð Bjarmason (2):
  format-patch: add a more exhaustive --range-diff test
  format-patch: don't include --stat with --range-diff output
 builtin/log.c         |  7 ++++++-
 t/t3206-range-diff.sh | 15 ++++++++++-----
 2 files changed, 16 insertions(+), 6 deletions(-)
-- 
2.20.0.rc0.387.gc7a69e6b6c
Previous: Eric SunshineNext: Ævar Arnfjörð Bjarmason
Message 4 of 53 in “[ANNOUNCE] Git v2.20.0-rc1”
  1. Junio C HamanoNov 21, 2018
  2. Ævar Arnfjörð BjarmasonNov 22, 2018
  3. Eric SunshineNov 22, 2018
  4. 0/2 format-patch: pre-2.20 range-diff regression fixÆvar Arnfjörð Bjarmason, Nov 22, 2018
  5. 1/2 format-patch: add a more exhaustive --range-diff testÆvar Arnfjörð Bjarmason, Nov 22, 2018
  6. Junio C HamanoNov 24, 2018
  7. Ævar Arnfjörð BjarmasonNov 24, 2018
  8. 2/2 format-patch: don't include --stat with --range-diff outputÆvar Arnfjörð Bjarmason, Nov 22, 2018
  9. Junio C HamanoNov 24, 2018
  10. Junio C HamanoNov 24, 2018
  11. 2/2 format-patch: allow for independent diff & range-diff optionsÆvar Arnfjörð Bjarmason, Nov 28, 2018
  12. Junio C HamanoNov 29, 2018
  13. Johannes SchindelinNov 29, 2018
  14. Ævar Arnfjörð BjarmasonNov 29, 2018
  15. Johannes SchindelinNov 29, 2018
  16. Ævar Arnfjörð BjarmasonNov 29, 2018
  17. Johannes SchindelinNov 29, 2018
  18. Ævar Arnfjörð BjarmasonNov 29, 2018
  19. Johannes SchindelinNov 29, 2018
  20. Junio C HamanoNov 30, 2018
  21. format-patch: do not let its diff-options affect --range-diff (was Re: [PATCH 2/2] format-patch: allow for independent diff & range-diff options)Junio C Hamano, Nov 30, 2018
  22. Junio C HamanoNov 30, 2018
  23. Ævar Arnfjörð BjarmasonNov 30, 2018
  24. Johannes SchindelinNov 30, 2018
  25. Eric SunshineNov 30, 2018
  26. Martin ÅgrenDec 3, 2018
  27. range-diff: always pass at least minimal diff optionsMartin Ågren, Dec 3, 2018
  28. range-diff: always pass at least minimal diff optionsEric Sunshine, Dec 3, 2018
  29. Junio C HamanoDec 4, 2018
  30. Martin ÅgrenDec 4, 2018
  31. Eric SunshineNov 30, 2018
  32. 0/2 format-patch: fix root cause of recent regressionÆvar Arnfjörð Bjarmason, Nov 28, 2018
  33. 1/2 format-patch: add test for --range-diff diff outputÆvar Arnfjörð Bjarmason, Nov 28, 2018
  34. Ævar Arnfjörð BjarmasonNov 24, 2018
  35. Junio C HamanoNov 25, 2018
  36. rebase: mark the C reimplementation as an experimental opt-in feature (was Re: [ANNOUNCE] Git v2.20.0-rc1)Junio C Hamano, Nov 26, 2018
  37. Jonathan NiederNov 28, 2018
  38. Johannes SchindelinNov 28, 2018
  39. Ævar Arnfjörð BjarmasonNov 28, 2018
  40. Junio C HamanoNov 29, 2018
  41. Johannes SchindelinNov 29, 2018
  42. Ian JacksonNov 29, 2018
  43. Johannes SchindelinNov 29, 2018
  44. Ian JacksonNov 29, 2018
  45. Johannes SchindelinNov 29, 2018
  46. Ian JacksonNov 29, 2018
  47. Johannes SchindelinNov 26, 2018
  48. Johannes SchindelinNov 26, 2018
  49. Junio C HamanoNov 28, 2018
  50. Johannes SchindelinNov 28, 2018
  51. Junio C HamanoNov 26, 2018
  52. Elijah NewrenNov 26, 2018
  53. Junio C HamanoNov 27, 2018

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.