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

Re: [PATCH 1/4] Move remove_path() into libgit.a

From
Junio C Hamano <junkio@cox.net>
Date
Jan 25, 2007, 00:07 UTC
Message-ID
<7v7ivcdl57.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.63.0701240213020.22628@wbgn013.biozentrum.uni-wuerzburg.de>
We seem to have variants of the seme theme in many places.
 * builtin-apply.c::remove_file()
 * builtin-rm.c::remove_file() -- this one leaks the strdup result
 * refs.c::remove_empty_dir_recursive()
 * unpack-trees.c::unlink_entry() 
 * mrege-recursive.c::remove_path()

It would be nicer to consolidate their "remove the now potentially empty directories recursively" part in a single function and have them call it.

Some of them try to be more efficient by not allocating an extra string (because they know the string supplied by the caller is a fair game), so the clean-up might be slightly involved, but I think it is worth it.

 
	
Previous: Johannes Schindelin
Message 2 of 2 in “Move remove_path() into libgit.a”
  1. 1/4 Move remove_path() into libgit.aJohannes Schindelin, Jan 24, 2007
  2. Junio C HamanoJan 25, 2007

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.