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

Re: [PATCH 1/3] Make read_index_data() public

From
LFLukas Fleischer <git@cryptocrack.de>
Date
Apr 13, 2013, 08:23 UTC
Message-ID
<20130413082317.GA31894@blizzard>
In-Reply-To
<20130412194012.GA5154@sigill.intra.peff.net>
On Fri, Apr 12, 2013 at 03:40:12PM -0400, Jeff King wrote:
Show 14 quoted lines
> On Fri, Apr 12, 2013 at 07:26:11PM +0200, Lukas Fleischer wrote:
> 
> > This allows for reusing the function in convert.c later.
> > 
> > Also, move it from attr.c to read-cache.c and add a use_index parameter
> > to specify a custom index_state since we are no longer enable to access
> > the static use_index variable from attr.c.
> 
> I'm all for removing duplicated code, but, but I think the name
> "read_index_data" is a bit misleading for a global function. I would
> expect it to read data from the index (and the argument "path" does not
> help clarify that at all).
> 
> Can we rename it read_blob_data_from_index_path() or something?

Pretty long function name... I agree that it is better to have a verbose function name instead of something short that gives a wrong impression of what the function does and I can't think of a shorter, yet descriptive way to name the function.

If nobody comes up with an alternative suggestion, I will change it to read_blob_data_from_index_path() and resubmit.

> 
> -Peff
Previous: Jeff KingNext: Lukas Fleischer
Message 4 of 12 in “Remove ~25 lines of duplicate code”
  1. 0/3 Remove ~25 lines of duplicate codeLukas Fleischer, Apr 12, 2013
  2. 1/3 Make read_index_data() publicLukas Fleischer, Apr 12, 2013
  3. Jeff KingApr 12, 2013
  4. Lukas FleischerApr 13, 2013
  5. 2/3 Add size parameter to read_index_data()Lukas Fleischer, Apr 12, 2013
  6. 3/3 convert.c: Remove duplicate codeLukas Fleischer, Apr 12, 2013
  7. 1/3 Add public function read_blob_data_from_index_path()Lukas Fleischer, Apr 13, 2013
  8. 2/3 Add size parameter to read_blob_data_from_index_path()Lukas Fleischer, Apr 13, 2013
  9. 3/3 convert.c: Remove duplicate codeLukas Fleischer, Apr 13, 2013
  10. Junio C HamanoApr 14, 2013
  11. Junio C HamanoApr 14, 2013
  12. Lukas FleischerApr 14, 2013

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.