git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: David Hoyle <davidghoyle@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: git log --oneline cannot display dates
Date: Mon, 2 Apr 2018 08:40:59 -0400	[thread overview]
Message-ID: <20180402124059.GA396@sigill.intra.peff.net> (raw)
In-Reply-To: <CAFGVh0zWuqa5HswE7JAx3-bOSGGaRAgLa6ULy--+yn_iD5eJRQ@mail.gmail.com>

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

      reply	other threads:[~2018-04-02 12:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-02 12:05 git log --oneline cannot display dates David Hoyle
2018-04-02 12:40 ` Jeff King [this message]

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=20180402124059.GA396@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=davidghoyle@gmail.com \
    --cc=git@vger.kernel.org \
    /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).