Re: [PATCH v3 2/3] config: add 'type' to config_source struct that identifies config type
- From
Jeff King <peff@peff.net>
- Date
- Feb 14, 2016, 16:07 UTC
- Message-ID
- <20160214160734.GB5875@sigill.intra.peff.net>
- In-Reply-To
- <394CD8BC-49CF-4D07-A9C2-CC8C60373A2B@gmail.com>
On Sun, Feb 14, 2016 at 01:24:55PM +0100, Lars Schneider wrote:
Show 7 quoted lines
> > Should git_config_from_buf() take a "type" parameter, and > > git_config_from_blob_sha1() pass in "blob"? > Haha, fun fact: this was how I implemented it initially. Because of that > I noticed that "submodule-config.c" also uses "git_config_from_buf" :-) > > However, then I thought the list wouldn't like it if I change the > interfaces. I will add the type parameter, again.
Changing internal interfaces is preferable to carrying a sub-optimal interface forever, I think.
The thing we really have to watch out for is changing the assumptions or output of a function without changing its signature. The interface change breaks loudly on a merge, and is easy to fix. Changing the internals creates quiet and subtle bugs.
-Peff