* File path not escaped in warning message @ 2012-08-04 12:55 Janusz Białobrzewski 2012-08-04 22:20 ` Junio C Hamano 0 siblings, 1 reply; 7+ messages in thread From: Janusz Białobrzewski @ 2012-08-04 12:55 UTC (permalink / raw) To: git Hi, I have enabled core.quotepath, but file path in warning isn't escaped: File name is 1ą.txt its content is encoded in windows-1250 Output of git diff after reencoding to windows1250 is: warning: LF will be replaced by CRLF in 1Ä….txt. The file will have its original line endings in your working directory. But I expected it to be: warning: LF will be replaced by CRLF in 1\304\205.txt. The file will have its original line endings in your working directory. Best regards, Janusz Białobrzewski. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: File path not escaped in warning message 2012-08-04 12:55 File path not escaped in warning message Janusz Białobrzewski @ 2012-08-04 22:20 ` Junio C Hamano 2012-08-05 12:05 ` Janusz Białobrzewski 0 siblings, 1 reply; 7+ messages in thread From: Junio C Hamano @ 2012-08-04 22:20 UTC (permalink / raw) To: msysgit; +Cc: git, Janusz Białobrzewski Janusz Białobrzewski <jbialobr@o2.pl> writes: > I have enabled core.quotepath, but file path in warning isn't escaped: > File name is 1ą.txt its content is encoded in windows-1250 > Output of git diff after reencoding to windows1250 is: > > warning: LF will be replaced by CRLF in 1Ä….txt. > The file will have its original line endings in your working directory. > > But I expected it to be: > > warning: LF will be replaced by CRLF in 1\304\205.txt. > The file will have its original line endings in your working directory. Do msysgit folks want to look into this, perhaps? Thanks. -- *** Please reply-to-all at all times *** *** (do not pretend to know who is subscribed and who is not) *** *** Please avoid top-posting. *** The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free. You received this message because you are subscribed to the Google Groups "msysGit" group. To post to this group, send email to msysgit@googlegroups.com To unsubscribe from this group, send email to msysgit+unsubscribe@googlegroups.com For more options, and view previous threads, visit this group at http://groups.google.com/group/msysgit?hl=en_US?hl=en ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: File path not escaped in warning message 2012-08-04 22:20 ` Junio C Hamano @ 2012-08-05 12:05 ` Janusz Białobrzewski 2012-08-05 19:48 ` Junio C Hamano 0 siblings, 1 reply; 7+ messages in thread From: Janusz Białobrzewski @ 2012-08-05 12:05 UTC (permalink / raw) To: Junio C Hamano; +Cc: msysgit, git Here is output from linux: [janusz@mikrus JavaCommon]$ git config --add core.quotepath false [janusz@mikrus JavaCommon]$ git diff --unified=3 -- "1ą.txt" warning: LF will be replaced by CRLF in 1<B1>.txt. The file will have its original line endings in your working directory. diff --git a/1<B1>.txt b/1<B1>.txt index 281ad6f..9444a66 100644 --- a/1<B1>.txt +++ b/1<B1>.txt @@ -1,2 +1,2 @@ aaaa -bbb +bbbc [janusz@mikrus JavaCommon]$ git config --unset core.quotepath [janusz@mikrus JavaCommon]$ git config --add core.quotepath true [janusz@mikrus JavaCommon]$ git diff --unified=3 -- "1ą.txt" warning: LF will be replaced by CRLF in 1<B1>.txt. The file will have its original line endings in your working directory. diff --git "a/1\261.txt" "b/1\261.txt" index 281ad6f..9444a66 100644 --- "a/1\261.txt" +++ "b/1\261.txt" @@ -1,2 +1,2 @@ aaaa -bbb +bbbc Janusz Białobrzewski. Junio C Hamano pisze: > Janusz Białobrzewski <jbialobr@o2.pl> writes: > > >> I have enabled core.quotepath, but file path in warning isn't escaped: >> File name is 1ą.txt its content is encoded in windows-1250 >> Output of git diff after reencoding to windows1250 is: >> >> warning: LF will be replaced by CRLF in 1Ä….txt. >> The file will have its original line endings in your working directory. >> >> But I expected it to be: >> >> warning: LF will be replaced by CRLF in 1\304\205.txt. >> The file will have its original line endings in your working directory. >> > > Do msysgit folks want to look into this, perhaps? > > Thanks. > > ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: File path not escaped in warning message 2012-08-05 12:05 ` Janusz Białobrzewski @ 2012-08-05 19:48 ` Junio C Hamano 2012-08-06 6:53 ` jbialobr 0 siblings, 1 reply; 7+ messages in thread From: Junio C Hamano @ 2012-08-05 19:48 UTC (permalink / raw) To: Janusz Białobrzewski; +Cc: msysgit, git Janusz Białobrzewski <jbialobr@o2.pl> writes: > Here is output from linux: > > [janusz@mikrus JavaCommon]$ git config --add core.quotepath false > [janusz@mikrus JavaCommon]$ git diff --unified=3 -- "1ą.txt" > warning: LF will be replaced by CRLF in 1<B1>.txt. > The file will have its original line endings in your working directory. I do not know offhand if the literal <B1> is the byte value you want or not, but core.quotepath should not affect it. The configuration is primarily about quoting paths that appear in the header part in the diff output for machine readability. In this output, > diff --git a/1<B1>.txt b/1<B1>.txt > index 281ad6f..9444a66 100644 > --- a/1<B1>.txt > +++ b/1<B1>.txt the paths are not quoted because quotepath is set to false, but in the next example, it > ... > [janusz@mikrus JavaCommon]$ git config --unset core.quotepath > [janusz@mikrus JavaCommon]$ git config --add core.quotepath true > [janusz@mikrus JavaCommon]$ git diff --unified=3 -- "1ą.txt" > warning: LF will be replaced by CRLF in 1<B1>.txt. > The file will have its original line endings in your working directory. > diff --git "a/1\261.txt" "b/1\261.txt" > index 281ad6f..9444a66 100644 > --- "a/1\261.txt" > +++ "b/1\261.txt" is quoted due to the configuration setting. Again, <B1> in the warning message is not affected, as the quotepath configuration is not meant to affect messages that are meant for human consumption. -- *** Please reply-to-all at all times *** *** (do not pretend to know who is subscribed and who is not) *** *** Please avoid top-posting. *** The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free. You received this message because you are subscribed to the Google Groups "msysGit" group. To post to this group, send email to msysgit@googlegroups.com To unsubscribe from this group, send email to msysgit+unsubscribe@googlegroups.com For more options, and view previous threads, visit this group at http://groups.google.com/group/msysgit?hl=en_US?hl=en ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Re: File path not escaped in warning message 2012-08-05 19:48 ` Junio C Hamano @ 2012-08-06 6:53 ` jbialobr 2012-08-06 17:18 ` karsten.blees 0 siblings, 1 reply; 7+ messages in thread From: jbialobr @ 2012-08-06 6:53 UTC (permalink / raw) To: Junio C Hamano; +Cc: msysgit, git There is nothing said in the manual, that core.quotepath affects only header. But it is not the point. You don't know which part of git output will be consumed by machine. Warning message is addressed to human, but it can be consumed by program in the same way as all other messages and output data. Imho, since warning comes from git, path should be quoted to make git behaviour consistent. From git-log help: > Note that we deliberately chose not to re-code the commit log message when a commit is made to force UTF-8 at the commit object level, because re-coding to UTF-8 is not necessarily a reversible operation. If re-coding from one encoding to other is not necessarily a reversible operation, and you can set logoutputencoding to any encoding you wish, you may loose some charatcers while recoding file path in warning message. Quoting it would be desired then. Janusz Białobrzewski. ---- Wiadomość Oryginalna ---- Od: Junio C Hamano <gitster@pobox.com> Do: Janusz Białobrzewski <jbialobr@o2.pl> Kopia do: msysgit@googlegroups.com, git@vger.kernel.org Data: 5 sierpnia 2012 21:48 Temat: Re: File path not escaped in warning message > Janusz Białobrzewski <jbialobr@o2.pl> writes: > > > Here is output from linux: > > > > [janusz@mikrus JavaCommon]$ git config --add core.quotepath false > > [janusz@mikrus JavaCommon]$ git diff --unified=3 -- "1ą.txt" > > warning: LF will be replaced by CRLF in 1<B1>.txt. > > The file will have its original line endings in your working directory. > > I do not know offhand if the literal <B1> is the byte value you want > or not, but core.quotepath should not affect it. > > The configuration is primarily about quoting paths that appear in > the header part in the diff output for machine readability. In this > output, > > > diff --git a/1<B1>.txt b/1<B1>.txt > > index 281ad6f..9444a66 100644 > > --- a/1<B1>.txt > > +++ b/1<B1>.txt > > the paths are not quoted because quotepath is set to false, but in > the next example, it > > > ... > > [janusz@mikrus JavaCommon]$ git config --unset core.quotepath > > [janusz@mikrus JavaCommon]$ git config --add core.quotepath true > > [janusz@mikrus JavaCommon]$ git diff --unified=3 -- "1ą.txt" > > warning: LF will be replaced by CRLF in 1<B1>.txt. > > The file will have its original line endings in your working directory. > > diff --git "a/1\261.txt" "b/1\261.txt" > > index 281ad6f..9444a66 100644 > > --- "a/1\261.txt" > > +++ "b/1\261.txt" > > is quoted due to the configuration setting. > > Again, <B1> in the warning message is not affected, as the quotepath > configuration is not meant to affect messages that are meant for > human consumption. -- *** Please reply-to-all at all times *** *** (do not pretend to know who is subscribed and who is not) *** *** Please avoid top-posting. *** The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free. You received this message because you are subscribed to the Google Groups "msysGit" group. To post to this group, send email to msysgit@googlegroups.com To unsubscribe from this group, send email to msysgit+unsubscribe@googlegroups.com For more options, and view previous threads, visit this group at http://groups.google.com/group/msysgit?hl=en_US?hl=en ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Re: Re: File path not escaped in warning message 2012-08-06 6:53 ` jbialobr @ 2012-08-06 17:18 ` karsten.blees 2012-08-07 8:20 ` jbialobr 0 siblings, 1 reply; 7+ messages in thread From: karsten.blees @ 2012-08-06 17:18 UTC (permalink / raw) To: jbialobr; +Cc: git, Junio C Hamano, msysgit Hi Janusz, It seems you're mixing up a few completely unrelated concepts here. Core.quotepath enables quoting and escaping of special characters in file names. This has nothing to do with character set encoding of file names (i.e. Cp1250/ISO-8859-2/UTF-8). AFAIK, apart from git-svn, git currently doesn't support character set re-coding of file names at all, so core.quotepath and encoding are completely unrelated. Regarding git-log / git-diff output, there are basically three different character set encodings involved: 1. commit log messages: re-coded to i18n.logoutputencoding (usually UTF-8) 2. file content: printed verbatim (no re-coding); gui tools such as gitk may decode this based on gui.encoding or .gitattributes settings 3. everything else (file names, diff headers, error / warning messages): always UTF-8 (at least in Git for Windows) Gui tools such as gitk decode this output line by line using the appropriate encoding. <jbialobr@o2.pl> wrote on 06.08.2012 08:53:17: > File name is 1ą.txt its content is encoded in windows-1250 File name encoding and file content encoding are completely unrelated. File name encoding in current Git for Windows is *always* UTF-8, file content encoding can be anything. > Output of git diff after reencoding to windows1250 is: > > warning: LF will be replaced by CRLF in 1Ä….txt. > The file will have its original line endings in your working directory. This looks like the file name is UTF-8, but reinterpreted (not reencoded) as if it were Cp1250. However, as stated above, you cannot simply interpret the entire git-log / git-diff output as beeing one particular encoding, as the encoding may vary on a line by line basis. > Here is output from linux: > > [janusz@mikrus JavaCommon]$ git config --add core.quotepath false > [janusz@mikrus JavaCommon]$ git diff --unified=3 -- "1ą.txt" > warning: LF will be replaced by CRLF in 1<B1>.txt. > The file will have its original line endings in your working directory. "<B1>" looks like less's escaping with missing LESSCHARSET setting. Additionally, your Linux box seems to be set up with ISO-8859-2 system encoding. Git repositories created on this system will not be portable, i.e. using the same repository on other Linux systems, Git for Windows, Cygwin-git, or JGit/EGit will result in completely broken file names. The quasi-standard file name encoding in git repositories is UTF-8. > There is nothing said in the manual, that core.quotepath affects > only header. But it is not the point. You don't know which part of > git output will be consumed by machine. Warning message is addressed > to human, but it can be consumed by program in the same way as all > other messages and output data. Error / warning messages may be localized, so they are particularly unsuitable for consumption by other programs. That's why many git commands have special switches to make their output machine readable (e.g. -z). Incidentally, 'git-log -z' also disables core.quotepath. So if you write a program that parses git output, and you're using the proper 'machine readable' version, you should never have to worry about quoted paths, irrespective of the core.quotepath setting. > Imho, since warning comes from git, path should be quoted to > make git behaviour consistent. > From git-log help: > > Note that we deliberately chose not to re-code the commit log > message when a commit is made to force UTF-8 at the commit object > level, because re-coding to UTF-8 is not necessarily a reversible operation. > > If re-coding from one encoding to other is not necessarily a > reversible operation, and you can set logoutputencoding to any > encoding you wish, you may loose some charatcers while recoding file > path in warning message. Quoting it would be desired then. > The i18n.commitencoding and i18n.logoutputencoding settings only affect commit log messages. They are completely unrelated to error / warning messages, file names, or file name quoting. Hope that helps, Karsten -- *** Please reply-to-all at all times *** *** (do not pretend to know who is subscribed and who is not) *** *** Please avoid top-posting. *** The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free. You received this message because you are subscribed to the Google Groups "msysGit" group. To post to this group, send email to msysgit@googlegroups.com To unsubscribe from this group, send email to msysgit+unsubscribe@googlegroups.com For more options, and view previous threads, visit this group at http://groups.google.com/group/msysgit?hl=en_US?hl=en ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Re: Re: Re: File path not escaped in warning message 2012-08-06 17:18 ` karsten.blees @ 2012-08-07 8:20 ` jbialobr 0 siblings, 0 replies; 7+ messages in thread From: jbialobr @ 2012-08-07 8:20 UTC (permalink / raw) To: git, Junio C Hamano; +Cc: gitster, msysgit Hi Karsten, Thanks, you helped me a lot. I see now, that logoutputencoding is for commit header data, not for whole log output. The name is little missleading, so do description: i18n.logOutputEncoding Encoding to use when displaying logs. Regarding git-log / git-diff output, there are basically three different character set encodings involved: 1. commit log messages: re-coded to i18n.logoutputencoding (usually UTF-8) also commiter and author fields. 2. file content: printed verbatim (no re-coding); gui tools such as gitk may decode this based on gui.encoding or .gitattributes settings 3. everything else (file names, diff headers, error / warning messages): always UTF-8 (at least in Git for Windows) It is more like git encoding than UTF-8. Gui tools such as gitk decode this output line by line using the appropriate encoding. It would be easier to do it if output was displayed in consistent way. I see no reason why one part of output is quoted and other is not. Another example: $ git status warning: LF will be replaced by CRLF in 1ą.txt. The file will have its original line endings in your working directory. # On branch master # Your branch and 'origin/master' have diverged, # and have 2 and 2 different commit(s) each, respectively. # # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: "1\261.txt" # Git doesn't recode commit header when --pretty is set to format, but recodes when --pretty is set to full, raw, etc. Do you know if it is done by mistake or by design? Thanks again, Janusz Białobrzewski. -- *** Please reply-to-all at all times *** *** (do not pretend to know who is subscribed and who is not) *** *** Please avoid top-posting. *** The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free. You received this message because you are subscribed to the Google Groups "msysGit" group. To post to this group, send email to msysgit@googlegroups.com To unsubscribe from this group, send email to msysgit+unsubscribe@googlegroups.com For more options, and view previous threads, visit this group at http://groups.google.com/group/msysgit?hl=en_US?hl=en ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-08-07 8:20 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-08-04 12:55 File path not escaped in warning message Janusz Białobrzewski 2012-08-04 22:20 ` Junio C Hamano 2012-08-05 12:05 ` Janusz Białobrzewski 2012-08-05 19:48 ` Junio C Hamano 2012-08-06 6:53 ` jbialobr 2012-08-06 17:18 ` karsten.blees 2012-08-07 8:20 ` jbialobr
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).