Re: [PATCH 08/16] test-lib functions: add --printf option to test_commit

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

 



On Mon, Apr 12, 2021 at 5:27 PM Junio C Hamano <gitster@xxxxxxxxx> wrote:
> Eric Sunshine <sunshine@xxxxxxxxxxxxxx> writes:
> > The name "printf" has such strong association in programmer's minds
> > with "%" and argument consumption that the name of this option alone
> > almost begs people to take advantage of argument interpolation even
> > though it's documented here as not allowing it. Taking into
> > consideration that people often do not read documentation, `--printf`
> > as the name of the option may be an unfortunate one. Perhaps it could
> > be called `--raw` or something less likely to suggest argument
> > interpolation.
>
> The reason we want to use 'printf' instead of 'echo' is because only
> some implementations of 'echo' honors '\t\n\r' etc., and 'echo' by
> others show these literally.  Using printf(1) allows us to write
> these backslashed special characters universally.
>
> So, I find 'raw' equally confusing, if not more.

I don't care for `--raw` either but couldn't think of anything better
at the time. But perhaps a name such as `--allow-escapes` would be
clearer, or perhaps not. `--c-style-escapes`?

Anyhow, it's pure bikeshedding as I mentioned in my original email, so
not a big deal. I brought it up only because the very first thought
that popped into my head when reading the commit message saying it was
adding `--printf` was "oh, interesting; how do I specify the arguments
to interpolate into the `printf` format string?".



[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