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

Re: [RFC] git cat-file "literally" option

From
Duy Nguyen <pclouds@gmail.com>
Date
Feb 18, 2015, 13:58 UTC
Message-ID
<CACsJy8BJnHTyXhhJaCuZAzjm=Gd96EjANEw76j=3L92cmbX7HA@mail.gmail.com>
In-Reply-To
<54E48A96.8010301@gmail.com>
On Wed, Feb 18, 2015 at 7:50 PM, karthik nayak <karthik.188@gmail.com> wrote:
> Also,
> Is there any way I can get the type of object made via git hash-object
> --literally. The problem I'm facing is "sha1_object_info()" returns a
> object_type enum, so objects not specified there are considered as errors.

Use what sha1_object_info() uses behind the scene. Loose object encodes object type as a string, you could just print that string and skip the enum object_type conversion. You probably need special treatment for packed objects too. See parse_sha1_header() and unpack_object_header().

-- 
Duy
Previous: karthik nayakNext: Junio C Hamano
Message 3 of 5 in “[RFC] git cat-file "literally" option”
  1. karthik nayakFeb 18, 2015
  2. karthik nayakFeb 18, 2015
  3. Duy NguyenFeb 18, 2015
  4. Junio C HamanoFeb 18, 2015
  5. karthik nayakFeb 19, 2015

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.