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

Re: [PATCH 0/5] Move unquote_path() from git-add--interactive.perl to Git.pm

From
Jeff King <peff@peff.net>
Date
Jun 22, 2017, 23:18 UTC
Message-ID
<20170622231844.d3fdo6c367h3ldve@sigill.intra.peff.net>
In-Reply-To
<20170622102622.26147-1-phillip.wood@talktalk.net>
On Thu, Jun 22, 2017 at 11:26:17AM +0100, Phillip Wood wrote:
Show 9 quoted lines
> From: Phillip Wood <phillip.wood@dunelm.org.uk>
> 
> I'm using this in some scripts and it would be more convenient to have
> it available from Git.pm rather than copying and pasting it each time
> I need it. I think it should be useful to other people using Git.pm as
> well. It is not uncommon to get a quoted path back from a command that
> needs to be passed on the commandline of another command. While one
> can use -z in many cases, that leaves the problem of having to quote
> the path when printing it in error messages etc.

Grepping around the calls to unquote_path in add--interactive, I definitely think many of them ought to be using "-z". But I don't think that's a reason not to make unquote_path() more widely available. It _is_ generally useful.

The changes look sane to me. My biggest question is how add--interactive handles the exceptions thrown by the refactored function on error. Since these paths are coming from Git, it should be something never comes up, right? So failing hard is probably the best thing to do.

-Peff
Previous: Junio C HamanoNext: Phillip Wood
Message 10 of 17 in “Move unquote_path() from git-add--interactive.perl to Git.pm”
  1. 0/5 Move unquote_path() from git-add--interactive.perl to Git.pmPhillip Wood, Jun 22, 2017
  2. 2/5 Git::unquote_path() Handle '\a'Phillip Wood, Jun 22, 2017
  3. 1/5 Git.pm Add unquote_path()Phillip Wood, Jun 22, 2017
  4. Junio C HamanoJun 22, 2017
  5. 3/5 Git::unquote_path() throw an exception on bad pathPhillip Wood, Jun 22, 2017
  6. Junio C HamanoJun 22, 2017
  7. 5/5 git-add--interactive.perl: Use unquote_path() from Git.pmPhillip Wood, Jun 22, 2017
  8. 4/5 Add tests for Git::unquote_path()Phillip Wood, Jun 22, 2017
  9. Junio C HamanoJun 22, 2017
  10. Jeff KingJun 22, 2017
  11. Phillip WoodJun 30, 2017
  12. 0/4 Move unquote_path from git-add--interactive.perl to Git.pmPhillip Wood, Jun 30, 2017
  13. 1/4 add -i move unquote_path() to Git.pmPhillip Wood, Jun 30, 2017
  14. 4/4 Add tests for Git::unquote_path()Phillip Wood, Jun 30, 2017
  15. 2/4 Git::unquote_path() Handle '\a'Phillip Wood, Jun 30, 2017
  16. 3/4 Git::unquote_path() throw an exception on bad pathPhillip Wood, Jun 30, 2017
  17. Junio C HamanoJun 30, 2017

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.