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

Re: [PATCH 0/7] Generalize 'scalar diagnose' into 'git bugreport --diagnose'

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Aug 3, 2022, 12:34 UTC
Message-ID
<220803.86pmhhfpjb.gmgdl@evledraar.gmail.com>
In-Reply-To
<392ae6f1-c2f1-ab0f-c832-f8e53800506a@github.com>
On Tue, Aug 02 2022, Victoria Dye wrote:
Show 40 quoted lines
> Ævar Arnfjörð Bjarmason wrote:
>> 
>> On Mon, Aug 01 2022, Victoria Dye via GitGitGadget wrote:
>> 
>>> [...] I didn't see a major UX benefit of 'git diagnose' vs 'git
>>> bugreport --diagnose', so I went with the latter, simpler approach.
>> 
>> I really wanted to like this, but I find the end result here really
>> confusing from a UX perspective.
>> 
>> You can now run "git bugreport --diagnose", which creates a giant *.zip
>> file to go along with your *.txt, but your *.txt makes no reference to
>> it.
>> 
>> Should you ... attach it to your bug report to this mailing list, do
>> something else?
>> 
>> The documentation doesn't offer much in the way of hints, other than
>> suggesting (with --no-report) that this --diagnose is for something
>> entirely different (and that's how "scalar" uses it).
>> 
>> I know what it's really for after reading this series, but for "git
>> bugreport" in particular we should be really careful about not making
>> the UX confusing.
>> 
>> The generated *.zip contains some really deep info about your repo (and
>> not just metadata, e.g. copies of the index, various logs etc.), someone
>> e.g. in a proprietary setting really doesn't want to be sharing that
>> info.
>> 
>> So I would like to see real integration into "git bugreport", i.e. for
>> us to smartly report more repository metrics, e.g. approx number of
>> loose objects, the sort of state "__git_ps1" might report, etc.
>> 
>> But I think the end-state here makes things much more confusing for
>> users.
>> 
>
> The "confusing UX" you describe here doesn't seem to be an inherent issue
> with the implementation (nor is it as insurmountable as you're implying),
I'm not implying or saying that it's insurmountable.

I think in principle having such a mode in "git bugreport" would make sense.

But the UX here seems to be an afterthought. So I wonder if we shouldn't hold off on it and just have a new *--helper or something instead.

Show 7 quoted lines
> it
> largely appears to be an issue of under-documentation. I'll improve that in
> V2 [1], but I want clarify what I was/am going for here as well.
>
> In the context of a bug report, the diagnostics are intended to be used as
> supplemental information to aid in debugging (i.e., attached with the report
> in the email to the list).

Per https://lore.kernel.org/git/?q=n%3Azip we don't block *.zip attachments, but we have fairly low size limits (to the point of blocking some large patches).

E.g. e448263716f (po/git.pot: this is now a generated file, 2022-05-26) (https://lore.kernel.org/git/20220526145035.18958-7-worldhello.net@gmail.com/) was blocked, and it's just over 500k.

Aside from the data-sharing issues that seems like a good addition to git-bugreport, i.e. tell the user if the attachment would be blocked due to its size...

Show 9 quoted lines
> They're especially valuable when a bug reporter
> isn't very familiar with Git internals and they can't reproduce the issue. A
> lot of bugs can be investigated without those diagnostics, though, which is
> why '--diagnose' isn't "on" by default.
>
> There are also valid use-cases (beyond 'scalar diagnose') for '--no-report':
> someone requests more information after looking into an already-generated
> report, or a developer wants to investigate a bug on their own and use the
> diagnostics as a "starting point" to guide more in-depth debugging. 

Yes, it's useful in a lot of cases. I'm just saying that we really need to bridge the gap of telling the user what they should be doing with this new file....

Show 5 quoted lines
> As for the proprietary data issue, I'd be open to having an option to
> configure which diagnostics a user wants (either something like '--diagnose
> <level>' or a separate option entirely). I'm pretty indifferent on the UI,
> though, so I'll defer to other contributors on 1) if they want that feature,
> and 2) what they think that should look like.

I think it's really important that a bug report feature doesn't submit private data by default. The name of a "--diagnose" option heavily implies some aggregate metrics etc.

We then attach what to the user are opaque binary files, but which contain even the file contants of the repository (index files).

I think scalar was developer for "internal" use-cases where such sharing wasn't an issue for anyone, but I don't want anyone to get in trouble because they shared their proprietary source code on the ML while trying to file a bug report, so defaults really matter.

Especially because if there's one thing we've learned from bug reports & questions to this & git-users is that the one thing you can rely on is that users routinely don't carefully scrutinize documentation before trying out various features...

Show 18 quoted lines
> [1] https://lore.kernel.org/git/f3235afe-25cc-21a4-fc35-56e35d6be0ce@github.com/
>
>>> An alternative implementation considered was creating a new 'git diagnose'
>>> builtin, but the new command would end up duplicating much of
>>> 'builtin/bugreport.c'.
>> 
>> It seems we always "return" from cmd_bugreport() quite quickly, and we
>> basically only share the code to create the output directory. Just
>> duplicating or sharing that seems like a much better approach for now
>> than creating the above UX confusion.
>> 
>> Note that you can also share code between multiple built-ins, even in
>> the same file (see e.g. builtin/{checkout,log}.c). So we could even
>> share something like the safe_create_leading_directories() calling code
>> in bugreport.c without libifying it.
>> 
>
> You deleted the part where I addressed this suggestion directly:

Yes, the "Although that..." sentence, but I commented on the UX trade-off elsewhere.

Show 7 quoted lines
>> Although that issue could be overcome with refactoring, I didn't see a
>> major UX benefit of 'git diagnose' vs 'git bugreport --diagnose', so I
>> went with the latter, simpler approach.
>
> And, in the process of writing down my thoughts on the UX above, I've become
> more convinced that including '--diagnose' in 'git bugreport' is the better
> way to present this functionality to users.

We're on the same page there, we're just discussing if/how to make the end-to-end process clearer to users.

I don't think it's clear in v1, and is sorely missing something like the discussion we have around "ANONYMIZING" in git-fast-export(1), and we really should have a "safe by default". Everything I'm noting here would be addressed by e.g.:

 * The *.txt output would say "you can additionally attach a diagnostic
   *.zip" file etc. etc., noting if/when the user would do that.
 * We'd have that --diagnostics be safe by default in the way
   --anonymize is, e.g. including stats about number of refs & the like,
   not their contents.
 * We could also have e.g. "--diagnostics --no-anonymize", or
   "--diagnostics=full" or whatever, which would be some approximation
   of the current output.
Show 18 quoted lines
>>> Finally, despite 'scalar diagnose' now being nothing more than a wrapper for
>>> 'git bugreport --diagnose', it is not being deprecated in this series.
>>> Although deprecation -> removal could be a future cleanup effort, 'scalar
>>> diagnose' is kept around for now as an alias for users already accustomed to
>>> using it in 'scalar'.
>> 
>> We don't have a "make install" to get a "scalar" onto user's systems
>> yet, do we really need to worry about those users?
>> 
>> Or is this a reference to the out-of-tree version of "scalar", not
>> git.git's?
>> 
>
> In practice, it's the "out-of-tree Scalar" users that would care the most.
> That said, with Scalar in the Git tree (albeit 'contrib/' and not built by
> default), I think it's reasonable to want to avoid breaking changes if
> possible. The continued existence of 'scalar diagnose' wouldn't really be
> hurting anyone anyway, so there's no pressing need to deprecate it now.

I'm fine with keeping it, but just found the juxtaposition of doing that & previous discussions about scalar to be surprising.

When it was submitted (from my recollection, I see Documentation/technical/scalar.txt is rather light on the topic) the idea was (and this is from my own recollection, I haven't dug up ML references) that scalar would be "going away", and that the reason to have it in-tree was to inform the design of the main "git" tooling for the use-cases scalar is addressing.

So, a bit similar to Cogito (although that was never in-tree).

I'm fine with just keeping it as an alias for "git bugreport --whatever", but think it would make even more sense to change the interface a bit as we integrate it to the rest of git, and then "die()" saying "'scalar xyz' is now 'git abc', mostly....".

Existing scalar users used to 'scalar xyz' would then try the new 'git abc', and report if/how that fits their use-case.

Then at some point if we do that with all of scalar's features we'd be at the point of 'git rm'-ing it, as it would have served its stated purpose.

Just my 0.02, I think in any case having the scalar.txt doc's "Roadmap" updated to address this would be very useful.

Previous: Victoria DyeNext: Victoria Dye via GitGitGadget
Message 26 of 94 in “Generalize 'scalar diagnose' into 'git bugreport --diagnose'”
  1. 0/7 Generalize 'scalar diagnose' into 'git bugreport --diagnose'Victoria Dye via GitGitGadget, Aug 1, 2022
  2. 1/7 scalar: use "$GIT_UNZIP" in 'scalar diagnose' testVictoria Dye via GitGitGadget, Aug 1, 2022
  3. Junio C HamanoAug 1, 2022
  4. 2/7 builtin/bugreport.c: create '--diagnose' optionVictoria Dye via GitGitGadget, Aug 1, 2022
  5. Junio C HamanoAug 1, 2022
  6. Victoria DyeAug 2, 2022
  7. Ævar Arnfjörð BjarmasonAug 2, 2022
  8. 3/7 builtin/bugreport.c: avoid size_t overflowVictoria Dye via GitGitGadget, Aug 1, 2022
  9. Junio C HamanoAug 1, 2022
  10. Victoria DyeAug 2, 2022
  11. Junio C HamanoAug 2, 2022
  12. Ævar Arnfjörð BjarmasonAug 2, 2022
  13. Victoria DyeAug 2, 2022
  14. Ævar Arnfjörð BjarmasonAug 3, 2022
  15. 4/7 builtin/bugreport.c: add directory to archiver more gentlyVictoria Dye via GitGitGadget, Aug 1, 2022
  16. Junio C HamanoAug 1, 2022
  17. Victoria DyeAug 2, 2022
  18. 5/7 builtin/bugreport.c: add '--no-report' optionVictoria Dye via GitGitGadget, Aug 1, 2022
  19. Junio C HamanoAug 1, 2022
  20. Victoria DyeAug 2, 2022
  21. 6/7 scalar: use 'git bugreport --diagnose' in 'scalar diagnose'Victoria Dye via GitGitGadget, Aug 1, 2022
  22. 7/7 scalar: update technical doc roadmapVictoria Dye via GitGitGadget, Aug 1, 2022
  23. Junio C HamanoAug 1, 2022
  24. Ævar Arnfjörð BjarmasonAug 2, 2022
  25. Victoria DyeAug 2, 2022
  26. Ævar Arnfjörð BjarmasonAug 3, 2022
  27. 00/10 Generalize 'scalar diagnose' into 'git diagnose' and 'git bugreport --diagnose'Victoria Dye via GitGitGadget, Aug 4, 2022
  28. 01/10 scalar-diagnose: use "$GIT_UNZIP" in testVictoria Dye via GitGitGadget, Aug 4, 2022
  29. 02/10 scalar-diagnose: avoid 32-bit overflow of size_tVictoria Dye via GitGitGadget, Aug 4, 2022
  30. 03/10 scalar-diagnose: add directory to archiver more gentlyVictoria Dye via GitGitGadget, Aug 4, 2022
  31. Ævar Arnfjörð BjarmasonAug 4, 2022
  32. Junio C HamanoAug 4, 2022
  33. Ævar Arnfjörð BjarmasonAug 4, 2022
  34. Junio C HamanoAug 4, 2022
  35. 04/10 scalar-diagnose: move 'get_disk_info()' to 'compat/'Victoria Dye via GitGitGadget, Aug 4, 2022
  36. 06/10 builtin/diagnose.c: create 'git diagnose' builtinVictoria Dye via GitGitGadget, Aug 4, 2022
  37. Ævar Arnfjörð BjarmasonAug 4, 2022
  38. Derrick StoleeAug 5, 2022
  39. Ævar Arnfjörð BjarmasonAug 11, 2022
  40. Derrick StoleeAug 5, 2022
  41. 05/10 scalar-diagnose: move functionality to common locationVictoria Dye via GitGitGadget, Aug 4, 2022
  42. Ævar Arnfjörð BjarmasonAug 4, 2022
  43. 07/10 builtin/diagnose.c: gate certain data behind '--all'Victoria Dye via GitGitGadget, Aug 4, 2022
  44. Ævar Arnfjörð BjarmasonAug 4, 2022
  45. 09/10 scalar-diagnose: use 'git diagnose --all'Victoria Dye via GitGitGadget, Aug 4, 2022
  46. Ævar Arnfjörð BjarmasonAug 4, 2022
  47. Victoria DyeAug 9, 2022
  48. 08/10 builtin/bugreport.c: create '--diagnose' optionVictoria Dye via GitGitGadget, Aug 4, 2022
  49. Derrick StoleeAug 5, 2022
  50. Victoria DyeAug 9, 2022
  51. Derrick StoleeAug 10, 2022
  52. Victoria DyeAug 10, 2022
  53. Derrick StoleeAug 10, 2022
  54. 10/10 scalar: update technical doc roadmapVictoria Dye via GitGitGadget, Aug 4, 2022
  55. Junio C HamanoAug 4, 2022
  56. Victoria DyeAug 9, 2022
  57. Junio C HamanoAug 9, 2022
  58. 00/11 Generalize 'scalar diagnose' into 'git diagnose' and 'git bugreport --diagnose'Victoria Dye via GitGitGadget, Aug 10, 2022
  59. 01/11 scalar-diagnose: use "$GIT_UNZIP" in testVictoria Dye via GitGitGadget, Aug 10, 2022
  60. 02/11 scalar-diagnose: avoid 32-bit overflow of size_tVictoria Dye via GitGitGadget, Aug 10, 2022
  61. 03/11 scalar-diagnose: add directory to archiver more gentlyVictoria Dye via GitGitGadget, Aug 10, 2022
  62. 04/11 scalar-diagnose: move 'get_disk_info()' to 'compat/'Victoria Dye via GitGitGadget, Aug 10, 2022
  63. 05/11 scalar-diagnose: move functionality to common locationVictoria Dye via GitGitGadget, Aug 10, 2022
  64. 07/11 builtin/diagnose.c: create 'git diagnose' builtinVictoria Dye via GitGitGadget, Aug 10, 2022
  65. 06/11 diagnose.c: add option to configure archive contentsVictoria Dye via GitGitGadget, Aug 10, 2022
  66. Junio C HamanoAug 11, 2022
  67. Victoria DyeAug 12, 2022
  68. Ævar Arnfjörð BjarmasonAug 11, 2022
  69. Victoria DyeAug 11, 2022
  70. 09/11 builtin/bugreport.c: create '--diagnose' optionVictoria Dye via GitGitGadget, Aug 10, 2022
  71. Ævar Arnfjörð BjarmasonAug 11, 2022
  72. Victoria DyeAug 11, 2022
  73. Ævar Arnfjörð BjarmasonAug 11, 2022
  74. 08/11 builtin/diagnose.c: add '--mode' optionVictoria Dye via GitGitGadget, Aug 10, 2022
  75. 10/11 scalar-diagnose: use 'git diagnose --mode=all'Victoria Dye via GitGitGadget, Aug 10, 2022
  76. 11/11 scalar: update technical doc roadmapVictoria Dye via GitGitGadget, Aug 10, 2022
  77. 00/11 Generalize 'scalar diagnose' into 'git diagnose' and 'git bugreport --diagnose'Victoria Dye via GitGitGadget, Aug 12, 2022
  78. 01/11 scalar-diagnose: use "$GIT_UNZIP" in testVictoria Dye via GitGitGadget, Aug 12, 2022
  79. 02/11 scalar-diagnose: avoid 32-bit overflow of size_tVictoria Dye via GitGitGadget, Aug 12, 2022
  80. 03/11 scalar-diagnose: add directory to archiver more gentlyVictoria Dye via GitGitGadget, Aug 12, 2022
  81. 04/11 scalar-diagnose: move 'get_disk_info()' to 'compat/'Victoria Dye via GitGitGadget, Aug 12, 2022
  82. 05/11 scalar-diagnose: move functionality to common locationVictoria Dye via GitGitGadget, Aug 12, 2022
  83. Junio C HamanoAug 12, 2022
  84. Victoria DyeAug 12, 2022
  85. Junio C HamanoAug 12, 2022
  86. 06/11 diagnose.c: add option to configure archive contentsVictoria Dye via GitGitGadget, Aug 12, 2022
  87. Junio C HamanoAug 12, 2022
  88. 07/11 builtin/diagnose.c: create 'git diagnose' builtinVictoria Dye via GitGitGadget, Aug 12, 2022
  89. Ævar Arnfjörð BjarmasonAug 18, 2022
  90. Junio C HamanoAug 18, 2022
  91. 09/11 builtin/bugreport.c: create '--diagnose' optionVictoria Dye via GitGitGadget, Aug 12, 2022
  92. 10/11 scalar-diagnose: use 'git diagnose --mode=all'Victoria Dye via GitGitGadget, Aug 12, 2022
  93. 08/11 builtin/diagnose.c: add '--mode' optionVictoria Dye via GitGitGadget, Aug 12, 2022
  94. 11/11 scalar: update technical doc roadmapVictoria Dye via GitGitGadget, Aug 12, 2022

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.