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

Re: [PATCH 3/3] refs: use strings directly in find_containing_dir()

From
René Scharfe <rene.scharfe@lsrfire.ath.cx>
Date
May 23, 2012, 16:20 UTC
Message-ID
<4FBD0E33.4060309@lsrfire.ath.cx>
In-Reply-To
<7vhav73lnl.fsf@alter.siamese.dyndns.org>
Am 23.05.2012 00:18, schrieb Junio C Hamano:
Show 14 quoted lines
> René Scharfe<rene.scharfe@lsrfire.ath.cx>  writes:
>
>> What has git grep to do with refs?  It checks if the path in the command
>> above is a ref, which makes it iterate over all of them..
>
> Do you mean:
>
> 	/* Is it a rev? */
>          get_sha1()
>          ->  ...
>            ->  get_sha1_basic()
>              ->  dwim_ref()
>
> callpath?

Yes, indeed. Hmm, this is done even if the paths come after a double-dash. Anyway, I don't consider the check to be a performance issue, just a quick way to test the allocation count that i stumbled upon while working on the recent grep patches.

René
Previous: Junio C HamanoNext: Junio C Hamano
Message 9 of 12 in “find_containing_dir(): allocate strbuf less extravagantly”
  1. find_containing_dir(): allocate strbuf less extravagantlymhagger@alum.mit.edu, May 22, 2012
  2. Jeff KingMay 22, 2012
  3. 1/3 refs: convert parameter of search_ref_dir() to length-limited stringRené Scharfe, May 22, 2012
  4. 2/3 refs: convert parameter of create_dir_entry() to length-limited stringRené Scharfe, May 22, 2012
  5. 3/3 refs: use strings directly in find_containing_dir()René Scharfe, May 22, 2012
  6. Junio C HamanoMay 22, 2012
  7. René ScharfeMay 22, 2012
  8. Junio C HamanoMay 22, 2012
  9. René ScharfeMay 23, 2012
  10. Junio C HamanoMay 23, 2012
  11. René ScharfeMay 23, 2012
  12. Michael HaggertyMay 24, 2012

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.