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

Re: [PATCH] Fix memleak and the implementation of remove_file in builtin-rm.c

From
Shawn O. Pearce <spearce@spearce.org>
Date
Sep 26, 2008, 15:28 UTC
Message-ID
<20080926152823.GA17470@spearce.org>
In-Reply-To
<20080925202237.GB18315@blimp.localhost>
Alex Riesen <raa.lkml@gmail.com> wrote:
> It is the same as in merge-recursive, but they're so small so unless
> we get a special file with such random routines there is no much point
> exporting it. Actually, we do seem to have such a file: dir.c. It is
> already plagued by file_exists kind of things, why not remove_path...
Yea.  I'm thinking remove_path should migrate to dir.c.  Hell,
we already have rm -rf as remove_dir_recursively() in dir.c.
remove_path is its long-lost soul mate.  I'm not applying this
builtin-rm fix, and am hoping you'll rewrite it around a move
of remove_path to dir.c...  ;-)
 
Show 8 quoted lines
> diff --git a/builtin-rm.c b/builtin-rm.c
> index fdac34f..910a34d 100644
> --- a/builtin-rm.c
> +++ b/builtin-rm.c
> @@ -31,22 +31,18 @@ static void add_list(const char *name)
>  
>  static int remove_file(const char *name)
>  {
-- 
Shawn.
Previous: Alex RiesenNext: Alex Riesen
Message 5 of 10 in “[BUG] git merge does not prune empty directories”
  1. Anders MelchiorsenSep 24, 2008
  2. Remove empty directories in recursive mergeAlex Riesen, Sep 25, 2008
  3. Cleanup remove_pathAlex Riesen, Sep 25, 2008
  4. Fix memleak and the implementation of remove_file in builtin-rm.cAlex Riesen, Sep 25, 2008
  5. Shawn O. PearceSep 26, 2008
  6. Add remove_path: a function to remove as much as possible of a pathAlex Riesen, Sep 26, 2008
  7. Use remove_path from dir.c instead of own implementationAlex Riesen, Sep 26, 2008
  8. Alex RiesenSep 25, 2008
  9. Shawn O. PearceSep 26, 2008
  10. Johannes SixtSep 26, 2008

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.