Re: Detect invalid submodule names from script?

2017-07-17 Thread Joachim Durchholz
Am 17.07.2017 um 19:49 schrieb Stefan Beller: On Mon, Jul 17, 2017 at 4:17 AM, Joachim Durchholz <j...@durchholz.org> wrote: Hi all I'm hacking some script that calls into git, and I need to detect whether a repository was configured with a submodule name that will work on "git sub

Detect invalid submodule names from script?

2017-07-17 Thread Joachim Durchholz
Hi all I'm hacking some script that calls into git, and I need to detect whether a repository was configured with a submodule name that will work on "git submodule init" and friends. I *can* run a git init and see whether it works, but I need to be 100% sure that the error was due to an

Re: Mirroring for offline use - best practices?

2017-07-12 Thread Joachim Durchholz
Am 12.07.2017 um 19:40 schrieb Stefan Beller: Thanks for the feedback - it's been very, very useful to me! > Yes, a local path implies --local in git-clone, which (a) uses hardlinks > and (b) avoids some other protocol overhead. I guess (a) is the most important one for repositories large

Mirroring for offline use - best practices?

2017-07-12 Thread Joachim Durchholz
Hi all, I'm pretty sure this is a FAQ, but articles I found on the Internet were either mere "recipes" (i.e. tell you how, but don't explain why), or bogged down in so many details that I was never sure how to proceed from there. Basic situation: There's a master repository (Github or

Re: [PATCH 2/2] test-lib: exhaustively insert non-alnum ASCII into the TRASH_DIRECTORY name

2017-04-11 Thread Joachim Durchholz
Am 11.04.2017 um 01:23 schrieb Ævar Arnfjörð Bjarmason: > * Much of it fails due to GIT_CEILING_DIRECTORIES not working with > dirs with ":" in the name. Oh. That might hit me: I'm using URLs for parent directory names in a cache directory. urlencode may or may not work: >

Re: [PATCH 2/2] test-lib: exhaustively insert non-alnum ASCII into the TRASH_DIRECTORY name

2017-04-10 Thread Joachim Durchholz
Am 10.04.2017 um 18:57 schrieb Jeff King: If there are security bugs where a malicious input can cause us to do something bad, that's something to care about. But that's very different than asking "do these tests run to completion with a funny input". If the tests do not complete, git is doing

Re: [PATCH 2/2] test-lib: exhaustively insert non-alnum ASCII into the TRASH_DIRECTORY name

2017-04-10 Thread Joachim Durchholz
Am 10.04.2017 um 15:38 schrieb Jeff King: Are those bugs? Maybe. Certainly they are limitations. But are they ones anybody _cares_ about? I think this may fall under "if it hurts, don't do it". It's not always possible to avoid that. URLs, for example, may contain "funny characters",

Re: [PATCH 0/2] test: Detect *lots* of bugs by adding non-alnum to trash dir names

2017-04-09 Thread Joachim Durchholz
Am 09.04.2017 um 21:11 schrieb Ævar Arnfjörð Bjarmason: This series changes the test library so that we interpolate the result of: perl -e 'print join q[], grep { /[^[:alnum:]]/ and !m<[./]> } map chr, 0x01..0x7f' Into the trash directory name we generate. Doing this makes 30% of the test

Re: [PATCH] submodule: prevent backslash expantion in submodule names

2017-04-08 Thread Joachim Durchholz
Am 08.04.2017 um 12:59 schrieb Jeff King: The reason I mentioned escaping earlier is I wondered what would happen when the submodule starts with a double-quote, or has a newline in the name. I have tested newlines within the name, these work fine. I also tested double and single quotes within

Re: [PATCH] submodule: prevent backslash expantion in submodule names

2017-04-07 Thread Joachim Durchholz
Thanks!

Re: problem with backslash in directory name

2017-04-07 Thread Joachim Durchholz
Am 07.04.2017 um 08:30 schrieb Jeff King: I also don't know how some of those loops would cope with a submodule name that needed quoting). "git submodule add" worked fine with most of the following names: "sub" # potentially confusing the shell "sub with blanks", "sub

Re: problem with backslash in directory name

2017-04-07 Thread Joachim Durchholz
Am 07.04.2017 um 08:30 schrieb Jeff King: Probably it's "read" which does backslash expansion, but nothing else. Just grepping git-submodule.sh, some of the "read" calls should probably be "read -r" http://wiki.bash-hackers.org/commands/builtin/read has this to say: Essentially all you need

problem with backslash in directory name

2017-04-07 Thread Joachim Durchholz
Hi all, I'm having a problem with submodules that reside in directories that (unwisely) contain a backslash in their name. Transcript: ### Arrange $ git init main Initialized empty Git repository in /tmp/test/main/.git/ $ git init sub\\with\\backslash Initialized empty Git repository in