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

Stupid quoting...

From
David Kastrup <dak@gnu.org>
Date
Jun 13, 2007, 11:30 UTC
Message-ID
<86ir9sw0pi.fsf@lola.quinscape.zz>
Hi,

what is the point in quoting file names and their characters in git-diff's output? And what is the recommended way of undoing the damage?

I have something like
git-diff -M -C --name-status -r master^ master | {
    while read -r flag name
    do
	case "$name" in *\\[0-3][0-7][0-7]*)
		name=$(echo -e $(echo "$name"|sed 's/\\\([0-3][0-7][0-7]\)/\\0\1/g;s/\\\([^0]\)/\\\\\1/g'))
	esac
        [...]

in order to get through the worst with utf-8 file names, and it is a complete nuisance (double quotemarks are treated later).

Is there any utility or pipe or invocation that can take a sequence of filenames as printed by git and turn them back into what they actually were in the first place?

-- 
David Kastrup
Next: Alex Riesen
Message 1 of 35 in “Stupid quoting...”
  1. David KastrupJun 13, 2007
  2. Alex RiesenJun 13, 2007
  3. Johannes SchindelinJun 13, 2007
  4. Steven GrimmJun 14, 2007
  5. Johannes SchindelinJun 14, 2007
  6. Steven GrimmJun 14, 2007
  7. Johannes SchindelinJun 14, 2007
  8. Junio C HamanoJun 14, 2007
  9. Jakub NarebskiJun 16, 2007
  10. David KastrupJun 18, 2007
  11. Jeff KingJun 18, 2007
  12. Johannes SchindelinJun 19, 2007
  13. David KastrupJun 19, 2007
  14. Johannes SchindelinJun 19, 2007
  15. Olivier GalibertJun 19, 2007
  16. Johannes SchindelinJun 14, 2007
  17. David KastrupJun 14, 2007
  18. Alex RiesenJun 14, 2007
  19. Alex RiesenJun 14, 2007
  20. Johannes SchindelinJun 20, 2007
  21. Junio C HamanoJun 20, 2007
  22. David KastrupJun 20, 2007
  23. Jakub NarebskiJun 20, 2007
  24. David KastrupJun 20, 2007
  25. Jan HudecJun 24, 2007
  26. Robin RosenbergJun 24, 2007
  27. Junio C HamanoJun 24, 2007
  28. David KastrupJun 24, 2007
  29. Junio C HamanoJun 24, 2007
  30. Jeff KingJun 24, 2007
  31. Jan HudecJun 24, 2007
  32. Robin RosenbergJun 24, 2007
  33. David KastrupJun 24, 2007
  34. Robin RosenbergJun 24, 2007
  35. David KastrupJun 24, 2007

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.