{"thread":{"id":"2293","subject":"[PATCH] Remove git-findtags.perl","startedAt":"2005-11-01T20:26:03Z","lastAt":"2005-11-01T21:15:01Z","messageCount":2,"participants":["Petr Baudis","Martin Langhoff"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"10944","messageId":"20051101202603.16900.9063.stgit@machine.or.cz","threadId":"2293","inReplyTo":null,"subject":"[PATCH] Remove git-findtags.perl","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2005-11-01T20:26:03Z","receivedAt":"2005-11-01T20:26:03Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"This script was superseded by git-name-rev, which is more versatile,\nactually documented, faster, and everything else...\n\nSigned-off-by: Petr Baudis <pasky@suse.cz>\n---\n\n Makefile          |    2 +\n git-findtags.perl |   94 -----------------------------------------------------\n 2 files changed, 1 insertions(+), 95 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 644b517..a2ba886 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -94,7 +94,7 @@ SCRIPT_SH = \\\n SCRIPT_PERL = \\\n \tgit-archimport.perl git-cvsimport.perl git-relink.perl \\\n \tgit-rename.perl git-shortlog.perl git-fmt-merge-msg.perl \\\n-\tgit-findtags.perl git-svnimport.perl git-mv.perl\n+\tgit-svnimport.perl git-mv.perl\n \n SCRIPT_PYTHON = \\\n \tgit-merge-recursive.py\ndiff --git a/git-findtags.perl b/git-findtags.perl\ndeleted file mode 100755\nindex 745affe..0000000\n--- a/git-findtags.perl\n+++ /dev/null\n@@ -1,94 +0,0 @@\n-#!/usr/bin/perl -w\n-#\n-# Copyright (c) 2005 Martin Langhoff\n-#\n-# Walk the tags and find if they match a commit\n-# expects a SHA1 of a commit. Option -t enables \n-# searching trees too.\n-#\n-\n-use strict;\n-use File::Basename;\n-use File::Find;\n-use Getopt::Std;\n-\n-my $git_dir = $ENV{GIT_DIR} || '.git';\n-$git_dir =~ s|/$||; # chomp trailing slash\n-\n-# options\n-our $opt_t;\n-getopts(\"t\") || usage();\n-\n-my @tagfiles   = `find $git_dir/refs/tags -follow -type f`; # haystack\n-my $target = shift @ARGV;                     # needle\n-unless ($target) {\n-    usage();\n-}\n-\n-# drive the processing from the find hook\n-# slower, safer (?) than the find utility\n-find( { wanted   => \\&process,\n-\tno_chdir => 1,\n-\tfollow   => 1,\n-      }, \"$git_dir/refs/tags\");\n-\n-\n-sub process {\n-    my ($dev,$ino,$mode,$nlink,$uid,$gid);\n-\n-    # process only regular files\n-    unless ((($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) && -f _) {\n-\treturn 1; # ignored anyway\n-    }\n-\n-    my $tagfile = $_;\n-    chomp $tagfile;\n-    my $tagname = substr($tagfile, length($git_dir.'/refs/tags/'));\n-\n-    my $tagid = quickread($tagfile);\n-    chomp $tagid;\n-\n-    # is it just a soft tag?\n-    if ($tagid eq $target) {\n-\tprint \"$tagname\\n\";\n-\treturn 1; # done with this tag\n-    }\n-\n-    # grab the first 2 lines (the whole tag could be large)\n-    my $tagobj = `git-cat-file tag $tagid | head -n2 `;\n-    if ($tagobj =~  m/^type commit$/m) { # only deal with commits\n-\n-\tif ($tagobj =~ m/^object $target$/m) { # match on the commit\n-\t    print \"$tagname\\n\";\n-\n-\t} elsif ( $opt_t &&                      # follow the commit\n-\t\t $tagobj =~ m/^object (\\S+)$/m) { # and try to match trees\n-\t    my $commitid = $1;\n-\t    my $commitobj = `git-cat-file commit $commitid | head -n1`;\n-\t    chomp $commitobj;\n-\t    $commitobj =~ m/^tree (\\S+)$/;\n-\t    my $treeid = $1;\n-\t    if ($target eq $treeid) {\n-\t\tprint \"$tagname\\n\";\n-\t    }\n-\t}\n-    }\n-}\n-\n-sub quickread {\n-    my $file = shift;\n-    local $/; # undef: slurp mode\n-    open FILE, \"<$file\"\n-\tor die \"Cannot open $file : $!\";\n-    my $content = <FILE>;\n-    close FILE;\n-    return $content;\n-}\n-\n-sub usage {\n-\tprint STDERR <<END;\n-Usage: ${\\basename $0}     # find tags for a commit or tree\n-       [ -t ] <commit-or-tree-sha1>\n-END\n-\texit(1);\n-}\n"},{"id":"10947","messageId":"46a038f90511011315s9d80730obba422f5a44360d7@mail.gmail.com","threadId":"2293","inReplyTo":"20051101202603.16900.9063.stgit@machine.or.cz","subject":"Re: [PATCH] Remove git-findtags.perl","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2005-11-01T21:15:01Z","receivedAt":"2005-11-01T21:15:01Z","isPatch":true,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"On 11/2/05, Petr Baudis <pasky@suse.cz> wrote:\n> This script was superseded by git-name-rev, which is more versatile,\n> actually documented, faster, and everything else...\n\nDefinitely! I hadn't registered the addition of git-name-rev, but it\nseems to be a much better solution.\n\ncheers!\n\n\nmartin\n"}]}