From a1ae90fc0dec5156aa89bd47bebe324124b3613c Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 18 Jul 2025 16:07:48 -0700 Subject: [PATCH] Meta: remove obviously stale, unused, and useless bits --- SR | 31 ------ TODO | 35 ------ UWC | 248 ------------------------------------------ WC | 56 ---------- WI | 76 ------------- count-contributors.sh | 73 ------------- genMaintNotes.perl | 102 ----------------- git-topic.perl | 218 ------------------------------------- 8 files changed, 839 deletions(-) delete mode 100755 SR delete mode 100644 TODO delete mode 100755 UWC delete mode 100755 WC delete mode 100755 WI delete mode 100755 count-contributors.sh delete mode 100755 genMaintNotes.perl delete mode 100755 git-topic.perl diff --git a/SR b/SR deleted file mode 100755 index 4299205db0..0000000000 --- a/SR +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh - -short= -case "$1" in --short|-s) short=t; shift ;; esac - -parse_version=' - s/^\(v[.0-9]*\)\(-\([1-9][0-9]*\)-g\([0-9a-f][0-9a-f]*\)\)*$/v=\1 n=\3 r=\4/ -' - -git for-each-ref --format='%(refname)' refs/heads/maint\* | -sed -e 's|^refs/heads/||' -e '/^maint[^-]/d' | -while read track -do - case "$short" in - t) - echo "$track $(git describe "refs/heads/$track")" - ;; - *) - v= n= r= - eval $(git describe "refs/heads/$track" | sed -e "$parse_version") - - echo "* $v..$track" - case "$n" in - "") - ;; - *) - git --no-pager shortlog --no-merges "$v..$track" - ;; - esac - esac -done diff --git a/TODO b/TODO deleted file mode 100644 index 1366509c9e..0000000000 --- a/TODO +++ /dev/null @@ -1,35 +0,0 @@ -The GIT To-Do File -================== - -The latest copy of this document is found at - - http://kernel.org/git/?p=git/git.git;a=blob;hb=todo;f=TODO - http://repo.or.cz/w/alt-git.git?a=blob;hb=todo;f=TODO - ----------------------------------------------------------------- - -gmane=http://thread.gmane.org/gmane.comp.version-control.git/ - -* Teach pack protocol to transfer estimated pack size and history - depth to allow receiving end make more intelligent decision between - unpack-objects and index-pack. - - $gmane/173610 - -* Audit use of symbolic-ref without -m in our scripts and for each - case decide if leaving a reflog entry for the HEAD is desirable. - If so, add them. - - $gmane/172516 - -* "git status" on intent-to-add index entries (say "I" in the first - column instead of "A" for short status, add "(needs 'git add')" at the - end of "new file: $path " in long status). - - $gmane/170658 - -* synopsys: use {} instead of () for grouping alternatives (Jari Aalto) - $gmane/72243 - -* "[alias] st = status" and "cd .git && git st" (Jeff King) - $gmane/72327 diff --git a/UWC b/UWC deleted file mode 100755 index 7a513af2ee..0000000000 --- a/UWC +++ /dev/null @@ -1,248 +0,0 @@ -#!/usr/bin/perl -w -# -# Update an older edition of What's Cooking with the latest data. -# -# Usage: UWC [--keep-master] [ old [ new ] ] -# -# Giving no parameter is the same as giving a single "-" to the command. -# -# The command reads the old edition of (annotated) "What's Cooking" -# message from "old", and "new". If "old" is "-", it is read from -# the standard input. If "new" is not specified, WC script is run -# and its output is used. -# -# An annotated "What's Cooking" message can have group header (a line -# that has the group name enclosed in "[" and "]"), and annotatation -# paragraphs after each topic's commit list, in addition to the bare -# "WC" output. -# -# The group headers, topics in each group and their order in the group, -# and annotation to topics are preserved from the "old" message. The -# list of commits in each topic is replaced with the one taken from the -# "new" message. Any topic in "new" that did not exist in "old" appear -# in "New Topics" group. Also, topics that do not appear in the "new" -# message are marked with <>, topics whose commit list are -# different from "old" are marked with <>>. -# -# Typically the maintainer would place the What's Cooking message -# previously sent in a buffer in Emacs, and filter the buffer contents -# with this script, to prepare an up-to-date message. - -my $keep_master = 1; - -sub parse_whats_cooking { - my ($fh) = @_; - my $head = undef; - my $group = undef; - my %wc = ("group list" => [], "topic hash" => {}); - my $topic; - my $skipping_comment = 0; - - while (<$fh>) { - if (/^-{40,}$/) { - # Group separator - next; - } - - if (!defined $head) { - if (/^Here are the topics that have been/) { - $head = $_; - } - next; - } - - if (/^<<.*>>$/) { - next; - } - - if ($skipping_comment) { - if (/^>>$/) { - $skipping_comment = 0; - } - next; - } - - if (!$skipping_comment && /^< $1, - head => $_, - names => "", - text => "", - }; - $wc{"topic hash"}{$topic->{"topic"}} = $topic; - push @{$wc{" $group"}}, $topic; - next; - } - - if (/^ [-+.?*] / || /^ \S/) { - $topic->{"names"} .= $_; - next; - } - $topic->{"text"} .= $_; - } - - for ($head) { - s/\A\s+//s; - s/\s+\Z//s; - } - $wc{"head text"} = $head; - for $topic (values %{$wc{"topic hash"}}) { - for ($topic->{"text"}) { - s/\A\s+//s; - s/\s+\Z//s; - } - } - return \%wc; -} - -sub print_whats_cooking { - my ($wc) = @_; - - print $wc->{"head text"}, "\n"; - - for my $group (@{$wc->{"group list"}}) { - print "\n", "-" x 64, "\n"; - print "[$group]\n"; - for my $topic (@{$wc->{" $group"}}) { - next if ($topic->{"head"} eq ''); - print "\n", $topic->{"head"}; - print $topic->{"names"}; - if ($topic->{"text"} ne '') { - print "\n", $topic->{"text"}, "\n"; - } - } - } -} - -sub delete_topic { - my ($wc, $topic) = @_; - $topic->{"status"} = "deleted"; -} - -sub merge_whats_cooking { - my ($old_wc, $new_wc) = @_; - my $group; - my @gone = (); - - for $group (@{$old_wc->{"group list"}}) { - for my $topic (@{$old_wc->{" $group"}}) { - my $name = $topic->{"topic"}; - my $newtopic = delete $new_wc->{"topic hash"}{$name}; - - if (!defined $newtopic) { - push @gone, +{ @{[ %$topic ]} }; - $topic->{"text"} = ""; - $topic->{"names"} = ""; - $topic->{"head"} = ""; - next; - } - if (($newtopic->{"names"} ne $topic->{"names"}) || - ($newtopic->{"head"} ne $topic->{"head"})) { - my $text = ("<{"head"} . - $topic->{"names"} . ">>"); - - if ($topic->{"text"} ne '') { - $text .= "\n\n" . $topic->{"text"}; - } - for ($text) { - s/\A\s+//s; - s/\s+\Z//s; - } - $topic->{"text"} = $text; - $topic->{"names"} = $newtopic->{"names"}; - $topic->{"head"} = $newtopic->{"head"}; - } - } - } - - - $group = 'Graduated to "master"'; - if (!$keep_master) { - print STDERR "Not Keeping Master\n"; - my $o = delete $old_wc->{" $group"}; - for (@$o) { - print STDERR " Dropping: ", $_->{'topic'}, "\n"; - } - print STDERR "Gone are\n"; - for (@gone) { - print STDERR " Gone: ", $_->{'topic'}, "\n"; - } - } - if (@gone) { - if (!exists $old_wc->{" $group"}) { - unshift @{$old_wc->{"group list"}}, $group; - $old_wc->{" $group"} = []; - } - push @{$old_wc->{" $group"}}, @gone; - } - if (%{$new_wc->{"topic hash"}}) { - $group = "New Topics"; - if (!exists $old_wc->{" $group"}) { - unshift @{$old_wc->{"group list"}}, $group; - $old_wc->{" $group"} = []; - } - for my $topic (values %{$new_wc->{"topic hash"}}) { - my $name = $topic->{"topic"}; - $old_wc->{"topic hash"}{$name} = $topic; - push @{$old_wc->{" $group"}}, $topic; - $topic->{"text"} = $topic->{"text"}; - } - } -} - -if (@ARGV == 0) { - @ARGV = ('-'); -} elsif ($ARGV[0] eq '--keep-master') { - $keep_master = 1; - shift; -} -if (@ARGV != 2 && @ARGV != 1) { - die "Usage: $0 old [new]\n"; -} - -my ($old_wc, $new_wc); - -if ($ARGV[0] eq '-') { - *FH = *STDIN; -} else { - open FH, "$ARGV[0]"; -} -$old_wc = parse_whats_cooking(\*FH); -close FH; - -if (@ARGV > 1) { - open FH, "$ARGV[1]"; -} else { - open FH, "Meta/WC generate |"; -} -$new_wc = parse_whats_cooking(\*FH); -close FH; - -merge_whats_cooking($old_wc, $new_wc); -print_whats_cooking($old_wc); diff --git a/WC b/WC deleted file mode 100755 index 75298e88af..0000000000 --- a/WC +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/sh -# Prepare "What's cooking in git.git" - -master_at=$(git rev-parse --verify refs/heads/master) -next_at=$(git rev-parse --verify refs/heads/next) - -keep_master= -case "$1" in -generate) - echo Here are the topics that have been - echo - Meta/git-topic.perl --base=master | sed -e 's/^\*./\n*/' - exit - ;; -keep) - keep_master=--keep-master - ;; -esac - -eval $(LC_ALL=C date +"monthname=%b month=%m year=%Y date=%d dow=%a") - -lead="whats/cooking/$year/$month" -issue=$( - cd Meta && - git ls-tree -r --name-only HEAD "$lead" | tail -n 1 -) -if test -n "$issue" -then - issue=$( expr "$issue" : '.*/0*\([1-9][0-9]*\)\.txt$' ) - issue=$(( $issue + 1 )) -else - issue=1 -fi -issue=$( printf "%02d" $issue ) -mkdir -p "Meta/$lead" - -exec >"Meta/$lead/$issue.txt" - -cat <"Meta/$lead/$issue.txt" - -cat </dev/null` -a= -if test -n "$list" -then - echo - echo "* The 'maint' branch has these fixes since the last announcement." - echo - log $tagged heads/maint - a=' - in addition to the above.' -else - a=. -fi - -tagged=`git rev-parse --not --verify hold/sa/master` -list=`git rev-list $tagged refs/heads/master 2>/dev/null` -if test -n "$list" -then - echo - echo "* The 'master' branch has these since the last announcement$a" - echo - log $tagged heads/master ^heads/maint -fi diff --git a/count-contributors.sh b/count-contributors.sh deleted file mode 100755 index 4ee57f57f8..0000000000 --- a/count-contributors.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh - -LC_ALL=C LANG=C -export LC_ALL LANG - -fmt="%-10s | %7d %7d %7d | %7d %7d | %-10s\n" -hfmt=$(printf "%s" "$fmt" | sed -e 's/d/s/g') -head=$(printf "$hfmt" release new this total this total date) - -old= ocommitcnt= -git for-each-ref --format='%(refname:short)' refs/tags/ | -perl -w -e ' - use strict; - my @version = (); - my %asked = map { $_ => $_ } @ARGV; - - while () { - next unless (/^(v(\d+)\.(\d+)(?:\.(\d+))?(?:-rc(\d+))?)$/); - # $1 = tag == v$2.$3(.$4)?(-rc$5)? - - if (exists $asked{$1}) { - ; # ok - } elsif (defined $5) { - # skip -rc releases - next; - } elsif ($2 == 0) { - # not worth showing breakdown during v0.99 period - next unless ($1 eq "v0.99"); - } elsif ($2 == 1) { - # not worth showing breakdown before v1.4.0 - next if ($3 < 4 && $4); - } - push @version, [$1, $2, $3, $4, $5]; - } - for (sort { ( - $a->[1] <=> $b->[1] || - $a->[2] <=> $b->[2] || - $a->[3] <=> $b->[3] || - ( (defined $a->[4] && defined $b->[4]) - ? $a->[4] <=> $b->[4] - : defined $a->[4] - ? -1 : 1 ) ); } @version) { - print $_->[0], "\n"; - } -' "$@" | -while read new -do - commitcnt=$(git rev-list --no-merges "$new" | wc -l) - git shortlog -s -n "$new" | - sed -e 's/^[ 0-9]*//' | - sort >/var/tmp/new - if test -n "$old" - then - comm -13 /var/tmp/old /var/tmp/new >"/var/tmp/cont-$new" - i=$(git shortlog -s -n "$old..$new" | - sed -e 's/^[ 0-9]*//' | - wc -l) - cc=$(( $commitcnt - $ocommitcnt )) - else - i=$(wc -l "/var/tmp/cont-$new" - cc=$(( $commitcnt + 0 )) - fi - old=$new - mv /var/tmp/new /var/tmp/old - n=$(wc -l <"/var/tmp/cont-$new") - c=$(wc -l <"/var/tmp/old") - t=$(git show -s --format="%ci" "$old^0" | sed -e "s/ .*//") - ocommitcnt=$commitcnt - test -z "$head" || echo "$head" - printf "$fmt" $new $n $i $c $cc $commitcnt $t - head= -done diff --git a/genMaintNotes.perl b/genMaintNotes.perl deleted file mode 100755 index 9b470a7816..0000000000 --- a/genMaintNotes.perl +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/perl -w - -print <<'EOF' ; - - -EOF - -sub show_links { - local ($_) = @_; - my $br = ''; - for (split(/\n/, $_)) { - s/^\s*//; - s/\s*\Z//; - my $url = $_; - my $comment = $_; - $url =~ s/ .*//; - if ($url =~ /^http:/) { - print "$br$comment"; - } else { - print "$br$comment"; - } - $br = "
\n"; - } - print "\n"; -} - -sub show_commands { - local ($_) = @_; - my $br = ''; - for (split(/\n/, $_)) { - s/^\s*//; - s/\s*\Z//; - print "$br$_"; - $br = "
\n"; - } - print "\n"; -} - -my $in_ul; -$/ = ""; -while (<>) { - $_ =~ s/\n+$//s; - - if (/^ - /) { - if (!$in_ul) { - $in_ul = 1; - print "
    \n"; - } - s/^ - //; - print "
  • $_
  • \n"; - next; - } - - if ($in_ul) { - $in_ul = undef; - print "
