All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: git@vger.kernel.org, Stephen Boyd <bebarino@gmail.com>
Subject: Re: [PATCH] builtin: use builtin.h for all builtin/ commands
Date: Wed, 01 Sep 2010 10:43:19 -0700	[thread overview]
Message-ID: <7vmxs15phk.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <1283358207-3165-1-git-send-email-avarab@gmail.com> (=?utf-8?B?IsOGdmFyIEFybmZqw7Zyw7A=?= Bjarmason"'s message of "Wed\,  1 Sep 2010 16\:23\:27 +0000")

Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:

> Some builtin/*.c commands weren't using the builtin.h header, but
> instead manually imported headers like cache.h and commit.h which
> builtin.h would include for them.

> diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c
> index dbd8b7b..03abc30 100644
> --- a/builtin/fetch-pack.c
> +++ b/builtin/fetch-pack.c
> @@ -1,7 +1,6 @@
> -#include "cache.h"
> +#include "builtin.h"
>  #include "refs.h"
>  #include "pkt-line.h"
> -#include "commit.h"
>  #include "tag.h"
>  #include "exec_cmd.h"
>  #include "pack.h"

Leveraging the fact that builtin.h includes git-compat-util.h and cache.h
is fine and I think strbuf is also generic and pervasive enough to be
included in the mix, but in the longer term we would probably want to fix
builtin.h not to include it itself does not need, notably commit.h and
notes.h.

For example, the header currently defines notes related stuff, such as
notes_rewrite_cfg parse_combine_notes_fn, etc.  Shouldn't they belong to
notes.h?  And if we lose them, do we still need to include commit.h and
notes.h in builtin.h?

And when that happens, the inclusion of commit.h needs to come back to
this file, I think.

      reply	other threads:[~2010-09-01 17:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-01 14:17 Why isn't builtin.h used by all builtin/*.c files? Ævar Arnfjörð Bjarmason
2010-09-01 14:56 ` Stephen Boyd
2010-09-01 17:31   ` Junio C Hamano
2010-09-01 16:23 ` [PATCH] builtin: use builtin.h for all builtin/ commands Ævar Arnfjörð Bjarmason
2010-09-01 17:43   ` 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=7vmxs15phk.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=avarab@gmail.com \
    --cc=bebarino@gmail.com \
    --cc=git@vger.kernel.org \
    /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.