git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Li Hong <lihong.hi@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [RFC] 'git cat-file' needs a better design on its option interface
Date: Thu, 24 Sep 2009 12:48:35 -0400	[thread overview]
Message-ID: <20090924164834.GB5655@coredump.intra.peff.net> (raw)
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

  reply	other threads:[~2009-09-24 16:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-24 15:04 [RFC] 'git cat-file' needs a better design on its option interface Li Hong
2009-09-24 16:48 ` Jeff King [this message]
2009-09-24 17:23 ` Linus Torvalds
2009-09-24 19:21   ` Matthieu Moy
2009-09-24 19:30     ` Nicolas Pitre
2009-09-25  2:33   ` Li Hong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090924164834.GB5655@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=lihong.hi@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).