New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify switching between relative and absolute date formatting #312

Closed
s-KaiNet opened this Issue Mar 13, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@s-KaiNet

s-KaiNet commented Mar 13, 2018

Hi, thank you for the great work on the project!
I'm just curious if it's possible to change gitlens result view to show the actual date of commit:
image

Sometimes it's more convenient to know an exact date, to find in an external git client. Deducting 28 days from today isn't a trivial task 😉. For example 28 days ago, Feb 25, 2018

@s-KaiNet

This comment has been minimized.

s-KaiNet commented Mar 13, 2018

BTW the same applies to inline code highlights and on-hover popup. Maybe it's possible to make it configurable.

@eamodio

This comment has been minimized.

Owner

eamodio commented Mar 14, 2018

You can control this today. Although it is spread across a few places.

First you can set "gitlens.defaultDateStyle": "absolute" (rather than the default relative), and that will change all the dates that don't have specific overrides to use the gitlens.defaultDateFormat. See https://github.com/eamodio/vscode-gitlens#general-settings

Then you would also need to change the format templates for each of the other areas you wish to control.

For the current line blame, see https://github.com/eamodio/vscode-gitlens#current-line-blame-settings

  1. gitlens.currentLine.format change that to use {date} rather than {ago}

For the gutter blame, see https://github.com/eamodio/vscode-gitlens#gutter-blame-settings

  1. gitlens.blame.format change that to use {date} rather than {ago}

For the status bar, see https://github.com/eamodio/vscode-gitlens#status-bar-settings

  1. gitlens.statusBar.format change that to use {date} rather than {ago}

For the GitLens and GitLens Results views, see: https://github.com/eamodio/vscode-gitlens#explorer-settings

  1. gitlens.explorers.commitFormat change that to use {date} rather than {ago}
  2. gitlens.explorers.stashFormat change that to use {date} rather than {ago}

Given how many options need to be tweaked here, I think I will introduce 2 new tokens agoOrDate and authorAgoOrDate, and then will switch the defaults of all those formats to use those rather than ago and authorAgo. And the behavior of agoOrDate and authorAgoOrDate would honor the gitlens.defaultDateStyle setting.

Thank you for the report and I hope that helps!

@eamodio eamodio added the feature label Mar 14, 2018

@eamodio eamodio added this to the Soon™ milestone Mar 14, 2018

@eamodio eamodio self-assigned this Mar 14, 2018

@s-KaiNet

This comment has been minimized.

s-KaiNet commented Mar 15, 2018

Thank you for such a detailed answer and good news on a new feature! :)

@eamodio eamodio changed the title from Results view commit date format to Simplify switching between relative and absolute date formatting Mar 16, 2018

eamodio added a commit that referenced this issue Mar 16, 2018

@eamodio eamodio closed this in f2dd2b4 Mar 31, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment