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

Re: git fails with control characters in trunk directory name

From
Alex Riesen <raa.lkml@gmail.com>
Date
May 12, 2009, 10:54 UTC
Message-ID
<81b0412b0905120354p6e1bf517y154601132f0901a3@mail.gmail.com>
In-Reply-To
<200905121103.00432.Hugo.Mildenberger@namir.de>
2009/5/12 Hugo Mildenberger <Hugo.Mildenberger@namir.de>:
Show 13 quoted lines
>> 2009/5/11 Hugo Mildenberger <Hugo.Mildenberger@namir.de>:
>> > While this was almost entirely my fault, git could possibly apply a
>> > filter, reject such a name or at least issue a warning.
>>
>> Maybe. Or maybe it can just work (well, assuming the user meant to
>> use an url with character you considered "control").
>
> I said it actually did not work well, independent from how anyone prefers to
> classify characters. My platform is Gentoo-hardened with unicode support and
> an ext3 disk format .  With "trunk directory"  I meant the top level
> directory which is created when you run git clone on a remote url -- sorry
> for still not being a native git speaker. I don't have the original setup
> anymore. My _working_ ".git/config" is now:
Ok, let's assume you picked up '\r\n' from that web page
Show 6 quoted lines
> The remote url did contain something like "^J\n" at the end, as did the top
> level (the much derided "trunk") directory name on disk. I probably got there
> by puting the copied url within quotes on the command line, but today I'm
> unsure exactly how I arrived there. However, old fashioned as I am, I still
> consider e.g. a linefeed to be a "control character", and inspite of your
> flashing git punditry I still consider this to be an issue.

Git tries not to enforce any specific rules where the program itself does not need them. One can easily imagine an automatic system which generates names of repositories from something like binary data (something like BigTable comes to mind) and the less rules the underlying levels impose on it, the simplier the upper levels will be.

OTOH, a warning about commonly used delimiters not fitting a name context, maybe a good idea. Like "\r\n\t", backslash (came up recently on this list). Such a check and associated warning may be useful for repository names and branches.

Still, it's more of a policy issue and I would make it optional, even if enabled by default. Maybe even by defining a regexp which the repo name or branch name must (for hard error) or should (for a warning) match.

For your specific case, you can take a look at builtin-clone.c, just after the line containing "guess_dir_name(repo_name"...

Previous: Hugo MildenbergerNext: Hugo Mildenberger
Message 4 of 30 in “git fails with control characters in trunk directory name”
  1. Hugo MildenbergerMay 11, 2009
  2. Alex RiesenMay 12, 2009
  3. Hugo MildenbergerMay 12, 2009
  4. Alex RiesenMay 12, 2009
  5. Hugo MildenbergerMay 12, 2009
  6. Alex RiesenMay 12, 2009
  7. Hugo MildenbergerMay 12, 2009
  8. Alex RiesenMay 12, 2009
  9. Quote LF in urls git fetch saves in FETCH_HEADAlex Riesen, May 12, 2009
  10. Junio C HamanoMay 12, 2009
  11. Alex RiesenMay 13, 2009
  12. Hugo MildenbergerMay 13, 2009
  13. Daniel BarkalowMay 13, 2009
  14. Alex RiesenMay 13, 2009
  15. Alex RiesenMay 13, 2009
  16. Daniel BarkalowMay 13, 2009
  17. Alex RiesenMay 13, 2009
  18. Junio C HamanoMay 13, 2009
  19. 1/2 Quote LF in urls git fetch saves in FETCH_HEADAlex Riesen, May 13, 2009
  20. 2/2 Improve the naming of guessed target repository for git cloneAlex Riesen, May 13, 2009
  21. Junio C HamanoMay 14, 2009
  22. Alex RiesenMay 14, 2009
  23. Junio C HamanoMay 14, 2009
  24. Alex RiesenMay 14, 2009
  25. Hugo MildenbergerMay 14, 2009
  26. Alex RiesenMay 14, 2009
  27. Junio C HamanoMay 16, 2009
  28. Alex RiesenMay 12, 2009
  29. Alex RiesenMay 13, 2009
  30. Hugo MildenbergerMay 13, 2009

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.