git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: "Dr. David Alan Gilbert" <dave@treblig.org>
Cc: git@vger.kernel.org, jonathantanmy@google.com, gitster@pobox.com
Subject: Re: [PATCH] fetch-pack: Remove unused struct 'loose_object_iter'
Date: Wed, 15 May 2024 02:46:58 -0400	[thread overview]
Message-ID: <20240515064658.GE110841@coredump.intra.peff.net> (raw)
In-Reply-To: <20240512005913.342287-1-dave@treblig.org>

On Sun, May 12, 2024 at 01:59:13AM +0100, Dr. David Alan Gilbert wrote:

> 'loose_object_iter' in fetch-pack.c is unused since
> commit 97b2fa08b6b9ee3e ("fetch-pack: drop custom loose object cache")
> Remove it.

Thanks, this was my fault for leaving it in. The patch looks obviously
good.

I wish there was a good way to get the compiler to report on unused
types, but I don't think there is (it's a complicated problem in
general, but file-local ones like this feel like they should be easy to
spot).

Here's a really hacky (and quadratic) attempt to find defined structs
that aren't mentioned elsewhere:

  for i in $(git grep -ho '^struct [a-z_]* {' | cut -d' ' -f2)
  do
	used=$(git grep -Phc "\b$i\b" |
	       perl -ne '$x += $_; END { print $x }')
	echo "$used $i"
  done |
  sort -n

which finds exactly one unused struct, the one in this patch.

-Peff


  parent reply	other threads:[~2024-05-15  7:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-12  0:59 [PATCH] fetch-pack: Remove unused struct 'loose_object_iter' Dr. David Alan Gilbert
2024-05-13 10:02 ` Patrick Steinhardt
2024-05-13 23:56   ` Junio C Hamano
2024-05-15  6:46 ` Jeff King [this message]
2024-05-15 10:41   ` Dr. David Alan Gilbert

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=20240515064658.GE110841@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=dave@treblig.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jonathantanmy@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.
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).