From: Zoltan Klinger <zoltan.klinger@gmail.com>
To: GIT Mailing-list <git@vger.kernel.org>
Subject: Unused #include statements
Date: Thu, 15 Jan 2015 14:43:06 +1100 [thread overview]
Message-ID: <CAKJhZwR+iMYAMCxurgc7z2dhqoqx_RxV1G4Jh3phPAOGptp_XQ@mail.gmail.com> (raw)
Hello there,
Since reading a post [1] about removing some unnecessary #include statements
from a git C source file I've been intrigued to see how many more might be
lurking in the code base.
After a bit of digging around, my brute force approach of 'remove as many
#includes as possible while making sure the code still successfully compiles'
has returned the following results:
$ git diff --stat
alloc.c | 2 --
archive-zip.c | 1 -
archive.c | 1 -
argv-array.c | 1 -
bisect.c | 9 ---------
block-sha1/sha1.c | 2 --
branch.c | 1 -
builtin/add.c | 7 -------
builtin/annotate.c | 1 -
builtin/apply.c | 8 --------
builtin/archive.c | 3 ---
builtin/bisect--helper.c | 2 --
builtin/blame.c | 13 -------------
builtin/branch.c | 8 --------
builtin/bundle.c | 1 -
builtin/cat-file.c | 3 ---
builtin/check-attr.c | 2 --
builtin/check-ignore.c | 2 --
builtin/check-mailmap.c | 2 --
builtin/check-ref-format.c | 2 --
builtin/checkout-index.c | 2 --
builtin/checkout.c | 11 -----------
builtin/clean.c | 3 ---
builtin/clone.c | 10 ----------
builtin/column.c | 3 ---
builtin/commit-tree.c | 4 ----
builtin/commit.c | 13 -------------
builtin/config.c | 1 -
builtin/count-objects.c | 2 --
builtin/credential.c | 1 -
builtin/describe.c | 5 -----
builtin/diff-files.c | 4 ----
builtin/diff-index.c | 4 ----
builtin/diff-tree.c | 4 ----
builtin/diff.c | 6 ------
builtin/fast-export.c | 8 --------
builtin/fetch.c | 8 --------
builtin/fmt-merge-msg.c | 6 ------
builtin/for-each-ref.c | 6 ------
builtin/fsck.c | 7 -------
builtin/gc.c | 3 ---
builtin/get-tar-commit-id.c | 3 ---
builtin/grep.c | 6 ------
builtin/hash-object.c | 2 --
builtin/help.c | 2 --
builtin/index-pack.c | 5 -----
builtin/init-db.c | 1 -
builtin/interpret-trailers.c | 3 ---
builtin/log.c | 14 --------------
builtin/ls-files.c | 3 ---
builtin/ls-remote.c | 3 ---
builtin/ls-tree.c | 3 ---
builtin/mailinfo.c | 2 --
builtin/mailsplit.c | 3 ---
builtin/merge-base.c | 5 -----
builtin/merge-file.c | 2 --
builtin/merge-index.c | 1 -
builtin/merge-ours.c | 1 -
builtin/merge-recursive.c | 3 ---
builtin/merge-tree.c | 2 --
builtin/merge.c | 10 ----------
builtin/mktree.c | 2 --
builtin/mv.c | 4 ----
builtin/name-rev.c | 3 ---
builtin/notes.c | 4 ----
builtin/pack-objects.c | 14 --------------
builtin/prune-packed.c | 1 -
builtin/prune.c | 5 -----
builtin/push.c | 6 ------
builtin/read-tree.c | 4 ----
builtin/receive-pack.c | 12 ------------
builtin/reflog.c | 5 -----
builtin/remote-ext.c | 1 -
builtin/remote-fd.c | 1 -
builtin/remote.c | 6 ------
builtin/repack.c | 6 ------
builtin/replace.c | 1 -
builtin/rerere.c | 4 ----
builtin/reset.c | 7 -------
builtin/rev-list.c | 7 -------
builtin/rev-parse.c | 5 -----
builtin/revert.c | 4 ----
builtin/rm.c | 4 ----
builtin/send-pack.c | 7 -------
builtin/shortlog.c | 7 -------
builtin/show-branch.c | 3 ---
builtin/show-ref.c | 5 -----
builtin/stripspace.c | 1 -
builtin/symbolic-ref.c | 1 -
builtin/tag.c | 4 ----
builtin/unpack-objects.c | 7 -------
builtin/update-index.c | 7 -------
builtin/update-ref.c | 3 ---
builtin/update-server-info.c | 1 -
builtin/upload-archive.c | 5 -----
builtin/verify-commit.c | 5 -----
builtin/verify-pack.c | 1 -
builtin/verify-tag.c | 5 -----
builtin/write-tree.c | 2 --
bulk-checkin.c | 3 ---
bundle.c | 5 -----
cache-tree.c | 2 --
check-racy.c | 1 -
column.c | 2 --
combine-diff.c | 6 ------
commit.c | 7 -------
compat/basename.c | 1 -
compat/fopen.c | 1 -
compat/gmtime.c | 1 -
compat/hstrerror.c | 3 ---
compat/inet_ntop.c | 1 -
compat/inet_pton.c | 1 -
compat/mingw.c | 7 -------
compat/mkdir.c | 1 -
compat/mkdtemp.c | 1 -
compat/mmap.c | 1 -
compat/msvc.c | 5 -----
compat/nedmalloc/nedmalloc.c | 2 --
compat/obstack.c | 1 -
compat/poll/poll.c | 6 ------
compat/pread.c | 1 -
compat/precompose_utf8.c | 1 -
compat/qsort.c | 1 -
compat/regex/regex.c | 2 --
compat/setenv.c | 1 -
compat/snprintf.c | 1 -
compat/strcasestr.c | 1 -
compat/strlcpy.c | 1 -
compat/strtoimax.c | 1 -
compat/strtoumax.c | 1 -
compat/terminal.c | 2 --
compat/unsetenv.c | 1 -
compat/win32/dirent.c | 1 -
compat/win32/pthread.c | 4 ----
compat/win32/syslog.c | 1 -
compat/win32mmap.c | 1 -
compat/winansi.c | 3 ---
config.c | 4 ----
connect.c | 4 ----
connected.c | 2 --
contrib/convert-objects/convert-objects.c | 4 ----
.../gnome-keyring/git-credential-gnome-keyring.c | 6 ------
.../credential/osxkeychain/git-credential-osxkeychain.c | 4 ----
contrib/credential/wincred/git-credential-wincred.c | 4 ----
contrib/examples/builtin-fetch--tool.c | 5 -----
contrib/svn-fe/svn-fe.c | 2 --
convert.c | 2 --
credential-cache--daemon.c | 2 --
credential-cache.c | 3 ---
credential-store.c | 1 -
credential.c | 1 -
csum-file.c | 1 -
daemon.c | 3 ---
diff-delta.c | 1 -
diff-lib.c | 5 -----
155 files changed, 562 deletions(-)
So my questions are as follows:
(1) Is it worth turning this into a proper patch?
(2) Given the large number of files (150+) what would be the best
approach in preparing the patch?
(a) One commit containing all the changes? Would it be a bit too much
to digest in one go?
(b) One commit per file changed? Feels a bit over the top also it
would flood the mailing list.
(c) One commit each for changes in the root directory, builtin,
compat and contrib directories?
Thanks,
Zoltan
[1] http://article.gmane.org/gmane.comp.version-control.git/262402
next reply other threads:[~2015-01-15 3:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-15 3:43 Zoltan Klinger [this message]
2015-01-15 4:14 ` Unused #include statements Robert Schiele
2015-01-15 6:33 ` Jeff King
2015-01-15 18:50 ` Junio C Hamano
2015-01-15 22:38 ` Jeff King
2015-01-15 23:20 ` Junio C Hamano
2015-01-16 0:00 ` Jeff King
2015-01-20 2:08 ` Zoltan Klinger
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=CAKJhZwR+iMYAMCxurgc7z2dhqoqx_RxV1G4Jh3phPAOGptp_XQ@mail.gmail.com \
--to=zoltan.klinger@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 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 NNTP newsgroup(s).