threads / discuss / 44121

2.10.0: git log --oneline prints gpg signatures in 4 lines

Subject: 2.10.0: git log --oneline prints gpg signatures in 4 lines

## tl;dr

7 messages between Sep 20, 2016 and Sep 21, 2016.

replies: 6people: 4as markdown or json

Leandro Lucarella· Sep 20, 2016, 15:09 UTC · lore

Hi, starting from 2.10.0 I noticed that when using git log --oneline, if commits are signed with GPG, now the signatures are printed too, and it takes 3 lines for the signature information + 1 line for the title of the commit, so suddenly --oneline became --fourline :)

Is this really intended?
-- 
Leandro Lucarella
Technical Development Lead
Sociomantic Labs GmbH <http://www.sociomantic.com>
Jeff King· Sep 20, 2016, 23:15 UTC · re: Leandro Lucarella · lore

Re: 2.10.0: git log --oneline prints gpg signatures in 4 lines

On Tue, Sep 20, 2016 at 05:09:54PM +0200, Leandro Lucarella wrote:
Show 6 quoted lines
> Hi, starting from 2.10.0 I noticed that when using git log --oneline,
> if commits are signed with GPG, now the signatures are printed too, and
> it takes 3 lines for the signature information + 1 line for the title
> of the commit, so suddenly --oneline became --fourline :)
> 
> Is this really intended?

I don't think anything has changed here in 2.10. Running "git log --oneline --show-signature" has _always_ been horribly ugly. However, 2.10 did introduce the "log.showsignature" config, which makes "git log --oneline" pretty unusable when it is enabled. Ditto for one-liner uses of "--format".

I think we should probably ignore the config entirely when using any of the one-liner formats (and I'd include --format, too, even though it can sometimes be multi-line; it already has %GG to include that information as appropriate).

Another option would be to somehow represent the signature information in the --oneline output, but I think I'd rather leave that for people to experiment with using "--format".

-Peff
Leandro Lucarella· Sep 21, 2016, 10:24 UTC · re: Jeff King · lore

Re: 2.10.0: git log --oneline prints gpg signatures in 4 lines

On Tue, 20 Sep 2016 19:15:33 -0400 Jeff King <peff@peff.net> wrote:

Show 15 quoted lines
> On Tue, Sep 20, 2016 at 05:09:54PM +0200, Leandro Lucarella wrote:
> 
> > Hi, starting from 2.10.0 I noticed that when using git log
> > --oneline, if commits are signed with GPG, now the signatures are
> > printed too, and it takes 3 lines for the signature information + 1
> > line for the title of the commit, so suddenly --oneline became
> > --fourline :)
> > 
> > Is this really intended?
> 
> I don't think anything has changed here in 2.10. Running "git log
> --oneline --show-signature" has _always_ been horribly ugly. However,
> 2.10 did introduce the "log.showsignature" config, which makes "git
> log --oneline" pretty unusable when it is enabled. Ditto for
> one-liner uses of "--format".

Right! Now I remember, I changed my configuration when I read the release notes, before I upgraded. Now that I did upgrade I'm seeing the results.

Anyway, yeah, using the new configuration makes --oneline pretty unusable, so ignoring that option for --oneline seems like a good idea.

Show 8 quoted lines
> I think we should probably ignore the config entirely when using any
> of the one-liner formats (and I'd include --format, too, even though
> it can sometimes be multi-line; it already has %GG to include that
> information as appropriate).
> 
> Another option would be to somehow represent the signature information
> in the --oneline output, but I think I'd rather leave that for people
> to experiment with using "--format".

I think it might be nice to show the information in one line in a ver succinct way, like just showing a green unicode check mark (✓) or a red cross mark (❌) if it failed (or just colour the commit subject in green/red if a signature is present and is passing/failing).

Thanks!
-- 
Leandro Lucarella
Technical Development Lead
Sociomantic Labs GmbH <http://www.sociomantic.com>
Leandro Lucarella· Sep 21, 2016, 13:53 UTC · re: Jeff King · lore

Re: 2.10.0: git log --oneline prints gpg signatures in 4 lines

On Tue, 20 Sep 2016 19:15:33 -0400 Jeff King <peff@peff.net> wrote:

Show 20 quoted lines
> On Tue, Sep 20, 2016 at 05:09:54PM +0200, Leandro Lucarella wrote:
> 
> > Hi, starting from 2.10.0 I noticed that when using git log
> > --oneline, if commits are signed with GPG, now the signatures are
> > printed too, and it takes 3 lines for the signature information + 1
> > line for the title of the commit, so suddenly --oneline became
> > --fourline :)
> > 
> > Is this really intended?
> 
> I don't think anything has changed here in 2.10. Running "git log
> --oneline --show-signature" has _always_ been horribly ugly. However,
> 2.10 did introduce the "log.showsignature" config, which makes "git
> log --oneline" pretty unusable when it is enabled. Ditto for
> one-liner uses of "--format".
> 
> I think we should probably ignore the config entirely when using any
> of the one-liner formats (and I'd include --format, too, even though
> it can sometimes be multi-line; it already has %GG to include that
> information as appropriate).

