Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8053233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:46:44+00:00 2026-06-05T07:46:44+00:00

In the command line, if I type git tag –contains {commit} to obtain a

  • 0

In the command line, if I type

git tag --contains {commit}

to obtain a list of releases that contain a given commit, it takes around 11 to 20 seconds for each commit. Since the target code base there exists more than 300,000 commits, it would take a lot to retrieve this information for all commits.

However, gitk apparently manages to do a good job retrieving this data. From what I searched, it uses a cache for that purpose.

I have two questions:

  1. How can I interpret that cache format?
  2. Is there a way to obtain a dump from the git command line tool to generate that same information?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T07:46:45+00:00Added an answer on June 5, 2026 at 7:46 am

    You can get this almost directly from git rev-list.

    latest.awk:

    BEGIN { thiscommit=""; }
    $1 == "commit" {
        if ( thiscommit != "" )
            print thiscommit, tags[thiscommit]
        thiscommit=$2
        line[$2]=NR
        latest = 0;
        for ( i = 3 ; i <= NF ; ++i ) if ( line[$i] > latest ) {
            latest = line[$i];
            tags[$2] = tags[$i];
        }
        next;
    }
    $1 != "commit"  { tags[thiscommit] = $0; }
    END { if ( thiscommit != "" ) print thiscommit, tags[thiscommit]; }
    

    a sample command:

    git rev-list --date-order --children --format=%d --all | awk -f latest.awk
    

    you can also use --topo-order, and you’ll probably have to weed out unwanted refs in the $1!="commit" logic.

    Depending on what kind of transitivity you want and how explicit the listing has to be, accumulating the tags might need a dictionary. Here’s one that gets an explicit listing of all refs for all commits:

    all.awk:

    BEGIN {
        thiscommit="";
    }
    $1 == "commit" {
        if ( thiscommit != "" )
            print thiscommit, tags[thiscommit]
        thiscommit=$2
        line[$2]=NR
        split("",seen);
        for ( i = 3 ; i <= NF ; ++i ) {
            nnew=split(tags[$i],new);
            for ( n = 1 ; n <= nnew ; ++n ) {
                if ( !seen[new[n]] ) {
                    tags[$2]= tags[$2]" "new[n]
                    seen[new[n]] = 1
                }
            }
        }
        next;
    }
    $1 != "commit"  {
        nnew=split($0,new,", ");
        new[1]=substr(new[1],3);
        new[nnew]=substr(new[nnew],1,length(new[nnew])-1);
        for ( n = 1; n <= nnew ; ++n )
            tags[thiscommit] = tags[thiscommit]" "new[n]
    
    }
    END { if ( thiscommit != "" ) print thiscommit, tags[thiscommit]; }
    

    all.awk took a few minutes to do the 322K linux kernel repo commits, about a thousand a second or something like that (lots of duplicate strings and redundant processing) so you’d probably want to rewrite that in C++ if you’re really after the complete cross-product … but I don’t think gitk shows that, only the nearest neighbors, right?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I found this command line search and replace example: find . -type f -print0
I want to run weka through the command line. I type in this command:
I have a small command-line application written in C that acts as a wrapper/launcher
In *nix many command line applications that accept file names as arguments accept pipes
There is any command line or .NET method that runs a process in the
If I type nant -help I receive help information about the various command-line options.
I'm running Leopard, xcode 3.1.3. When I type java at the command line I
p4.exe is the perforce command line tool (git/cvs/svn like tool). I am trying to
I am programming an application using the command line application output type to display
I'm pointing the .Net command line WSDL utility that ships with Visual Studio 2005

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.