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

Re: [PATCH] git-clean: handle errors if removing files fails

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 21, 2008, 00:12 UTC
Message-ID
<7vodab182n.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20080220234154.GS31441@genesis.frugalware.org>
Miklos Vajna <vmiklos@frugalware.org> writes:
Show 17 quoted lines
> Consider the following case:
>
> $ sudo mkdir foo
> $ sudo touch foo/bar
>
> This is the old output:
>
> $ git clean -f -d
> Removing foo/
>
> No error message.
>
> This is the new output:
>
> $ ~/git/git/git clean -f -d
> Removing foo/
> fatal: failed to remove 'foo/'

That's quite different style from the other commit log messages in the project, isn't it?

While I agree reporting an error is definitely an improvement, I do not think dying in the middle is the right thing to do.

Shouldn't it note the error, remove other cruft, and then finally signal the error by exiting non-zero?

Previous: Miklos VajnaNext: Miklos Vajna
Message 2 of 3 in “git-clean: handle errors if removing files fails”
  1. git-clean: handle errors if removing files failsMiklos Vajna, Feb 20, 2008
  2. Junio C HamanoFeb 21, 2008
  3. git-clean: handle errors if removing files failsMiklos Vajna, Feb 21, 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.