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

[PATCH v8 00/15] add git-bugreport tool

From
Emily Shaffer <emilyshaffer@google.com>
Date
Feb 20, 2020, 01:58 UTC
Message-ID
<20200220015858.181086-1-emilyshaffer@google.com>
In-Reply-To
<20200214015343.201946-1-emilyshaffer@google.com>

No longer relies on any topic branches, since mr/show-config-scope is merged. Range-diff at the bottom of the cover letter.

Since v7:
 - Dropped some POSIX regex magic in
   generate-bugreport-config-safelist.sh.
 - Added some advice in doc for scenarios when git-bugreport may not run
   nicely
 - Quit using unusual "return -foo(bar)" and start using "return
   !!foo(bar)"
 - Add a test to ensure path creation works outside of a git dir
 - Add some GNUC and GNUC_MINOR reporting
 - Use git_cmd instead of hardcoding "git" as the first arg when
   invoking another process
 - Fix some pesky whitespace
Thanks.
 - Emily
Emily Shaffer (15):
  help: move list_config_help to builtin/help
  help: add shell-path to --build-options
  bugreport: add tool to generate debugging info
  bugreport: gather git version and build info
  bugreport: add uname info
  bugreport: add compiler info
  bugreport: add git-remote-https version
  bugreport: include user interactive shell
  bugreport: generate config safelist based on docs
  bugreport: add config values from safelist
  bugreport: collect list of populated hooks
  bugreport: count loose objects
  bugreport: add packed object summary
  bugreport: list contents of $OBJDIR/info
  bugreport: summarize contents of alternates file
 .gitignore                              |   3 +
 Documentation/asciidoc.conf             |   9 +
 Documentation/asciidoctor-extensions.rb |   7 +
 Documentation/config/sendemail.txt      |  56 ++--
 Documentation/git-bugreport.txt         |  60 ++++
 Makefile                                |  27 +-
 bugreport.c                             | 418 ++++++++++++++++++++++++
 builtin/help.c                          |  86 +++++
 command-list.txt                        |   1 +
 compat/compiler.h                       |  27 ++
 generate-bugreport-config-safelist.sh   |  18 +
 generate-cmdlist.sh                     |  19 --
 generate-configlist.sh                  |  21 ++
 help.c                                  | 132 ++------
 help.h                                  |   2 +-
 object-store.h                          |   6 +
 packfile.c                              |   3 +-
 remote-curl.c                           |   8 +
 t/t0091-bugreport.sh                    |  61 ++++
 19 files changed, 808 insertions(+), 156 deletions(-)
 create mode 100644 Documentation/git-bugreport.txt
 create mode 100644 bugreport.c
 create mode 100644 compat/compiler.h
 create mode 100755 generate-bugreport-config-safelist.sh
 create mode 100755 generate-configlist.sh
 create mode 100755 t/t0091-bugreport.sh
 1:  429c7e093b =  1:  69f54afc6b help: move list_config_help to builtin/help
 2:  0cfb24f878 =  2:  9ea1c3ab34 help: add shell-path to --build-options
 3:  02bb151176 !  3:  8a290b5445 bugreport: add tool to generate debugging info
    @@ Documentation/git-bugreport.txt (new)
     + - Expected behavior
     + - Actual behavior
     +
    ++This tool is invoked via the typical Git setup process, which means that in some
    ++cases, it might not be able to launch - for example, if a relevant config file
    ++is unreadable. In this kind of scenario, it may be helpful to manually gather
    ++the kind of information listed above when manually asking for help.
    ++
     +OPTIONS
     +-------
     +-o <path>::
    @@ bugreport.c (new)
     +
     +	UNLEAK(buffer);
     +	UNLEAK(report_path);
    -+	return -launch_editor(report_path.buf, NULL, NULL);
    ++	return !!launch_editor(report_path.buf, NULL, NULL);
     +}
     
      ## command-list.txt ##
    @@ t/t0091-bugreport.sh (new)
     +	test_when_finished rm non-repo/git-bugreport-*
     +'
     +
    ++test_expect_success 'can create leading directories outside of a git dir' '
    ++	nongit git bugreport -o foo/bar/baz &&
    ++	test_when_finished rm -fr foo/bar/baz
    ++'
    ++
    ++
     +test_done
 4:  463612e409 !  4:  4eb4a7aef3 bugreport: gather git version and build info
    @@ Documentation/git-bugreport.txt: The following information is requested from the
     +
     + - 'git version --build-options'
     +
    - OPTIONS
    - -------
    - -o <path>::
    + This tool is invoked via the typical Git setup process, which means that in some
    + cases, it might not be able to launch - for example, if a relevant config file
    + is unreadable. In this kind of scenario, it may be helpful to manually gather
     
      ## bugreport.c ##
     @@
 5:  85e11ea125 !  5:  4e18b4678e bugreport: add uname info
    @@ Documentation/git-bugreport.txt: The following information is requested from the
       - 'git version --build-options'
     + - uname sysname, release, version, and machine strings
      
    - OPTIONS
    - -------
    + This tool is invoked via the typical Git setup process, which means that in some
    + cases, it might not be able to launch - for example, if a relevant config file
     
      ## bugreport.c ##
     @@
 6:  d9eafbaa48 !  6:  c18d17443d bugreport: add compiler info
    @@ Documentation/git-bugreport.txt: The following information is captured automatic
       - uname sysname, release, version, and machine strings
     + - Compiler-specific info string
      
    - OPTIONS
    - -------
    + This tool is invoked via the typical Git setup process, which means that in some
    + cases, it might not be able to launch - for example, if a relevant config file
     
      ## bugreport.c ##
     @@
    @@ compat/compiler.h (new)
     +
     +static inline void get_compiler_info(struct strbuf *info)
     +{
    -+	strbuf_addf(info, "glibc: %s", gnu_get_libc_version());
    ++	strbuf_addf(info, "glibc: %s\n", gnu_get_libc_version());
    ++#ifdef __GNUC__
    ++	strbuf_addf(info, "gnuc: %d.%d\n", __GNUC__, __GNUC_MINOR__);
    ++#endif
     +}
     +
     +#else
 7:  f5b6dd4174 !  7:  6d807cf857 bugreport: add git-remote-https version
    @@ Documentation/git-bugreport.txt: The following information is captured automatic
       - Compiler-specific info string
     + - 'git remote-https --build-info'
      
    - OPTIONS
    - -------
    + This tool is invoked via the typical Git setup process, which means that in some
    + cases, it might not be able to launch - for example, if a relevant config file
     
      ## bugreport.c ##
     @@
    @@ bugreport.c
     +{
     +	struct child_process cp = CHILD_PROCESS_INIT;
     +
    -+	argv_array_push(&cp.args, "git");
    ++	cp.git_cmd = 1;
     +	argv_array_push(&cp.args, "remote-https");
     +	argv_array_push(&cp.args, "--build-info");
     +	if (capture_command(&cp, version_info, 0))
 8:  3119c9c1e3 !  8:  f85e1b69d0 bugreport: include user interactive shell
    @@ Documentation/git-bugreport.txt: The following information is captured automatic
       - 'git remote-https --build-info'
     + - $SHELL
      
    - OPTIONS
    - -------
    + This tool is invoked via the typical Git setup process, which means that in some
    + cases, it might not be able to launch - for example, if a relevant config file
     
      ## bugreport.c ##
     @@ bugreport.c: static void get_git_remote_https_version_info(struct strbuf *version_info)
 9:  c35bab2735 !  9:  9980728360 bugreport: generate config safelist based on docs
    @@ generate-bugreport-config-safelist.sh (new)
     +# cat all regular files in Documentation/config
     +find Documentation/config -type f -exec cat {} \; |
     +# print the command name which matches the annotate-bugreport macro
    -+sed -n 's/^\([^[:blank:]]*\)[[:blank:]]\{1,\}annotate:bugreport\[include\].* ::$/  "\1",/p' \
    ++sed -n 's/^\([^ ]*\)  *annotate:bugreport\[include\].* ::$/  "\1",/p' \
     +	| sort
     +
     +cat <<EOF
10:  8a54ebdbbb ! 10:  e9cd8ffec9 bugreport: add config values from safelist
    @@ Documentation/git-bugreport.txt: The following information is captured automatic
       - $SHELL
     + - Selected config values
      
    - OPTIONS
    - -------
    + This tool is invoked via the typical Git setup process, which means that in some
    + cases, it might not be able to launch - for example, if a relevant config file
     
      ## Makefile ##
     @@ Makefile: git$X: git.o GIT-LDFLAGS $(BUILTIN_OBJS) $(GITLIBS)
11:  8bb5bcd8b8 ! 11:  881b62369d bugreport: collect list of populated hooks
    @@ Documentation/git-bugreport.txt: The following information is captured automatic
       - Selected config values
     + - A list of enabled hooks
      
    - OPTIONS
    - -------
    + This tool is invoked via the typical Git setup process, which means that in some
    + cases, it might not be able to launch - for example, if a relevant config file
     
      ## bugreport.c ##
     @@
12:  744dd6aeee ! 12:  715e48e9a7 bugreport: count loose objects
    @@ Documentation/git-bugreport.txt: The following information is captured automatic
       - A list of enabled hooks
     + - The number of loose objects in the repository
      
    - OPTIONS
    - -------
    + This tool is invoked via the typical Git setup process, which means that in some
    + cases, it might not be able to launch - for example, if a relevant config file
     
      ## bugreport.c ##
     @@
13:  2f23e272bf ! 13:  c9e2f1f1d8 bugreport: add packed object summary
    @@ Documentation/git-bugreport.txt: The following information is captured automatic
       - The number of loose objects in the repository
     + - The number of packs and packed objects in the repository
      
    - OPTIONS
    - -------
    + This tool is invoked via the typical Git setup process, which means that in some
    + cases, it might not be able to launch - for example, if a relevant config file
     
      ## bugreport.c ##
     @@ bugreport.c: static void get_loose_object_summary(struct strbuf *obj_info, int nongit) {
    @@ bugreport.c: int cmd_main(int argc, const char **argv)
     
      ## object-store.h ##
     @@
    - #include "list.h"
      #include "sha1-array.h"
      #include "strbuf.h"
    + #include "thread-utils.h"
     +#include "packfile.h"
      
      struct object_directory {
14:  7b5ae1aca1 ! 14:  89762a0de1 bugreport: list contents of $OBJDIR/info
    @@ Documentation/git-bugreport.txt: The following information is captured automatic
       - The number of packs and packed objects in the repository
     + - A list of the contents of .git/objects/info (or equivalent)
      
    - OPTIONS
    - -------
    + This tool is invoked via the typical Git setup process, which means that in some
    + cases, it might not be able to launch - for example, if a relevant config file
     
      ## bugreport.c ##
     @@ bugreport.c: static void get_packed_object_summary(struct strbuf *obj_info, int nongit)
    @@ bugreport.c: static void get_packed_object_summary(struct strbuf *obj_info, int
      }
      
     +static void list_contents_of_dir_recursively(struct strbuf *contents,
    -+				      	     struct strbuf *dirpath)
    ++					     struct strbuf *dirpath)
     +{
     +	struct dirent *d;
     +	DIR *dir;
15:  315b00ed54 ! 15:  aa81e197aa bugreport: summarize contents of alternates file
    @@ Documentation/git-bugreport.txt: The following information is captured automatic
       - A list of the contents of .git/objects/info (or equivalent)
     + - The number of valid and invalid alternates
      
    - OPTIONS
    - -------
    + This tool is invoked via the typical Git setup process, which means that in some
    + cases, it might not be able to launch - for example, if a relevant config file
     
      ## bugreport.c ##
     @@ bugreport.c: static void get_object_info_summary(struct strbuf *obj_info, int nongit)
-- 
2.25.0.265.gbab2e86ba0-goog
Next: Emily Shaffer
Message 1 of 87 in “add git-bugreport tool”
  1. 00/15 add git-bugreport toolEmily Shaffer, Feb 20, 2020
  2. 02/15 help: add shell-path to --build-optionsEmily Shaffer, Feb 20, 2020
  3. Junio C HamanoFeb 20, 2020
  4. Emily ShafferFeb 20, 2020
  5. 01/15 help: move list_config_help to builtin/helpEmily Shaffer, Feb 20, 2020
  6. 03/15 bugreport: add tool to generate debugging infoEmily Shaffer, Feb 20, 2020
  7. Junio C HamanoFeb 20, 2020
  8. Emily ShafferFeb 20, 2020
  9. Johannes SchindelinFeb 26, 2020
  10. 04/15 bugreport: gather git version and build infoEmily Shaffer, Feb 20, 2020
  11. Junio C HamanoFeb 20, 2020
  12. Emily ShafferFeb 20, 2020
  13. Junio C HamanoFeb 20, 2020
  14. 05/15 bugreport: add uname infoEmily Shaffer, Feb 20, 2020
  15. Junio C HamanoFeb 20, 2020
  16. Emily ShafferFeb 20, 2020
  17. 06/15 bugreport: add compiler infoEmily Shaffer, Feb 20, 2020
  18. Danh DoanFeb 20, 2020
  19. Emily ShafferFeb 20, 2020
  20. Junio C HamanoFeb 20, 2020
  21. Junio C HamanoFeb 21, 2020
  22. 07/15 bugreport: add git-remote-https versionEmily Shaffer, Feb 20, 2020
  23. Junio C HamanoFeb 20, 2020
  24. Emily ShafferFeb 20, 2020
  25. Junio C HamanoFeb 21, 2020
  26. Emily ShafferFeb 25, 2020
  27. Junio C HamanoFeb 25, 2020
  28. Emily ShafferFeb 25, 2020
  29. Junio C HamanoFeb 25, 2020
  30. Emily ShafferFeb 25, 2020
  31. 08/15 bugreport: include user interactive shellEmily Shaffer, Feb 20, 2020
  32. 09/15 bugreport: generate config safelist based on docsEmily Shaffer, Feb 20, 2020
  33. Junio C HamanoFeb 20, 2020
  34. Johannes SchindelinFeb 26, 2020
  35. Junio C HamanoFeb 26, 2020
  36. 10/15 bugreport: add config values from safelistEmily Shaffer, Feb 20, 2020
  37. Junio C HamanoFeb 20, 2020
  38. 11/15 bugreport: collect list of populated hooksEmily Shaffer, Feb 20, 2020
  39. Junio C HamanoFeb 20, 2020
  40. Emily ShafferFeb 25, 2020
  41. 12/15 bugreport: count loose objectsEmily Shaffer, Feb 20, 2020
  42. Junio C HamanoFeb 20, 2020
  43. Emily ShafferFeb 25, 2020
  44. Emily ShafferFeb 25, 2020
  45. 13/15 bugreport: add packed object summaryEmily Shaffer, Feb 20, 2020
  46. Junio C HamanoFeb 20, 2020
  47. Emily ShafferFeb 25, 2020
  48. 14/15 bugreport: list contents of $OBJDIR/infoEmily Shaffer, Feb 20, 2020
  49. Junio C HamanoFeb 20, 2020
  50. 15/15 bugreport: summarize contents of alternates fileEmily Shaffer, Feb 20, 2020
  51. Johannes SchindelinFeb 20, 2020
  52. Junio C HamanoFeb 20, 2020
  53. 0/5 add git-bugreport toolEmily Shaffer, Mar 2, 2020
  54. 1/5 help: move list_config_help to builtin/helpEmily Shaffer, Mar 2, 2020
  55. 2/5 bugreport: add tool to generate debugging infoEmily Shaffer, Mar 2, 2020
  56. Johannes SchindelinMar 3, 2020
  57. Johannes SchindelinMar 4, 2020
  58. Jeff HostetlerMar 5, 2020
  59. Johannes SchindelinMar 6, 2020
  60. Junio C HamanoMar 6, 2020
  61. Junio C HamanoMar 6, 2020
  62. Jeff HostetlerMar 6, 2020
  63. Johannes SchindelinMar 8, 2020
  64. Junio C HamanoMar 9, 2020
  65. Johannes SchindelinMar 9, 2020
  66. Junio C HamanoMar 9, 2020
  67. Johannes SchindelinMar 10, 2020
  68. Junio C HamanoMar 10, 2020
  69. Johannes SchindelinMar 10, 2020
  70. Emily ShafferMar 19, 2020
  71. Junio C HamanoMar 20, 2020
  72. Johannes SchindelinMar 20, 2020
  73. Emily ShafferMar 23, 2020
  74. Johannes SchindelinMar 20, 2020
  75. Emily ShafferMar 23, 2020
  76. Junio C HamanoMar 20, 2020
  77. Johannes SchindelinMar 20, 2020
  78. Junio C HamanoMar 20, 2020
  79. Johannes SchindelinMar 21, 2020
  80. 3/5 bugreport: gather git version and build infoEmily Shaffer, Mar 2, 2020
  81. Junio C HamanoMar 23, 2020
  82. 4/5 bugreport: add uname infoEmily Shaffer, Mar 2, 2020
  83. 5/5 bugreport: add compiler infoEmily Shaffer, Mar 2, 2020
  84. Danh DoanMar 3, 2020
  85. Junio C HamanoMar 3, 2020
  86. Johannes SchindelinMar 4, 2020
  87. Emily ShafferMar 23, 2020

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.