Re: [PATCH 1/4] Accept commit in some places when tree is needed.
- From
Linus Torvalds <torvalds@osdl.org>
- Date
- Apr 20, 2005, 15:32 UTC
- Message-ID
- <Pine.LNX.4.58.0504200826360.6467@ppc970.osdl.org>
- In-Reply-To
- <7vis2ikmj0.fsf@assigned-by-dhcp.cox.net>
On Tue, 19 Apr 2005, Junio C Hamano wrote:
> > This patch lifts the tree-from-tree-or-commit logic from > diff-cache.c and moves it to sha1_file.c, which is a common > library source for the SHA1 storage part.
I don't think that's a good interface. It changes the sha1 passed into it: that may actually be nice, since you may want to know what it changed to, but I think you'd want to have that as an (optional) separate "sha1_result" parameter.
Also, the "type" or "size" things make no sense to have as a parameter at all.
IOW, it was fine when it was an internal hacky thing in diff-cache, but once it's promoted to be a real library function it should definitely be cleaned up to have sane interfaces that make sense in general, and not just within the original context.
Linus