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

Re: [PATCH v2] clean: add --null option

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 16, 2012, 20:14 UTC
Message-ID
<7vehrntowg.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1334480962-18778-1-git-send-email-rosslagerwall@gmail.com>
Ross Lagerwall <rosslagerwall@gmail.com> writes:
> Add a --null (-z) option to git-clean which prints out the files
> and directories separated with a NUL character rather than '\n'.
> This makes it useful in conjunction with xargs -0.
Hrm, I do not like this at all.

The parameters to print_path() are all _("l10n-ready string"). Isn't it a clue already that they are not meant for machine consumption? Why are we moving to cast the output from an end-user facing Porcelain command in stone?

I suspect that older days "git clean" was a scripted Porcelain around a plumbing (perhaps ls-files?---I didn't bother digging its history as I do not care too deeply about "git clean" which I do not use myself). If we have piled so many features into "git clean" after the rewrite-to-C to make it impossible to express what "git clean" _would_ do in terms of "ls-files", perhaps that is what needs to be fixed, so that we can express "git clean --some-set-of-options" as:

    git ls-files -z --set-of-options-equivalent-to-what-is-given-to-clean |
    xargs -0 rm -fr
Previous: Ross LagerwallNext: Ross Lagerwall
Message 2 of 3 in “clean: add --null option”
  1. clean: add --null optionRoss Lagerwall, Apr 15, 2012
  2. Junio C HamanoApr 16, 2012
  3. Ross LagerwallApr 18, 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.