Re: git-shortlog hangs on bare repo without --bare option
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 27, 2008, 22:41 UTC
- Message-ID
- <7vod3em67d.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <7vvdxmm78o.fsf@gitster.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 21 quoted lines
> René Scharfe <rene.scharfe@lsrfire.ath.cx> writes: > >> Garry Dolley schrieb: >>> I didn't see this happen with git 1.5.x, but if you do git-shortlog on a bare >>> repo, without specifying --bare, the command will seemingly hang indefinitely. >> >> FWIW, I tried git 1.5.0 and it hangs, too. Which exact version did work >> for you? Could you, based on it, bisect the commit that introduced this >> behaviour? >> >> As a workaround, you can use "git log | git shortlog". > > It is not a workaround. Shortlog can work as a filter to "git log", but > if you give revs to work on, e.g. "git shortlog -s -n v1.5.6.5.." or "git > shortlog HEAD", it can generate the log and feed to itself. > > Somehow it (perhaps incorrectly, I did not look at the command line input) > judging that your command line is telling it not to do the log generation > itself but instead you will feed the log from its standard input, which > happens to be your terminal. So another workaround would be to type the > series of log messages ;-)
And I think this is related to the complexity that snuck in when worktree feature was added to the setup sequence.
Untested, but I think this would help.
setup.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git c/setup.c w/setup.c index 6cf9094..296f712 100644 --- c/setup.c +++ w/setup.c @@ -461,7 +461,7 @@ const char *setup_git_directory_gently(int *nongit_ok) inside_git_dir = 1; if (!work_tree_env) inside_work_tree = 0; - setenv(GIT_DIR_ENVIRONMENT, ".", 1); + set_git_dir("."); check_repository_format_gently(nongit_ok); return NULL; }