Re: [PATCH 1/2] [submodule] handle multibyte characters in name
On Tue, Jun 11, 2013 at 7:04 PM, Fredrik Gustafsson wrote: > Bugg reported here: > http://thread.gmane.org/gmane.comp.version-control.git/218922/focus=226791 > > Note that newline (\n) is still not supported and will not be until the > sh-script is replaced by something in an other language. This however > let us to use mostly all other strange characters. Please explain the commit better so the reader can understand what the commit does and why. I can see what's going on by reading the commit and the original thread, but I should not have to. Thanks, Phil -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/2] submodule: handle multibyte characters in name
On Wed, Jun 12, 2013 at 03:57:52PM -0700, Junio C Hamano wrote: > Jens Lehmann writes: > > > Hmm, I just came around to test that patch, and for me the new > > test even succeeds without the changes to module_list(). So I'm > > not convinced yet what we are fixing here ;-) > > My guess is that you have core.quotepaths set to false. Actually the bug-reporter claimed to see the submodule in .gitmodules but not when listed with git submodule. The test is missing one line in the end to check for this. Sorry about that. I've a new iteration ready for this but want to test it a bit more locally so I don't miss anything else first. -- Med vänliga hälsningar Fredrik Gustafsson tel: 0733-608274 e-post: iv...@iveqy.com -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/2] submodule: handle multibyte characters in name
Jens Lehmann writes: > Hmm, I just came around to test that patch, and for me the new > test even succeeds without the changes to module_list(). So I'm > not convinced yet what we are fixing here ;-) My guess is that you have core.quotepaths set to false. > The original poster reported that the submodule just added locally > is not showing up in a subsequent `git submodule`. And it doesn't > for me either, no matter if the path contains umlauts or not. Will > take a deeper look when I find some more time to do that, maybe > recent changes to "git add" play a role here too. Thanks. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/2] submodule: handle multibyte characters in name
Am 12.06.2013 23:06, schrieb Junio C Hamano: > Fredrik Gustafsson writes: > >> Bugg reported here: >> http://thread.gmane.org/gmane.comp.version-control.git/218922/focus=226791 > > The URL is nice supplemental info as footnote, but please write log > message in a way that a reader can understand without going there. > In this case, it wouldn't be so hard, I think, perhaps like: > > Many "git submodule" operations do not work on a submodule > at a path whose name is not in ASCII. > > This is because "git ls-files" is used to find which paths > are bound to submodules to the current working tree, and the > output is C-quoted by default for non ASCII pathnames. > > Read from "git ls-files -z" instead, which is easier than > unwrapping C-quote ourselves. > > or something. > >> module_list() >> { >> ( >> -git ls-files --error-unmatch --stage -- "$@" || >> +git ls-files --error-unmatch --stage -z -- "$@" || >> echo "unmatched pathspec exists" >> ) | >> +sed -e 's/\x00/\n/g' | > > It is strange to preprosess input to be read by a Perl script with > sed ;-) > > How about doing it this way instead? Does the result pass your > test? Hmm, I just came around to test that patch, and for me the new test even succeeds without the changes to module_list(). So I'm not convinced yet what we are fixing here ;-) The original poster reported that the submodule just added locally is not showing up in a subsequent `git submodule`. And it doesn't for me either, no matter if the path contains umlauts or not. Will take a deeper look when I find some more time to do that, maybe recent changes to "git add" play a role here too. > git-submodule.sh | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/git-submodule.sh b/git-submodule.sh > index 79bfaac..19faf58 100755 > --- a/git-submodule.sh > +++ b/git-submodule.sh > @@ -113,7 +113,7 @@ resolve_relative_url () > module_list() > { > ( > - git ls-files --error-unmatch --stage -- "$@" || > + git ls-files --error-unmatch --stage -z -- "$@" || > echo "unmatched pathspec exists" > ) | > perl -e ' > @@ -121,6 +121,7 @@ module_list() > my ($null_sha1) = ("0" x 40); > my @out = (); > my $unmatched = 0; > + $/ = "\0"; > while () { > if (/^unmatched pathspec/) { > $unmatched = 1; > -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/2] submodule: handle multibyte characters in name
Fredrik Gustafsson writes: > Bugg reported here: > http://thread.gmane.org/gmane.comp.version-control.git/218922/focus=226791 The URL is nice supplemental info as footnote, but please write log message in a way that a reader can understand without going there. In this case, it wouldn't be so hard, I think, perhaps like: Many "git submodule" operations do not work on a submodule at a path whose name is not in ASCII. This is because "git ls-files" is used to find which paths are bound to submodules to the current working tree, and the output is C-quoted by default for non ASCII pathnames. Read from "git ls-files -z" instead, which is easier than unwrapping C-quote ourselves. or something. > module_list() > { > ( > - git ls-files --error-unmatch --stage -- "$@" || > + git ls-files --error-unmatch --stage -z -- "$@" || > echo "unmatched pathspec exists" > ) | > + sed -e 's/\x00/\n/g' | It is strange to preprosess input to be read by a Perl script with sed ;-) How about doing it this way instead? Does the result pass your test? git-submodule.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/git-submodule.sh b/git-submodule.sh index 79bfaac..19faf58 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -113,7 +113,7 @@ resolve_relative_url () module_list() { ( - git ls-files --error-unmatch --stage -- "$@" || + git ls-files --error-unmatch --stage -z -- "$@" || echo "unmatched pathspec exists" ) | perl -e ' @@ -121,6 +121,7 @@ module_list() my ($null_sha1) = ("0" x 40); my @out = (); my $unmatched = 0; + $/ = "\0"; while () { if (/^unmatched pathspec/) { $unmatched = 1; -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html