\n\n"; - } - - if (s/^\*\s*//) { - print "

$_

\n\n"; - } elsif (s/^ {4,}//) { - print "
\n"; - if (/^(http|git|nntp):\/\//) { - show_links($_); - } else { - show_commands($_); - } - print "
\n\n"; - } else { - print "

$_

\n\n"; - } -} diff --git a/git-topic.perl b/git-topic.perl deleted file mode 100755 index 7adc243e82..0000000000 --- a/git-topic.perl +++ /dev/null @@ -1,218 +0,0 @@ -#!/usr/bin/perl -w -# -# Copyright (c) 2006 Junio C Hamano -# - -use strict; -use Getopt::Long; - -my $topic_pattern = '??*/*'; -my $base = 'next'; -my @stage = qw(next seen); -my @mark = ('.', '?', '-', '+'); -my $all = 0; -my $merges = 0; -my $tests = 0; - -my @custom_stage; -my @custom_mark; -GetOptions("topic=s" => \$topic_pattern, - "base=s" => \$base, - "stage=s" => \@custom_stage, - "mark=s" => \@custom_mark, - "merges!" => \$merges, - "tests!" => \$tests, - "all!" => \$all) - or die; - -if (@custom_stage) { @stage = @custom_stage; } -if (@custom_mark) { @mark = @custom_mark; } -my @nomerges = $merges ? qw(--no-merges) : (); - -sub read_revs_short { - my (@args) = @_; - my @revs; - open(REVS, '-|', qw(git rev-list), @nomerges, @args) - or die; - while () { - chomp; - push @revs, $_; - } - close(REVS); - return @revs; -} - -sub read_revs { - my ($bottom, $top, $mask) = @_; - my @revs; - open(REVS, '-|', qw(git rev-list --pretty=oneline), @nomerges, - "$bottom..$top") - or die; - while () { - chomp; - my ($sha1, $topic) = /^([0-9a-f]{40}) (.*)$/; - push @revs, [$sha1, $topic, $mask]; - } - close(REVS); - return @revs; -} - -sub rebase_marker { - my ($topic, $stage, $in_next) = @_; - my @not_in_topic = read_revs_short('^master', "^$topic", "$stage"); - - # @$in_next is what is in $stage but not in $base. - # @not_in_topic excludes what came from $topic from @$in_next. - # $topic can be rebased if these two set matches, because - # no commits in $topic has been merged to $stage yet. - if (@not_in_topic != @$in_next) { - # we cannot rebase it anymore - return ' '; - } - if (read_revs_short('master', "^$topic")) { - # there is something that is in master but not in topic. - return '^'; - } - # topic is up to date. - return '*'; -} - -my %atlog_next = (); -my %atlog_test = (); - -sub next_marker { - my ($topic) = @_; - return '' if (!$tests); - return '??' if (!exists $atlog_next{$topic}); - for ($atlog_next{$topic}) { - my ($merge, $test) = ('*', '*'); - if (/rerere ok/) { - $merge = 'R'; - } elsif (/conflict (\d+)/) { - if ($1 < 10) { - $merge = $1; - } else { - $merge = 'X'; - } - } - $test = 'X' if (/test error/); - return "$merge$test"; - } -} - -sub test_marker { - my ($commit) = @_; - return '' if (!$tests); - my $tree = `git rev-parse "$commit^{tree}"`; - chomp($tree); - return "?" if (!exists $atlog_test{$tree}); - for ($atlog_test{$tree}) { - if (/build error/) { - return 'B'; - } elsif (/test error/) { - return 'X'; - } else { - return ' '; - } - } -} - -sub describe_topic { - my ($topic) = @_; - - open(CONF, '-|', qw(git repo-config --get), - "branch.$topic.description") - or die; - my $it = join('',); - close(CONF); - chomp($it); - if ($it) { - wrap_print(" $it"); - } -} - -my @in_next = read_revs_short('^master', $stage[0]); -my @topic = (); - -my @topic_pattern = map { "refs/heads/$_" } (@ARGV ? @ARGV : $topic_pattern); - -open(TOPIC, '-|', qw(git for-each-ref), - '--sort=-authordate', - '--format=%(objectname) %(authordate) %(refname)', - @topic_pattern) - or die; - -while () { - chomp; - my ($sha1, $date, $topic) = m|^([0-9a-f]{40})\s(.*?)\srefs/heads/(.+)$| - or next; - push @topic, [$sha1, $date, $topic]; -} -close(TOPIC); - -if (open(AT, "Meta/AT.log")) { - my $next = `git rev-parse --verify refs/heads/next`; - chomp $next; - while () { - if (/^N (.{40}) (.{40}) (.*)$/ && $1 eq $next) { - $atlog_next{$2} = $3; - next; - } - if (/^A (.{40}) (.*)/) { - $atlog_test{$1} = $2; - next; - } - } - close(AT); -} - -my @last_merge_to_next = (); - -for (@topic) { - my ($sha1, $date, $topic) = @$_; - my @revs = read_revs($base, $sha1, (1<<@stage)-1); - next unless (@revs || $all); - - my %revs = map { $_->[0] => $_ } @revs; # fast index - for (my $i = 0; $i < @stage; $i++) { - for my $item (read_revs_short("^$stage[$i]", $sha1)) { - if (exists $revs{$item}) { - $revs{$item}[2] &= ~(1 << $i); - } - } - } - - print '*' . - next_marker($sha1) . - rebase_marker($sha1, $stage[0], \@in_next); - my $count = ""; - if (1 < @revs) { - $count = " " . (scalar @revs) . " commits"; - } - elsif (@revs) { - $count = " 1 commit"; - } - print " $topic ($date)$count\n"; - describe_topic($topic); - for my $item (@revs) { - my $mark = $item->[2]; - if ($mark < @mark) { - $mark = $mark[$mark]; - } - if ($tests) { - $mark = test_marker($item->[0]) . $mark; - } - wrap_print("$mark $item->[1]"); - } -} - -sub wrap_print { - my ($string) = @_; - format STDOUT = -~^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< - $string - ~~^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< - $string -. - write; -} -- 2.47.3