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

Re: [PATCH v3] git-clean: correct printing relative path

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 6, 2008, 23:08 UTC
Message-ID
<7vr6en8n7k.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20080306174342.GA32364@dpotapov.dyndns.org>
Dmitry Potapov <dpotapov@gmail.com> writes:
> When the given path contains '..' then git-clean incorrectly printed names
> of files. This patch changes cmd_clean to use quote_path() from wt-status.

I think making quote_path() available from outside is fine, but as a public function, quote_path() is grossly misnamed. It was an Ok name in the context of wt-status, where the sole kind of path quoting necessary was to show themrelative to the current working directory. As a general library, it needs much better name, perhaps quote_path_relative(), and it should move to quote.c, not staying in wt-status.c.

The implementation of quote_path() also needs to be fixed. For one thing, it does not seem to honor core.quotepath configuration, and it also passes "\t" unquoted. I think rewriting the handcrafted loop to treat \n and \r specially should be yanked out and replaced with c_style_quote family of functions in quote.c

Previous: Dmitry PotapovNext: Dmitry Potapov
Message 2 of 6 in “git-clean: correct printing relative path”
  1. git-clean: correct printing relative pathDmitry Potapov, Mar 6, 2008
  2. Junio C HamanoMar 6, 2008
  3. 1/2 renaming quote_path() as quote_path_relative()Dmitry Potapov, Mar 7, 2008
  4. 2/2 git-clean: correct printing relative pathDmitry Potapov, Mar 7, 2008
  5. Junio C HamanoMar 7, 2008
  6. Dmitry PotapovMar 7, 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.