Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I see a few issues here:</p> <ol> <li><p>You have <code>%</code> at the end of both filters.<br> This has no special meaning and will be passed as an extra argument to <em>sed</em>, which will probably generate an error (unless you have a file named <code>%</code>).<br> Filters should be “streaming” (read from stdin and write to stdout). Their definition can include <code>%f</code>, but it should not really be treated as a file to read or write; Git does that part, filters should just read from stdin and write to stdout.</p></li> <li><p>Your clean filter tries to redirect stdin from <code>%f</code>.<br> The input data will already be on stdin, there is no need to redirect.</p></li> <li><p>The <em>sed</em> program in the clean filter uses the <code>r</code> command to access another file.<br> Filters seem to be run from root of the working tree, but I am not sure if that is guaranteed.</p></li> <li><p>The <em>sed</em> command in the clean filter uses <code>-n</code>. Its only output will be the contents of the <code>ankhsvnsection</code> file (assuming the input has a <code>Global</code> line).</p></li> <li><p>Some versions of <em>sed</em> (at least the (old) BSD version in Mac OS X) do not allow whitespace after the filename of the <code>r</code> command (i.e. the space after <code>ankhsvnsection</code> in the clean filter’s <em>sed</em> program).</p></li> </ol> <p>After adding, changing, or removing a filter you will probably need to <em>touch</em>, modify, or delete your working tree files before Git will apply the filter. Git’s index records the modification time of working tree files; if they have not changed, then Git will translate <code>git checkout -- file</code> and <code>git add file</code> into a no-op.</p> <p>If you want to see the actual contents of the index (e.g. to check what the clean filter produced), you can use <code>git show :0:path/from/repo/root/to/file</code>. You can not usually use <code>git diff</code> for this since it also applies the filters.</p> <p>These worked for me:</p> <pre><code>git config filter.SourceControlProvider.smudge "sed -e '/GlobalSection(SubversionScc)/,/EndGlobalSection/d'" git config filter.SourceControlProvider.clean "sed -e '/^Global\$/ r ankhsvnsection'" </code></pre>
 

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