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

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
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 4 in “Accept commit in some places when tree is needed.”
  1. 1/4 Accept commit in some places when tree is needed.Junio C Hamano, Apr 20, 2005
  2. (fixed) [PATCH 1/4] Accept commit in some places when tree is needed.Junio C Hamano, Apr 20, 2005
  3. Linus TorvaldsApr 20, 2005
  4. (rework) [PATCH 1/5] Accept commit in some places when tree is needed.Junio C Hamano, Apr 21, 2005

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.