git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: SURA <surak8806@gmail.com>
To: git@vger.kernel.org
Subject: I've noticed the command `git --git-dir=<path> shortlog`
Date: Mon, 1 Feb 2021 11:05:13 +0800	[thread overview]
Message-ID: <CAD6AYr-BD08FcbnVfHpOUt7ZwFH0PgoATgyegKnBQ3GOe9isdA@mail.gmail.com> (raw)

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!

             reply	other threads:[~2021-02-01  3:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-01  3:05 SURA [this message]
2021-02-05 16:57 ` I've noticed the command `git --git-dir=<path> shortlog` Jeff King
2021-02-05 20:02   ` Bryan Turner
2021-02-09 17:29     ` [PATCH] mailmap: only look for .mailmap in work tree Jeff King
2021-02-09 19:00       ` Eric Sunshine
2021-02-09 22:16         ` Junio C Hamano
2021-02-10 16:05         ` Jeff King
2021-02-09 21:23       ` Junio C Hamano
2021-02-10 16:15         ` Jeff King
2021-02-10 20:10           ` Junio C Hamano
2021-02-10 20:31             ` Jeff King
2021-02-10 20:34               ` Jeff King

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=CAD6AYr-BD08FcbnVfHpOUt7ZwFH0PgoATgyegKnBQ3GOe9isdA@mail.gmail.com \
    --to=surak8806@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.
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).