Re: [PATCH 2/2] diff: add a special SYMLINK user-diff driver
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Sep 22, 2010, 00:12 UTC
- Message-ID
- <AANLkTi=zSPegcPNY8jr4S5qeXWHrxuC+0SY-h5EhyA+6@mail.gmail.com>
- In-Reply-To
- <20100921211303.GB1188@sigill.intra.peff.net>
2010/9/21 Jeff King <peff@peff.net>:
Show 10 quoted lines
> +However, it may happen that you do want to change the diff parameters > +specifically for symlinks. You can do that by configuring the special > +"SYMLINK" diff driver. For example, to add a newline to the end of > +the symlink contents (and suppress the usual "no newline at end of file" > +warning), you could configure: > + > +----------------------------- > +[diff "SYMLINK"] > + textconv = perl -pe 's/$/\n/' > +-----------------------------
That'll turn every \n in the stream into \n\n, not add a newline to the end of the file. Don't you mean:
perl -0666 -pe 's/$/\n/'
Or, more efficiently:
perl -ple 'END { print }'?