git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* git log --oneline cannot display dates
@ 2018-04-02 12:05 David Hoyle
  2018-04-02 12:40 ` Jeff King
  0 siblings, 1 reply; 2+ messages in thread
From: David Hoyle @ 2018-04-02 12:05 UTC (permalink / raw)
  To: git

When using the git log command with the --oneline switch, you cannot
add the --date=<date> switch to see the dates. The only workaround is
to create an alias and use the --pretty-format which doesn't provide
the ability to colour the branch and tag information (as far as i can
tell).

regards
David Hoyle.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: git log --oneline cannot display dates
  2018-04-02 12:05 git log --oneline cannot display dates David Hoyle
@ 2018-04-02 12:40 ` Jeff King
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff King @ 2018-04-02 12:40 UTC (permalink / raw)
  To: David Hoyle; +Cc: git

On Mon, Apr 02, 2018 at 01:05:01PM +0100, David Hoyle wrote:

> When using the git log command with the --oneline switch, you cannot
> add the --date=<date> switch to see the dates.

Right. --date is just about selecting which date format to show, not
whether to show one. The decision of what to show is up to the format,
and --oneline does not include a date.

> The only workaround is
> to create an alias and use the --pretty-format which doesn't provide
> the ability to colour the branch and tag information (as far as i can
> tell).

You can use "%C(auto)" to turn on auto-coloring for various components:

  git log --format='%C(auto)%h%d %s'

which reproduces the usual coloring and format of --oneline. Then you
should be able to add in your own date, colored as you wish. E.g.:

  git log --format='%C(auto)%h%d %C(blue)%ad%C(reset) %s'

If you want to use this a lot, you may want to look into the "pretty.*"
config so you can trigger it with a short name.

-Peff

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-04-02 12:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-02 12:05 git log --oneline cannot display dates David Hoyle
2018-04-02 12:40 ` Jeff King

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