Re: git log --encoding=HTML is not supported

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff King <peff@xxxxxxxx> writes:

> I wouldn't be opposed to an option for the pretty formatter to have
> encodings. Something like:
>
>   git log --format='%(authorname:quote=html)'
>
> I'd probably put off implementing that until we actually unify the
> for-each-ref and pretty formats, though (we do not even have
> %(authorname) at this point!). The latter already has a quoting
> mechanism for shell/perl/python/tcl (though it is not per-atom, and I
> wouldn't be opposed to a --format-quote option that quoted all pretty.c
> placeholders).

Yeah, per-atom would be nice, as we can specify which piece needs
what kind of quoting, e.g.

    git log --format='
	if test %(authoremail:quote=shell) != "gitster@xxxxxxxxx"
	then
	    echo %(authorname:quote=html+shell)
	fi
    ' | sh

can be used to write a script to produce an "echo" command with a
shell literal string as its argument, where that literal string
writes author's name in a way that can be inserted in an HTML
document, but omitting the commits by me.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux