git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Ben Boeckel <mathstuf@gmail.com>
To: git@vger.kernel.org
Cc: "Ben Boeckel" <mathstuf@gmail.com>, "Jeff King" <peff@peff.net>,
	"Junio C Hamano" <gitster@pobox.com>,
	"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: [PATCH v1 0/6] globals: clean up some global usages
Date: Fri, 30 Jul 2021 22:42:15 -0400	[thread overview]
Message-ID: <20210731024221.2113906-1-mathstuf@gmail.com> (raw)

Hi,

This patchset moves a few of the configuration parsing functions around
so that they live in the source file which uses the variables that are
initialized through those functions. This allows the variables involved
to be `static` rather than global variables.

Additionally, a global which is only written to is removed
(`core_compression_level`), a file-local variable declared `extern` is
now `static`, and explicit `0` initialization of globals is removed.

In the course of making this patch, I found a number of other global
variables which could be moved into being static if more configuration
parsing functions were created and moved to the relevant file instead of
being parsed as part of, say, "all `core.*` settings" in a single
function. If wanted, I can prepare a patchset for these as well (or
provide the list for discussion of how best to proceed, but it is
currently just stored in a WIP commit I have locally as comments on each
variable).

Thanks,

--Ben

---

Ben Boeckel (6):
  branch: move `git_default_branch_config` to `branch.c`
  mailmap: move `git_default_mailmap_config` to `mailmap.c`
  apply: move `apply_default_*whitespace` to `apply.c`
  config: remove `core_compression_level`
  refs/debug: declare file-local variable to be static
  globals: remove explicit `0` initialization from globals

 apply.c       |  3 +++
 branch.c      | 32 ++++++++++++++++++++++++++++++++
 branch.h      |  5 +++++
 cache.h       |  6 ------
 config.c      | 43 +------------------------------------------
 environment.c |  4 ----
 mailmap.c     | 16 ++++++++++++++--
 mailmap.h     |  2 ++
 object-file.c |  2 +-
 progress.c    |  2 +-
 refs/debug.c  |  4 ++--
 11 files changed, 61 insertions(+), 58 deletions(-)


base-commit: eb27b338a3e71c7c4079fbac8aeae3f8fbb5c687
-- 
2.31.1


             reply	other threads:[~2021-07-31  2:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-31  2:42 Ben Boeckel [this message]
2021-07-31  2:42 ` [PATCH v1 1/6] branch: move `git_default_branch_config` to `branch.c` Ben Boeckel
2021-07-31  2:42 ` [PATCH v1 2/6] mailmap: move `git_default_mailmap_config` to `mailmap.c` Ben Boeckel
2021-07-31  2:42 ` [PATCH v1 3/6] apply: move `apply_default_*whitespace` to `apply.c` Ben Boeckel
2021-07-31  2:42 ` [PATCH v1 4/6] config: remove `core_compression_level` Ben Boeckel
2021-07-31  2:42 ` [PATCH v1 5/6] refs/debug: declare file-local variable to be static Ben Boeckel
2021-07-31  2:42 ` [PATCH v1 6/6] globals: remove explicit `0` initialization from globals Ben Boeckel

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210731024221.2113906-1-mathstuf@gmail.com \
    --to=mathstuf@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pclouds@gmail.com \
    --cc=peff@peff.net \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).