nushell: Git histogram example not working

Describe the bug I just started using nushell and it feels great!. I went through the cookbook to check the examples but I could not get the git histogram example to work.

To Reproduce Steps to reproduce the behavior:

  1. Execute the command git log "--pretty=format:%h(nu)%aN(nu)%s(nu)%aD" | lines | split column "(nu)" sha1 committer desc merged_at | histogram committer merger | sort-by merger | reverse in a git repository

Expected behavior I expected an histogram similar to the shown it the examples.

Screenshots image

Configuration (please complete the following information):

  • OS: Windows 10 Enterprise - 1909
  • Nu version: 0.21.0
  • Optional features:

Add any other context about the problem here.

I did some tests and the histogram command seams to work fine. if I change the histogram column parameter from ‘committer’ to ’ sha1’, it works.

There is something related to the column but I could not identify what’s the issue.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 17

Commits related to this issue

Most upvoted comments

I’ve seen this before and unfortunately it’s the difference between git on Linux and git on Windows. I just ran this on windows and it worked.

git log --pretty="format:%h(nu)%aN(nu)%s(nu)%aD" | lines | split column "(nu)" sha1 committer desc merged_at | histogram committer merger | sort-by merger | reverse

Feel free to submit a documentation PR on this issue.

sounds good. i’m closing this then. thanks for your help.

Duh, i forgot there’s a special group-by for dates.

git log --pretty=%h»¦«%s»¦«%aN»¦«%aE»¦«%aD -n 25 | lines | split column "»¦«" commit subject name email date | update date { get date | str to-datetime} | group-by date date | pivot

╭───┬────────────┬────────────────╮
│ # │ Column0    │ Column1        │
├───┼────────────┼────────────────┤
│ 0 │ 2020-11-06 │ [table 2 rows] │
│ 1 │ 2020-11-03 │ [table 4 rows] │
│ 2 │ 2020-11-02 │ [table 1 rows] │
│ 3 │ 2020-10-30 │ [table 4 rows] │
│ 4 │ 2020-10-29 │ [table 2 rows] │
│ 5 │ 2020-10-28 │ [table 2 rows] │
│ 6 │ 2020-10-27 │ [table 3 rows] │
│ 7 │ 2020-10-26 │ [table 4 rows] │
│ 8 │ 2020-10-22 │ [table 3 rows] │
╰───┴────────────┴────────────────╯

group-by date is a subcommand and it’s specifically for dates. So, now everything seems to be working.

Any thoughts of what else we should add to this? https://gist.github.com/fdncred/caa086a07da3b3d7ee771d16999b13d5

I need to go over it again for flow because i jumped back and forth through it and probably lose the readers train of thought.