Skip to content

Commit 06f6998

Browse files
committed
Merge branch 'es/bugreport' into pu
The "bugreport" tool. at v7. * es/bugreport: bugreport: summarize contents of alternates file bugreport: list contents of $OBJDIR/info bugreport: add packed object summary bugreport: count loose objects bugreport: collect list of populated hooks bugreport: add config values from safelist bugreport: generate config safelist based on docs bugreport: include user interactive shell bugreport: add git-remote-https version bugreport: add compiler info bugreport: add uname info bugreport: gather git version and build info bugreport: add tool to generate debugging info help: add shell-path to --build-options help: move list_config_help to builtin/help
2 parents 88407f2 + 5439144 commit 06f6998

19 files changed

+808
-156
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
/git-bisect--helper
2626
/git-blame
2727
/git-branch
28+
/git-bugreport
2829
/git-bundle
2930
/git-cat-file
3031
/git-check-attr
@@ -189,7 +190,9 @@
189190
/gitweb/gitweb.cgi
190191
/gitweb/static/gitweb.js
191192
/gitweb/static/gitweb.min.*
193+
/config-list.h
192194
/command-list.h
195+
/bugreport-config-safelist.h
193196
*.tar.gz
194197
*.dsc
195198
*.deb

Documentation/asciidoc.conf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@
66
#
77
# Show Git link as: <command>(<section>); if section is defined, else just show
88
# the command.
9+
#
10+
# The annotate macro does nothing as far as rendering is
11+
# concerned -- we just grep for it in the sources to populate
12+
# things like the bugreport safelist.
913

1014
[macros]
1115
(?su)[\\]?(?P<name>linkgit):(?P<target>\S*?)\[(?P<attrlist>.*?)\]=
16+
(?su)[\\]?(?P<name>annotate):(?P<target>\S*?)\[(?P<attrlist>.*?)\]=
1217

