git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Kyle J. McKay" <mackyle@gmail.com>
To: Jeff King <peff@peff.net>
Cc: Git mailing list <git@vger.kernel.org>,
	Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH/RFC] git log --oneline alternative with dates, times and initials
Date: Thu, 29 Sep 2016 04:00:06 -0700	[thread overview]
Message-ID: <82EE6519-E58F-4382-87A5-55D9D1BBDCA9@gmail.com> (raw)
In-Reply-To: <20160929083315.vwb3aurwbyjwlkjn@sigill.intra.peff.net>

On Sep 29, 2016, at 01:33, Jeff King wrote:

> On Wed, Sep 28, 2016 at 10:34:51PM -0700, Kyle J. McKay wrote:
>
>> git log-times --graph --date-order --decorate --no-merges -n 5 v2.5.3
>>
>>    === 2015-09-17 ===
>>  * ee6ad5f4 12:16 jch (tag: v2.5.3) Git 2.5.3
>>    === 2015-09-09 ===
>>  * b9d66899 14:22 js  am --skip/--abort: merge HEAD/ORIG_HEAD tree  
>> into index
>>  |   === 2015-09-04 ===
>>  | * 27ea6f85 10:46 jch (tag: v2.5.2) Git 2.5.2
>>  * 74b67638 10:36 jch (tag: v2.4.9) Git 2.4.9
>>                       ..........
>>  * ecad27cf 10:32 jch (tag: v2.3.9) Git 2.3.9
>
> I was surprised to see this as a separate script, but it is true  
> that we
> cannot quite pull it off with --format. I think we are very close,
> though.  With the patches below I think you can do:
>
>  git log \
>    --commit-header='%C(auto,bold blue)== %as ==%C(auto,reset)'
>    --format='%C(auto)%h %C(auto,green)%ad %C(auto,red)%aS/%cS%C(auto) 
> %d%C(auto,reset) %s' \
>    --graph --no-merges --author-date-order --date=format:%H:%M
>
> and get the same (or very similar) output.
>
>  [1/5]: pretty: allow formatting DATE_SHORT
>  [2/5]: pretty: allow formatting names as initials
>  [3/5]: graph: fix extra spaces in graph_padding_line
>  [4/5]: graph: helper functions for printing commit header
>  [5/5]: log: add --commit-header option
>
> Each of those commits[1] needs some minor polish, and as I'm not  
> really
> that interested in fancy log output myself, I don't plan on working on
> them further. I was mostly curious just how close we were. But if  
> you'd
> like to pursue it, feel free to use them as a starting point.

Those patches are missing some of the features like showing root  
commits, handling two letter initials, showing the weekday, inserting  
a break where needed to avoid parent-child confusion in graph output  
and properly handling Duy's initials. :)

I suppose if all the objects that output a date took a '(' <strftime>  
')' option that would get you part of the way -- it could replace  
DATE_SHORT with DATE_STRFTIME.

Also the above example doesn't handle marks properly in graph mode.   
Yes, you can add the "%m" format option but it does something odd and  
the script fixes it up.

On the other hand, git-log-times started out as a script for something  
else (a shell script actually) and just got embellished further and  
turned into a perl script for speed.

Your patches are a good first start though but reading the --graph  
code gives me headaches and I figured it would be like going down a  
rabbit hole to make the code support everything the script does.

The script also has one big advantage.  It works with the version of  
Git everybody already has installed.  :)

And nobody is ever going to want to type several lines of arcane  
formatting instructions to get the output.  ;_)

It would need a new option, perhaps --oneline-extended or something.

The patches are a good start but that doesn't help anyone using Git  
today which is why git-log-times is submitted as a contrib script --  
much like the way diff-highlight is still a contrib script and not  
supported directly by Git either.

--Kyle


  parent reply	other threads:[~2016-09-29 11:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-29  5:34 [PATCH/RFC] git log --oneline alternative with dates, times and initials Kyle J. McKay
2016-09-29  8:33 ` Jeff King
2016-09-29  8:33   ` [PATCH 1/5] pretty: allow formatting DATE_SHORT Jeff King
2016-09-30  6:17     ` Jacob Keller
2016-09-30 10:56       ` SZEDER Gábor
2016-09-30 22:04         ` Jacob Keller
2016-10-01  9:18         ` Jeff King
2016-09-29  8:36   ` [PATCH 2/5] pretty: allow formatting names as initials Jeff King
2016-09-29 17:31     ` Junio C Hamano
2016-09-29 17:32       ` Jeff King
2016-09-29  8:37   ` [PATCH 3/5] graph: fix extra spaces in graph_padding_line Jeff King
2016-09-29  8:38   ` [PATCH 4/5] graph: helper functions for printing commit header Jeff King
2016-09-29  8:38   ` [PATCH 5/5] log: add --commit-header option Jeff King
2016-09-29 17:49     ` Junio C Hamano
2016-09-29 18:31       ` Jeff King
2016-09-29 11:00   ` Kyle J. McKay [this message]
2016-09-29 12:52     ` [PATCH/RFC] git log --oneline alternative with dates, times and initials Jeff King
2016-09-29 17:38       ` Junio C Hamano
2016-09-29 18:30         ` Jeff King
2016-09-29 18:50           ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=82EE6519-E58F-4382-87A5-55D9D1BBDCA9@gmail.com \
    --to=mackyle@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).