git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCh] jit-trackdown

From
Junio C Hamano <junkio@cox.net>
Date
Apr 29, 2005, 18:47 UTC
Message-ID
<7voebx4dyd.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<42725AB8.5090501@dgreaves.com>
>>>>> "DG" == David Greaves <david@dgreaves.com> writes:
DG> Should really be cg-trackdown
Thanks for your kind words and the patch.
     head="$1"
    +if [ $head == "HEAD" ]; then
    +  head=$(cat .git/HEAD)
    +elif [ -f .git/refs/tags/$head ]; then
    +  head=$(cat .git/refs/tags/$head)
    +elif [ -f .git/refs/heads/$head ]; then
    +  head=$(cat .git/refs/heads/$head)
    +fi
    +

I have been primarily looking at the plumbing side and not the toilet side, and I still have not grokked cg-* yet. That's why I did not do the right thing with these .git/refs/* stuff. If this were to become part of cg-* suite, I would recommend just using $(commit-id) there, which should be the only one that needs to know the .git/* structure convention.

Have toilet side gitters reached a concensus (or semi-concensus) on how things under .git/ should be organized? Is there a summary somewhere, something along the following lines?

    In subdirectories under $GIT_PROJECT_TOP/.git, you have
    files that have some special meaning to the Cogito layer.
    These files are all 41-byte long, which stores a 40-byte
    SHA1 with terminating newline.  What is stored in each
    location is as follows:
    .git/HEAD           	Head commit object of the
                                current tree. 
    .git/refs/heads/$ext	Head commit object of the
                                external tree $ext.  [*Q1*]
    .git/refs/tags/$tag		Named Tag object. [*Q2*]
    *Q1* What is the syntax and semantics rule for $ext, like
         "$ext matches '^[-A-Za-z0-9_]$' and is one of the
         entries in .git/remotes"?
    *Q2* What is the syntax and semantics rule for $tag, like
         "$tag matches '^[-A-Za-z0-9_]$' and can be anything not
         just commit"?
Previous: David GreavesNext: Daniel Barkalow
Message 2 of 4 in “jit-trackdown”
  1. jit-trackdownDavid Greaves, Apr 29, 2005
  2. Junio C HamanoApr 29, 2005
  3. Daniel BarkalowApr 29, 2005
  4. Junio C HamanoApr 29, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.