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

Re: [RFC] 'git cat-file' needs a better design on its option interface

From
Jeff King <peff@peff.net>
Date
Sep 24, 2009, 16:48 UTC
Message-ID
<20090924164834.GB5655@coredump.intra.peff.net>
In-Reply-To
<3a3680030909240804w1399ed7fhd6367300544f34f@mail.gmail.com>
On Thu, Sep 24, 2009 at 11:04:31PM +0800, Li Hong wrote:
> When using 'git cat-file' recently, I find its option interface is somewhat
> inconvenient or mistakenly-designed.

Yes, the current interface has grown over time and kind of sucks. I agree with all of your complaints.

That being said, the reason it has grown in that way is that as a plumbing command, cat-file must retain backwards compatibility so as not to break existing scripts which make use of it. And it is not enough to look through git.git and fix all of our scripts; the interface to cat-file is a public one, and we must take care not to break other people's custom scripts.

I'm not quite sure where your complaints are coming from. Do you want:
  1. Something more sane to type in your terminal for everyday use? Then
     you probably want to use (or invent) some sort of user-facing
     porcelain that does a similar thing. This is mostly covered by "git
     show" these days, but if there is something lacking, proposals
     describing your use case would be welcome.
  2. To script around cat-file, but there is some action you want to do
     that is missing from the interface? In that case, can you describe
     your use case in more detail, and exactly what addition you want to
     make to the cat-file interface to accomodate it?
  3. To just clean up cruft from the interface for your scripts? I am
     somewhat sympathetic to wanting a nicer interface. But keep in
     mind that we have to keep the old interface around to support
     historical scripts. So while your new interface may be more
     flexible and less complex, you have to consider whether having
     _both_ interfaces will actually be less complex in the long run.
-Peff
Previous: Li HongNext: Linus Torvalds
Message 2 of 6 in “[RFC] 'git cat-file' needs a better design on its option interface”
  1. Li HongSep 24, 2009
  2. Jeff KingSep 24, 2009
  3. Linus TorvaldsSep 24, 2009
  4. Matthieu MoySep 24, 2009
  5. Nicolas PitreSep 24, 2009
  6. Li HongSep 25, 2009

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.