git/list[1] front-page[2] threads[3] people[4] search[5] about
 

I've noticed the command `git --git-dir=<path> shortlog`

From
SSURA <surak8806@gmail.com>
Date
Feb 1, 2021, 03:05 UTC
Message-ID
<CAD6AYr-BD08FcbnVfHpOUt7ZwFH0PgoATgyegKnBQ3GOe9isdA@mail.gmail.com>
Hello everyone
OS: manjaro 20.2.1
git version: 2.30.0
I've noticed the command `git --git-dir=<path> shortlog`
It gives me some interesting output

$ git --git-dir=<path> shortlog --summary --email --numbered --committer HEAD --end-of-options | wc -l

When run it, it will tell me how many committers on repo of <path>
But when run it on git repo dir, something interesting happened

$ git clone --bare https://github.com/gitlabhq/gitlabhq.git $ git clone https://gitlab.com/gitlab-org/gitaly.git

$ git --git-dir=./gitlabhq.git shortlog --summary --email --numbered --committer HEAD --end-of-options | wc -l

> 2592
Ok, we can known the gitlab have 2592 committers on HEAD (refs/heads/master) ref
Then something magical happened

$ cd gitaly $ git --git-dir=../gitlabhq.git shortlog --summary --email --numbered --committer HEAD --end-of-options | wc -l

> 2587

Obviously these two outputs are inconsistent, and the second command was affected by the `gitaly repo`

Shouldn't I use `--git-dir` to point to a bare repo? Or something else went wrong?

Thank u!
Next: Jeff King
Message 1 of 12 in “I've noticed the command `git --git-dir=<path> shortlog`”
  1. SURAFeb 1, 2021
  2. Jeff KingFeb 5, 2021
  3. Bryan TurnerFeb 5, 2021
  4. mailmap: only look for .mailmap in work treeJeff King, Feb 9, 2021
  5. Eric SunshineFeb 9, 2021
  6. Junio C HamanoFeb 9, 2021
  7. Jeff KingFeb 10, 2021
  8. Junio C HamanoFeb 9, 2021
  9. Jeff KingFeb 10, 2021
  10. Junio C HamanoFeb 10, 2021
  11. Jeff KingFeb 10, 2021
  12. Jeff KingFeb 10, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.