From: Junio C Hamano <gitster@pobox.com>
To: Kyle Lippincott <spectral@google.com>
Cc: git@vger.kernel.org, Calvin Wan <calvinwan@google.com>,
Jonathan Tan <jonathantanmy@google.com>,
Elijah Newren <newren@gmail.com>
Subject: Re: [PATCH] doc: clarify the wording on <git-compat-util.h> requirement
Date: Sat, 24 Feb 2024 14:54:26 -0800 [thread overview]
Message-ID: <xmqq7citlbh9.fsf@gitster.g> (raw)
In-Reply-To: <CAO_smVg4E4bENU18tiv8xnscnk46i=GW=Kq+xKvO1Nf7qCGy_A@mail.gmail.com> (Kyle Lippincott's message of "Sat, 24 Feb 2024 14:38:09 -0800")
Kyle Lippincott <spectral@google.com> writes:
> This "In addition" ties to the "are allowed to" 19 lines below, which
> was confusing for me until I intentionally ignored the "In addition",
> continued reading, and finally caught the other piece of it. Perhaps
> either `Exceptions:`, or something like `The following cases are
> allowed to assume that their header file includes "git-compat-util.h",
> and they do not have to include "git-compat-util.h" themselves:` -- I
> have a slight preference for the latter form, but I worry that the
> "These headers must be the first header file to be "#include"d in
> them" bit will be missed.
I'd appreciate people to help figuring out what the preamble should
read like to make it easier to follow.
> ... I don't know
> if we need the reasoning why you'd #include these files in the bullets
> below, which is why I didn't include it here. I'm assuming there's a
> concern about implying that builtin/foo.c should include builtin.h
> instead of git-compat-util.h (even if foo.c doesn't use cmd_foo()?).
It is more about helping folks new to the codebase understand the
reasoning behind the convention. As whoever implements "git foo" as
a built-in command is supposed to
- declare cmd_foo() in builtin.h
- add builtin/foo.c, define cmd_foo() there, and include builtin.h
- add "foo" and "cmd_foo" to git.c:commands[].
it is natural to expect any and all builtin/foo.c to include
builtin.h (hence it makes it convenient to allow an exception by
including compat-util in builtin.h to give everybody in builtin/
indirect access to compat-util).
But those who are not yet familar with the structure of the system
may not understand why it is natural. So, addition of "why is this
header allowed to be a substitute for which source files? Because
these source files are supposed to be including that header anyway"
is an important part of this patch.
Thanks.
prev parent reply other threads:[~2024-02-24 22:54 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-24 20:22 [PATCH] doc: clarify the wording on <git-compat-util.h> requirement Junio C Hamano
2024-02-24 22:36 ` [PATCH v2] " Junio C Hamano
2024-02-26 23:28 ` [PATCH v3] " Junio C Hamano
2024-02-26 23:57 ` Kyle Lippincott
2024-02-27 4:25 ` Elijah Newren
2024-02-27 5:35 ` Junio C Hamano
2024-02-24 22:38 ` [PATCH] " Kyle Lippincott
2024-02-24 22:54 ` Junio C Hamano [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq7citlbh9.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=calvinwan@google.com \
--cc=git@vger.kernel.org \
--cc=jonathantanmy@google.com \
--cc=newren@gmail.com \
--cc=spectral@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.