1318
[attributes]
1419
asterisk=&#42;
@@ -28,6 +33,8 @@ ifdef::backend-docbook[]
2833
{0#<citerefentry>}
2934
{0#<refentrytitle>{target}</refentrytitle><manvolnum>{0}</manvolnum>}
3035
{0#</citerefentry>}
36+
[annotate-inlinemacro]
37+
{0#}
3138
endif::backend-docbook[]
3239

3340
ifdef::backend-docbook[]
@@ -94,4 +101,6 @@ ifdef::backend-xhtml11[]
94101
git-relative-html-prefix=
95102
[linkgit-inlinemacro]
96103
<a href="{git-relative-html-prefix}{target}.html">{target}{0?({0})}</a>
104+
[annotate-inlinemacro]
105+
<!-- -->
97106
endif::backend-xhtml11[]

Documentation/asciidoctor-extensions.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,17 @@ def process document, output
3939
output
4040
end
4141
end
42+
43+
class AnnotateProcessor < Asciidoctor::Extensions::InlineMacroProcessor
44+
def process(parent, target, attrs)
45+
""
46+
end
47+
end
4248
end
4349
end
4450

4551
Asciidoctor::Extensions.register do
4652
inline_macro Git::Documentation::LinkGitProcessor, :linkgit
4753
postprocessor Git::Documentation::DocumentPostProcessor
54+
inline_macro Git::Documentation::AnnotateProcessor, :annotate
4855
end

Documentation/config/sendemail.txt

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sendemail.identity::
44
values in the 'sendemail' section. The default identity is
55
the value of `sendemail.identity`.
66

7-
sendemail.smtpEncryption::
7+
sendemail.smtpEncryption annotate:bugreport[include] ::
88
See linkgit:git-send-email[1] for description. Note that this
99
setting is not subject to the 'identity' mechanism.
1010

@@ -15,49 +15,49 @@ sendemail.smtpsslcertpath::
1515
Path to ca-certificates (either a directory or a single file).
1616
Set it to an empty string to disable certificate verification.
1717

18-
sendemail.<identity>.*::
18+
sendemail.<identity>.* annotate:bugreport[exclude] ::
1919
Identity-specific versions of the 'sendemail.*' parameters
2020
found below, taking precedence over those when this
2121
identity is selected, through either the command-line or
2222
`sendemail.identity`.
2323

2424
sendemail.aliasesFile::
2525
sendemail.aliasFileType::
26-
sendemail.annotate::
27-
sendemail.bcc::
28-
sendemail.cc::
29-
sendemail.ccCmd::
30-
sendemail.chainReplyTo::
31-
sendemail.confirm::
32-
sendemail.envelopeSender::
33-
sendemail.from::
34-
sendemail.multiEdit::
35-
sendemail.signedoffbycc::
36-
sendemail.smtpPass::
37-
sendemail.suppresscc::
38-
sendemail.suppressFrom::
39-
sendemail.to::
40-
sendemail.tocmd::
41-
sendemail.smtpDomain::
42-
sendemail.smtpServer::
43-
sendemail.smtpServerPort::
44-
sendemail.smtpServerOption::
45-
sendemail.smtpUser::
46-
sendemail.thread::
47-
sendemail.transferEncoding::
48-
sendemail.validate::
49-
sendemail.xmailer::
26+
sendemail.annotate annotate:bugreport[include] ::
27+
sendemail.bcc annotate:bugreport[include] ::
28+
sendemail.cc annotate:bugreport[include] ::
29+
sendemail.ccCmd annotate:bugreport[include] ::
30+
sendemail.chainReplyTo annotate:bugreport[include] ::
31+
sendemail.confirm annotate:bugreport[include] ::
32+
sendemail.envelopeSender annotate:bugreport[include] ::
33+
sendemail.from annotate:bugreport[include] ::
34+
sendemail.multiEdit annotate:bugreport[include] ::
35+
sendemail.signedoffbycc annotate:bugreport[include] ::
36+
sendemail.smtpPass annotate:bugreport[exclude] ::
37+
sendemail.suppresscc annotate:bugreport[include] ::
38+
sendemail.suppressFrom annotate:bugreport[include] ::
39+
sendemail.to annotate:bugreport[include] ::
40+
sendemail.tocmd annotate:bugreport[include] ::
41+
sendemail.smtpDomain annotate:bugreport[include] ::
42+
sendemail.smtpServer annotate:bugreport[include] ::
43+
sendemail.smtpServerPort annotate:bugreport[include] ::
44+
sendemail.smtpServerOption annotate:bugreport[include] ::
45+
sendemail.smtpUser annotate:bugreport[exclude] ::
46+
sendemail.thread annotate:bugreport[include] ::
47+
sendemail.transferEncoding annotate:bugreport[include] ::
48+
sendemail.validate annotate:bugreport[include] ::
49+
sendemail.xmailer annotate:bugreport[include] ::
5050
See linkgit:git-send-email[1] for description.
5151

5252
sendemail.signedoffcc (deprecated)::
5353
Deprecated alias for `sendemail.signedoffbycc`.
5454

55-
sendemail.smtpBatchSize::
55+
sendemail.smtpBatchSize annotate:bugreport[include] ::
5656
Number of messages to be sent per connection, after that a relogin
5757
will happen. If the value is 0 or undefined, send all messages in
5858
one connection.
5959
See also the `--batch-size` option of linkgit:git-send-email[1].
6060

61-
sendemail.smtpReloginDelay::
61+
sendemail.smtpReloginDelay annotate:bugreport[include] ::
6262
Seconds wait before reconnecting to smtp server.
6363
See also the `--relogin-delay` option of linkgit:git-send-email[1].

Documentation/git-bugreport.txt

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
git-bugreport(1)
2+
================
3+
4+
NAME
5+
----
6+
git-bugreport - Collect information for user to file a bug report
7+
8+
SYNOPSIS
9+
--------
10+
[verse]
11+
'git bugreport' [(-o | --output-directory) <path>] [(-s | --suffix) <format>]
12+
13+
DESCRIPTION
14+
-----------
15+
Captures information about the user's machine, Git client, and repository state,
16+
as well as a form requesting information about the behavior the user observed,
17+
into a single text file which the user can then share, for example to the Git
18+
mailing list, in order to report an observed bug.
19+
20+
The following information is requested from the user:
21+
22+
- Reproduction steps
23+
- Expected behavior
24+
- Actual behavior
25+
26+
The following information is captured automatically:
27+
28+
- 'git version --build-options'
29+
- uname sysname, release, version, and machine strings
30+
- Compiler-specific info string
31+
- 'git remote-https --build-info'
32+
- $SHELL
33+
- Selected config values
34+
- A list of enabled hooks
35+
- The number of loose objects in the repository
36+
- The number of packs and packed objects in the repository
37+
- A list of the contents of .git/objects/info (or equivalent)
38+
- The number of valid and invalid alternates
39+
40+
This tool is invoked via the typical Git setup process, which means that in some
41+
cases, it might not be able to launch - for example, if a relevant config file
42+
is unreadable. In this kind of scenario, it may be helpful to manually gather
43+
the kind of information listed above when manually asking for help.
44+
45+
OPTIONS
46+
-------
47+
-o <path>::
48+
--output-directory <path>::
49+
Place the resulting bug report file in `<path>` instead of the root of
50+
the Git repository.
51+
52+
-s <format>::
53+
--suffix <format>::
54+
Specify an alternate suffix for the bugreport name, to create a file
55+
named 'git-bugreport-<formatted suffix>'. This should take the form of a
56+
link:strftime[3] format string; the current local time will be used.
57+
58+
GIT
59+
---
60+
Part of the linkgit:git[1] suite

Makefile

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,7 @@ EXTRA_PROGRAMS =
681681
# ... and all the rest that could be moved out of bindir to gitexecdir
682682
PROGRAMS += $(EXTRA_PROGRAMS)
683683

684+
PROGRAM_OBJS += bugreport.o
684685
PROGRAM_OBJS += credential-store.o
685686
PROGRAM_OBJS += daemon.o
686687
PROGRAM_OBJS += fast-import.o
@@ -816,7 +817,9 @@ LIB_FILE = libgit.a
816817
XDIFF_LIB = xdiff/lib.a
817818
VCSSVN_LIB = vcs-svn/lib.a
818819

820+
GENERATED_H += config-list.h
819821
GENERATED_H += command-list.h
822+
GENERATED_H += bugreport-config-safelist.h
820823

821824
LIB_H := $(sort $(patsubst ./%,%,$(shell git ls-files '*.h' ':!t/' ':!Documentation/' 2>/dev/null || \
822825
$(FIND) . \
@@ -2135,7 +2138,9 @@ git$X: git.o GIT-LDFLAGS $(BUILTIN_OBJS) $(GITLIBS)
21352138

21362139
help.sp help.s help.o: command-list.h
21372140

2138-
builtin/help.sp builtin/help.s builtin/help.o: command-list.h GIT-PREFIX
2141+
bugreport.sp bugreport.s bugreport.o: bugreport-config-safelist.h
2142+
2143+
builtin/help.sp builtin/help.s builtin/help.o: config-list.h GIT-PREFIX
21392144
builtin/help.sp builtin/help.s builtin/help.o: EXTRA_CPPFLAGS = \
21402145
'-DGIT_HTML_PATH="$(htmldir_relative_SQ)"' \
21412146
'-DGIT_MAN_PATH="$(mandir_relative_SQ)"' \
@@ -2155,13 +2160,25 @@ $(BUILT_INS): git$X
21552160
ln -s $< $@ 2>/dev/null || \
21562161
cp $< $@
21572162

2163+
config-list.h: generate-configlist.sh
2164+
2165+
config-list.h:
2166+
$(QUIET_GEN)$(SHELL_PATH) ./generate-configlist.sh \
2167+
>$@+ && mv $@+ $@
2168+
21582169
command-list.h: generate-cmdlist.sh command-list.txt
21592170

21602171
command-list.h: $(wildcard Documentation/git*.txt) Documentation/*config.txt Documentation/config/*.txt
21612172
$(QUIET_GEN)$(SHELL_PATH) ./generate-cmdlist.sh \
21622173
$(patsubst %,--exclude-program %,$(EXCLUDED_PROGRAMS)) \
21632174
command-list.txt >$@+ && mv $@+ $@
21642175

2176+
bugreport-config-safelist.h: generate-bugreport-config-safelist.sh
2177+
2178+
bugreport-config-safelist.h: Documentation/config/*.txt
2179+
$(QUIET_GEN)$(SHELL_PATH) ./generate-bugreport-config-safelist.sh \
2180+
>$@+ && mv $@+ $@
2181+
21652182
SCRIPT_DEFINES = $(SHELL_PATH_SQ):$(DIFF_SQ):$(GIT_VERSION):\
21662183
$(localedir_SQ):$(NO_CURL):$(USE_GETTEXT_SCHEME):$(SANE_TOOL_PATH_SQ):\
21672184
$(gitwebdir_SQ):$(PERL_PATH_SQ):$(SANE_TEXT_GREP):$(PAGER_ENV):\
@@ -2457,6 +2474,10 @@ endif
24572474
git-%$X: %.o GIT-LDFLAGS $(GITLIBS)
24582475
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
24592476

2477+
git-bugreport$X: bugreport.o GIT-LDFLAGS $(GITLIBS)
2478+
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
2479+
$(LIBS)
2480+
24602481
git-imap-send$X: imap-send.o $(IMAP_SEND_BUILDDEPS) GIT-LDFLAGS $(GITLIBS)
24612482
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
24622483
$(IMAP_SEND_LDFLAGS) $(LIBS)
@@ -2788,7 +2809,7 @@ $(SP_OBJ): %.sp: %.c GIT-CFLAGS FORCE
27882809
.PHONY: sparse $(SP_OBJ)
27892810
sparse: $(SP_OBJ)
27902811

2791-
EXCEPT_HDRS := command-list.h unicode-width.h compat/% xdiff/%
2812+
EXCEPT_HDRS := command-list.h config-list.h unicode-width.h compat/% xdiff/%
27922813
ifndef GCRYPT_SHA256
27932814
EXCEPT_HDRS += sha256/gcrypt.h
27942815
endif
@@ -2810,7 +2831,7 @@ hdr-check: $(HCO)
28102831
style:
28112832
git clang-format --style file --diff --extensions c,h
28122833

2813-
check: command-list.h
2834+
check: config-list.h command-list.h
28142835
@if sparse; \
28152836
then \
28162837
echo >&2 "Use 'make sparse' instead"; \

0 commit comments

Comments
 (0)