Woops! Definitely it shouldn't be added when --format is used, this is also breaking some scripts I have using git log --format to get some information about commits, and GPG information is being output even when there is anything about GPG requested in the chosen format.

I guess I will disable log.showsignatures for now... :(
-- 
Leandro Lucarella
Technical Development Lead
Sociomantic Labs GmbH <http://www.sociomantic.com>
Michael J Gruber· Sep 21, 2016, 15:05 UTC · re: Leandro Lucarella · lore

Re: 2.10.0: git log --oneline prints gpg signatures in 4 lines

Leandro Lucarella venit, vidit, dixit 21.09.2016 15:53:
Show 31 quoted lines
> On Tue, 20 Sep 2016 19:15:33 -0400
> Jeff King <peff@peff.net> wrote:
> 
>> On Tue, Sep 20, 2016 at 05:09:54PM +0200, Leandro Lucarella wrote:
>>
>>> Hi, starting from 2.10.0 I noticed that when using git log
>>> --oneline, if commits are signed with GPG, now the signatures are
>>> printed too, and it takes 3 lines for the signature information + 1
>>> line for the title of the commit, so suddenly --oneline became
>>> --fourline :)
>>>
>>> Is this really intended?
>>
>> I don't think anything has changed here in 2.10. Running "git log
>> --oneline --show-signature" has _always_ been horribly ugly. However,
>> 2.10 did introduce the "log.showsignature" config, which makes "git
>> log --oneline" pretty unusable when it is enabled. Ditto for
>> one-liner uses of "--format".
>>
>> I think we should probably ignore the config entirely when using any
>> of the one-liner formats (and I'd include --format, too, even though
>> it can sometimes be multi-line; it already has %GG to include that
>> information as appropriate).
> 
> Woops! Definitely it shouldn't be added when --format is used, this is
> also breaking some scripts I have using git log --format to get some
> information about commits, and GPG information is being output even
> when there is anything about GPG requested in the chosen format.
> 
> I guess I will disable log.showsignatures for now... :(
> 

I guess that's one of the reasons why I didn't like that config option to begin with. There's a flood of these config "convenience" options lately where we have to special case for scripting... Aliases must have become old school or something.

Note that "git log --show-notes", "git log --oneline --raw", "git log --oneline -p" and similar are not "one line" either. So "--show-signature" behaves just like all others.

git log --format="%h %G? %s"

or a colored version thereof may be what you want to alias as "log1" or such.

Cheers, Michael

Junio C Hamano· Sep 21, 2016, 16:26 UTC · re: Jeff King · lore

Re: 2.10.0: git log --oneline prints gpg signatures in 4 lines

Jeff King <peff@peff.net> writes:
Show 14 quoted lines
> I don't think anything has changed here in 2.10. Running "git log
> --oneline --show-signature" has _always_ been horribly ugly. However,
> 2.10 did introduce the "log.showsignature" config, which makes "git log
> --oneline" pretty unusable when it is enabled. Ditto for one-liner uses
> of "--format".
>
> I think we should probably ignore the config entirely when using any of
> the one-liner formats (and I'd include --format, too, even though it can
> sometimes be multi-line; it already has %GG to include that information
> as appropriate).
>
> Another option would be to somehow represent the signature information
> in the --oneline output, but I think I'd rather leave that for people to
> experiment with using "--format".

My thinking is that "--oneline --show-signature" and "--oneline" with log.showsignature set to true without "--no-show-signature" on the command line should produce identical result.

The current definition of "--oneline" seems to me "the commit object name and the log message is shown on a single line" (I consider that the decoration given by "--decorate" is part of "commit object name"), but there may be other things shown that may not fit on a single line.

I do not terribly mind changing the definition of "--oneline" to "what is output is ONLY the commit object name and the log message, nothing else is shown", though. After all, the output from "log" is for human consumption, and it is a bug in the script if it is depending on parsing the "log" output, so it is OK to change its output to suit human needs, if necessary.

Junio C Hamano· Sep 21, 2016, 16:19 UTC · re: Leandro Lucarella · lore

Re: 2.10.0: git log --oneline prints gpg signatures in 4 lines

Leandro Lucarella <leandro.lucarella@sociomantic.com> writes:
Show 6 quoted lines
> Hi, starting from 2.10.0 I noticed that when using git log --oneline,
> if commits are signed with GPG, now the signatures are printed too, and
> it takes 3 lines for the signature information + 1 line for the title
> of the commit, so suddenly --oneline became --fourline :)
>
> Is this really intended?

I think so. The documentation for --oneline may say "one line per commit" but in reality, some things cannot be expressed on one line. It should probably be described as "commit object name and its log message is formatted to be on a single line" without limiting other things that the user may have asked to be shown.

And show-signature is an example of what the user additionally can ask that cannot be fit on a single line. There probably are others.

← back to recent threads