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