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

2016-09-21 Thread Junio C Hamano
Jeff King  writes:

> 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.






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

2016-09-21 Thread Junio C Hamano
Leandro Lucarella  writes:

> 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.






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

2016-09-21 Thread Michael J Gruber
Leandro Lucarella venit, vidit, dixit 21.09.2016 15:53:
> On Tue, 20 Sep 2016 19:15:33 -0400
> Jeff King  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


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

2016-09-21 Thread Leandro Lucarella
On Tue, 20 Sep 2016 19:15:33 -0400
Jeff King  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... :(

-- 
Leandro Lucarella
Technical Development Lead
Sociomantic Labs GmbH 


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

2016-09-21 Thread Leandro Lucarella
On Tue, 20 Sep 2016 19:15:33 -0400
Jeff King  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".

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.

> 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 


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

2016-09-20 Thread Jeff King
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).

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