git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yucheng Zhou <zhouyucheng98@outlook.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Taylor Blau <me@ttaylorr.com>, git@vger.kernel.org
Subject: Re: Feature request for shorter relative date format in log
Date: Thu, 3 Aug 2023 10:54:47 +0800	[thread overview]
Message-ID: <MEYP282MB2280E174A5B4FFE11DDB5C40BE08A@MEYP282MB2280.AUSP282.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <xmqqsf915b54.fsf@gitster.g>

Thank you for your reply!

Actually, I think there is no need to allow users to config the switching of granularity. The current relative format has already done a great job.
What I want is, a handy way to show a shorter relative date (like the “--short” flag in git status). And the current switching of granularity should be reused.

The only thing need to be changed, is the vocabulary for representation. For example, the “2 minutes ago” can be represented in “2m”, and “10 days ago” to “10d”. 
If both the past and future timestamps should be taken into account, we can use a prefix “-” and “+”  to distinguish them. But I think we hardly see a future timestamp in the git log output, so we can let the past timestamps un-prefixed and only prefix the future ones with a “+”, maybe.

The rationale of this feature is saving space in the output, to let more useful information be shown in one line.
For instance, many skilled git users use customized one-line formats in git log, such as “<hash> <date> <author> <title-line>”. Where the <date> can be shortened as much as possible to save space for other important things (especially using with --graph or --decorate). Therefore, a shorter relative date representation of no more than about 3 characters can be a great idea.

To achieve this, a new format like “relative-short” can be introduced. There is no need to let users config so many things. Since there already exists “--date=short” for short absolute date format and “--date=default-local” which consists of two words, I think a new option “--date=relative-short” with a well-designed shorter representation will be very handy and great.


  reply	other threads:[~2023-08-03  2:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-02  6:07 Feature request for shorter relative date format in log Yucheng Zhou
2023-08-02 18:12 ` Taylor Blau
2023-08-02 22:31   ` Junio C Hamano
2023-08-03  2:54     ` Yucheng Zhou [this message]
2023-08-04 18:24     ` Taylor Blau

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

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

  git send-email \
    --in-reply-to=MEYP282MB2280E174A5B4FFE11DDB5C40BE08A@MEYP282MB2280.AUSP282.PROD.OUTLOOK.COM \
    --to=zhouyucheng98@outlook.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=me@ttaylorr.com \
    /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.
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 NNTP newsgroup(s).