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

Re: git-shortlog hangs on bare repo without --bare option

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Aug 28, 2008, 07:16 UTC
Message-ID
<fcaeb9bf0808280016k7378cc0ev985f90b270f615e5@mail.gmail.com>
In-Reply-To
<7v8wuim4kv.fsf@gitster.siamese.dyndns.org>
On 8/28/08, Junio C Hamano <gitster@pobox.com> wrote:
Show 18 quoted lines
>  This may be repeating what Jeff said earlier in another thread, but I
>  think we should rethink the start-up sequence carefully.  Ideally (I am
>  thinking aloud)...
>
>   * Have a single function "git_setup()" that notices --bare and --git-dir
>    from the command line and GIT_DIR environment, and does the discovery
>    of git_dir (if not told with the command line or environment
>    explicitly); if we do not find it, do *NOT* barf.  Just record the
>    facts it finds somewhere (e.g. the location of git_dir, absense of
>    git_dir, if the repository is explicitly bare, etc.).
>
>   * As the next step, still in this single function, if we have git_dir,
>    find out where the work_tree is, paying attention to --work-tree from
>    the command line and GIT_WORK_TREE environment if exists.  If we do not
>    have work tree, do *NOT* barf.  Again, just record the facts it finds.
>    If we do not have --work-tree from the command line and if we are not
>    told that it is --bare from the command line, then we may need to open
>    the config to see where core.worktree points at.

Part of worktree issues comes from the fact that worktree setup is spread over many functions, starting at setup_git_dir*() and ending at setup_work_tree(). So setting it up in a single function and turning setup_work_tree() into "check and die()" logic sounds great.

-- 
Duy
Previous: Junio C Hamano
Message 12 of 12 in “git-shortlog hangs on bare repo without --bare option”
  1. Garry DolleyAug 27, 2008
  2. Junio C HamanoAug 27, 2008
  3. Garry DolleyAug 27, 2008
  4. René ScharfeAug 27, 2008
  5. Garry DolleyAug 27, 2008
  6. Junio C HamanoAug 27, 2008
  7. Junio C HamanoAug 27, 2008
  8. Junio C HamanoAug 27, 2008
  9. Junio C HamanoAug 27, 2008
  10. Jeff KingAug 27, 2008
  11. Junio C HamanoAug 28, 2008
  12. Nguyen Thai Ngoc DuyAug 28, 2008

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.