diff mbox series

[2/4] .gitignore: remove dangling file

Message ID 20201201004649.57548-3-felipe.contreras@gmail.com (mailing list archive)
State Accepted
Commit 02b5aa5825feed6d26e82d827050c8f97c212212
Headers show
Series Random cleanups | expand

Commit Message

Felipe Contreras Dec. 1, 2020, 12:46 a.m. UTC
The library was removed 7 years ago on commit ae34ac126f. But not from
the .gitignore file.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 .gitignore | 1 -
 1 file changed, 1 deletion(-)

Comments

Junio C Hamano Dec. 1, 2020, 6:30 p.m. UTC | #1
Felipe Contreras <felipe.contreras@gmail.com> writes:

> The library was removed 7 years ago on commit ae34ac126f. But not from
> the .gitignore file.
>
> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> ---

Good eyes.  Any automation used here, or just mark I eyeballs?

>  .gitignore | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/.gitignore b/.gitignore
> index f85d02c854..7c5096aee5 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -135,7 +135,6 @@
>  /git-remote-ftps
>  /git-remote-fd
>  /git-remote-ext
> -/git-remote-testpy
>  /git-repack
>  /git-replace
>  /git-request-pull
Felipe Contreras Dec. 1, 2020, 11:32 p.m. UTC | #2
On Tue, Dec 1, 2020 at 12:30 PM Junio C Hamano <gitster@pobox.com> wrote:
>
> Felipe Contreras <felipe.contreras@gmail.com> writes:
>
> > The library was removed 7 years ago on commit ae34ac126f. But not from
> > the .gitignore file.
> >
> > Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> > ---
>
> Good eyes.  Any automation used here, or just mark I eyeballs?

Nope. Just switching to a very old branch prompted me to look at the
.gitignore file and I stumbled upon it.
Jeff King Dec. 2, 2020, 2:26 a.m. UTC | #3
On Tue, Dec 01, 2020 at 10:30:12AM -0800, Junio C Hamano wrote:

> Felipe Contreras <felipe.contreras@gmail.com> writes:
> 
> > The library was removed 7 years ago on commit ae34ac126f. But not from
> > the .gitignore file.
> >
> > Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> > ---
> 
> Good eyes.  Any automation used here, or just mark I eyeballs?

I was curious how hard it would be to find unused ones, and it is not
too bad:

  find * -type f |
  git check-ignore --stdin -v |
  perl -e '
    my $ignore_file = shift;
    while (<>) {
      /^\Q$ignore_file\E:(\d+)/ and $seen{$1} = 1;
    }
    open(my $fh, "<", $ignore_file);
    while (<$fh>) {
      print "$. $_" unless $seen{$.};
    }
  ' .gitignore

It turns up many hits, depending on what built cruft you have in your
directory (having a crufty state is nice because it shows which patterns
are used, but it also may mean you have leftover trash from old versions
that doesn't get built anymore, and which we wouldn't notice). So I
think a human has to apply some brain-power to the result to see which
ones are plausibly created by other people's environments.

You might want to revisit some of the old dist rules (do we still ever
build git-core-*? "make dist" doesn't seem to. Likewise, "make rpm" and
"make deb" are no more, so perhaps it's time to drop those ignores.

The one below didn't take much brain-power, though.

-- >8 --
Subject: [PATCH] gitignore: drop duplicate entry for git-sh-i18n

This was accidentally added by e00cf070a4 (git-sh-i18n.sh: add no-op
gettext() and eval_gettext() wrappers, 2011-05-14), even though an
earlier commit in the same series had already done so.

Signed-off-by: Jeff King <peff@peff.net>
---
 .gitignore | 1 -
 1 file changed, 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index f85d02c854..d20d4afc1d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -152,7 +152,6 @@
 /git-sh-i18n
 /git-sh-i18n--envsubst
 /git-sh-setup
-/git-sh-i18n
 /git-shell
 /git-shortlog
 /git-show
Felipe Contreras Dec. 2, 2020, 3:30 a.m. UTC | #4
On Tue, Dec 1, 2020 at 8:26 PM Jeff King <peff@peff.net> wrote:

> I was curious how hard it would be to find unused ones, and it is not
> too bad:
>
>   find * -type f |
>   git check-ignore --stdin -v |
>   perl -e '
>     my $ignore_file = shift;
>     while (<>) {
>       /^\Q$ignore_file\E:(\d+)/ and $seen{$1} = 1;
>     }
>     open(my $fh, "<", $ignore_file);
>     while (<$fh>) {
>       print "$. $_" unless $seen{$.};
>     }
>   ' .gitignore

Or to use a more modern language:

find * -type f |
  git check-ignore --stdin -v |
  ruby -e '
    $ignore_file = ARGV.first
    $seen = {}
    $stdin.each do |e|
      e =~ /^#{Regexp.quote($ignore_file)}:(\d+)/ and $seen[$1.to_i - 1] = true
    end
    ARGF.each_with_index do |e, i|
      print "#{i} #{e}" unless $seen[i]
    end
  ' .gitignore
diff mbox series

Patch

diff --git a/.gitignore b/.gitignore
index f85d02c854..7c5096aee5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -135,7 +135,6 @@ 
 /git-remote-ftps
 /git-remote-fd
 /git-remote-ext
-/git-remote-testpy
 /git-repack
 /git-replace
 /git-request-pull