[Mutopia-discuss] spurious git diff
Hi all I think that a good practice to ancourage and ease the review of updates is splitting a pull request in at least two commits: one for the initial convert-ly and the second for the manual changes. I think it may be added to the wiki page: https://github.com/chrissawer/The-Mutopia-Project/wiki/Updating-Lilypond-files-for-the-Mutopia-Project I have a question: do you know why git diff after convert-ly doesn't show a proper diff line by line? I've already read a complain about this from Keith on lilypond-user, pointing to this commit: https://github.com/chrissawer/The-Mutopia-Project/commit/81a588f5d16a3bcb4110bd1e8197dbdc5a08137e If I add the file to a new git repository, the 'git diff' of the updated file is correct. What's wrong with the main repository? It's not a big deal, it means only that the actual changes made by convert-ly won't be visible. But still I want to understand why it happens. Thanks Federico ___ Mutopia-discuss mailing list Mutopia-discuss@mutopiaproject.org http://lists.bcn.mythic-beasts.com/mailman/listinfo/mutopia-discuss
Re: [Mutopia-discuss] spurious git diff
Federico Bruni writes: > Hi all > > I think that a good practice to ancourage and ease the review of > updates is splitting a pull request in at least two commits: one for > the initial convert-ly and the second for the manual changes. > > I think it may be added to the wiki page: > https://github.com/chrissawer/The-Mutopia-Project/wiki/Updating-Lilypond-files-for-the-Mutopia-Project > > I have a question: do you know why git diff after convert-ly doesn't > show a proper diff line by line? I've already read a complain about > this from Keith on lilypond-user, pointing to this commit: > https://github.com/chrissawer/The-Mutopia-Project/commit/81a588f5d16a3bcb4110bd1e8197dbdc5a08137e Uh, different file names _with_ changed content and without options detecting more than renames on unchanged blobs? -- David Kastrup ___ Mutopia-discuss mailing list Mutopia-discuss@mutopiaproject.org http://lists.bcn.mythic-beasts.com/mailman/listinfo/mutopia-discuss
Re: [Mutopia-discuss] spurious git diff
2014-02-22 16:46 GMT+01:00 Federico Bruni : > I have a question: do you know why git diff after convert-ly doesn't show a > proper diff line by line? I've already read a complain about this from Keith > on lilypond-user, pointing to this commit: > https://github.com/chrissawer/The-Mutopia-Project/commit/81a588f5d16a3bcb4110bd1e8197dbdc5a08137e > > If I add the file to a new git repository, the 'git diff' of the updated > file is correct. What's wrong with the main repository? There are some different 'diff algorithms' that produce very different output, see git diff --help Just a thought. -- Francisco Vila. Badajoz (Spain) www.paconet.org , www.csmbadajoz.com ___ Mutopia-discuss mailing list Mutopia-discuss@mutopiaproject.org http://lists.bcn.mythic-beasts.com/mailman/listinfo/mutopia-discuss
[Mutopia-discuss] file encoding should be UTF-8, right?
$ file -i ftp/ScriabinA/O59/prelude/prelude.ly ftp/ScriabinA/O59/prelude/prelude.ly: text/plain; charset=us-ascii Can I run iconv on it, right? This again will break the diff (see previous thread), but it's needed. One more thing to add to the wiki? If you give me the ok, I can edit the page myself. ___ Mutopia-discuss mailing list Mutopia-discuss@mutopiaproject.org http://lists.bcn.mythic-beasts.com/mailman/listinfo/mutopia-discuss
Re: [Mutopia-discuss] file encoding should be UTF-8, right?
Il sab, feb 22, 2014 at 6:38 , Federico Bruni ha scritto: $ file -i ftp/ScriabinA/O59/prelude/prelude.ly ftp/ScriabinA/O59/prelude/prelude.ly: text/plain; charset=us-ascii Can I run iconv on it, right? This again will break the diff (see previous thread), but it's needed. One more thing to add to the wiki? If you give me the ok, I can edit the page myself. I can convert with Gedit. However, what's wrong with the following commands? $ iconv -f US-ASCII -t UTF-8 ftp/ScriabinA/O59/prelude/prelude.ly > ftp/ScriabinA/O59/prelude/prelude.ly $ file -i ftp/ScriabinA/O59/prelude/prelude.lyftp/ScriabinA/O59/prelude/prelude.ly: inode/x-empty; charset=binary I've tried also recode, but it doesn't work: $ recode -v UTF-8 ftp/ScriabinA/O59/prelude/prelude.ly Request: UTF-8..:libiconv:..CHAR Shrunk to: UTF-8..CHAR Recoding ftp/ScriabinA/O59/prelude/prelude.ly... done $ file -bi ftp/ScriabinA/O59/prelude/prelude.ly text/plain; charset=us-ascii ___ Mutopia-discuss mailing list Mutopia-discuss@mutopiaproject.org http://lists.bcn.mythic-beasts.com/mailman/listinfo/mutopia-discuss
Re: [Mutopia-discuss] file encoding should be UTF-8, right?
Hi, I might be wrong, but the file has no property like "utf8" or"ascii", it is just encoded as such. Ascii is a subset of utf8. If there are only ascii charachters in the file, there is no reason for the file command to say anything else but "us-ascii". There is no difference between ascii and utf8, in case there are only ascii characters in the file. Cheers, Joram ___ Mutopia-discuss mailing list Mutopia-discuss@mutopiaproject.org http://lists.bcn.mythic-beasts.com/mailman/listinfo/mutopia-discuss
Re: [Mutopia-discuss] file encoding should be UTF-8, right?
Federico Bruni writes: > Il sab, feb 22, 2014 at 6:38 , Federico Bruni > ha scritto: >> $ file -i ftp/ScriabinA/O59/prelude/prelude.ly >> ftp/ScriabinA/O59/prelude/prelude.ly: text/plain; charset=us-ascii >> >> Can I run iconv on it, right? >> This again will break the diff (see previous thread), but it's >> needed. One more thing to add to the wiki? If you give me the ok, I >> can edit the page myself. > > I can convert with Gedit. However, what's wrong with the following > commands? > > $ iconv -f US-ASCII -t UTF-8 ftp/ScriabinA/O59/prelude/prelude.ly > > ftp/ScriabinA/O59/prelude/prelude.ly Same output and input file. The output redirection operator truncates the output file to be empty before iconv is run, so it just converts an empty file. > I've tried also recode, but it doesn't work: > > $ recode -v UTF-8 ftp/ScriabinA/O59/prelude/prelude.ly > Request: UTF-8..:libiconv:..CHAR > Shrunk to: UTF-8..CHAR > Recoding ftp/ScriabinA/O59/prelude/prelude.ly... done > $ file -bi ftp/ScriabinA/O59/prelude/prelude.ly > text/plain; charset=us-ascii US-ASCII is a subset of UTF-8, so there is nothing to convert here. What you want is recode tex..utf-8 here. The problem is that there are things like "avec d\\'efi" here which get turned into "avec d\éfi" because of the doubled backslash. At any rate, you should probably look at _all_ \\ sequences first. There is a lot of TeX stuff in there that will stop working, not just accents. -- David Kastrup ___ Mutopia-discuss mailing list Mutopia-discuss@mutopiaproject.org http://lists.bcn.mythic-beasts.com/mailman/listinfo/mutopia-discuss
Re: [Mutopia-discuss] file encoding should be UTF-8, right?
Il sab, feb 22, 2014 at 7:12 , Noeck ha scritto: Hi, I might be wrong, but the file has no property like "utf8" or"ascii", it is just encoded as such. Ascii is a subset of utf8. If there are only ascii charachters in the file, there is no reason for the file command to say anything else but "us-ascii". There is no difference between ascii and utf8, in case there are only ascii characters in the file. Thanks, I realized it afterwards by trial and error. I was misled by this diff: $ git diff diff --git a/ftp/ScriabinA/O59/prelude/prelude.ly b/ftp/ScriabinA/O59/prelude/prelude.ly index ccb31de..b66a87f 100644 --- a/ftp/ScriabinA/O59/prelude/prelude.ly +++ b/ftp/ScriabinA/O59/prelude/prelude.ly @@ -38,7 +38,7 @@ upperOne = \relative c' { 8-- 4-> 4.-- | 4-- 8-> 4.-- | 4-- 8-> 4-- 8-> | - r r ->\p\<^\markup{\italic "avec d\\'efi"} gis'>-> -> ->\! | + r r ->\p\<^\markup{\italic "avec dfi"} gis'>-> -> ->\! | \tieUp gis'->\f e8.-> dis16-> gis4.-> ~ | gis4 e8-> dis-> bis-> a-> | @@ -72,7 +72,7 @@ upperOne = \relative c' { 4-- 8-> 4-- 8-> | r r ->\p\< -> -> ->\! | \tieUp - ->\f^\markup{\italic "avec d\\'efi"} -- -- d'>4.-> ~ | + ->\f^\markup{\italic "avec dfi"} -- -- 4.-> ~ | 4 8-> -> -> -> | \phrasingSlurDown 4.-> bes,16\( ees fis bes d ees | I see now that it is because of LESSCHARSET env. This fixes it: export LESSCHARSET=utf-8 ___ Mutopia-discuss mailing list Mutopia-discuss@mutopiaproject.org http://lists.bcn.mythic-beasts.com/mailman/listinfo/mutopia-discuss