Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have been working on a <em>much</em> better solution with help from the msysGit people, and have come up with this clean/smudge filter. The filter uses the Gnu file and iconv commands to determine the type of the file, and convert it to and from msysGit's internal UTF-8 format.</p> <p>This type of Clean/Smudge Filter gives you much more flexibility. It should allow Git to treat your mixed-format files as UTF-8 text in most cases: diffs, merge, git-grep, as well as gitattributes properties like eol-conversion, ident-replacement, and built-in diff patterns. </p> <p>The diff filter solution outlined above only works for diffs, and so is much more limited.</p> <p>To set up this filter:</p> <ol> <li>Get Gnu <a href="http://gnuwin32.sourceforge.net/packages/libiconv.htm" rel="noreferrer" title="iconv">libiconv</a>, and <a href="http://gnuwin32.sourceforge.net/packages/file.htm" rel="noreferrer" title="file">file</a>, and install both.</li> <li>Ensure that the GnuWin32\bin directory (usually "C:\Program Files\GnuWin32\bin") is in your %PATH%</li> <li><p>Add the following to ~\Git\etc\gitconfig:</p> <pre><code>[filter "mixedtext"] clean = iconv -sc -f $(file -b --mime-encoding %f) -t utf-8 smudge = iconv -sc -f utf-8 -t $(file -b --mime-encoding %f) required </code></pre></li> <li><p>Add a line to your global ~/Git/etc/gitattributes or local ~/.gitattributes to handle mixed format text, for example:</p> <pre><code>*.txt filter=mixedtext </code></pre></li> </ol> <p>I have used this on a directory with sql files in ANSI, UTF-16, and UTF-8 formats. It is working so far. Barring any surprises, this looks like the 20% effort that could cover 80% of all Windows text format problems.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload