X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:references :mime-version:content-type:in-reply-to; q=dns; s=default; b=w/5p 9fxp2adaN8msSBvA+FUM1fuLGrHHfJ8KX4eTc1us6CF77pGRDjjFoTe4g++l5Kff q2izcuhSoCxAiGwl/xDQkXqULrA5pN25rTp5nDaus8Xq9WaTGDe/eDzJZRBnrVBl z1reiDHfHYgSyunSKBizSIAsSKGBD87YeLqoDC4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:references :mime-version:content-type:in-reply-to; s=default; bh=0So/waqQwq W+jHtH3i4VrhV55rE=; b=MiIHua4tCB3K25yBOff4nlsueynCaoRIURhhYAmgPX TTqDBKJ7jVyaMMfGS77oYsmiSDX3JLG9O+ACCNzpp17UIGziAUI6TUHy9d7WJ8ec PB98Tst7KhfC11xAOoy23vJTNnLRZU30LVUk/pxxtt/YrVvI9QLPtd8ZdLXSK9rl o= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=BAYES_00,KB_WAM_FROM_NAME_SINGLEWORD,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 spammy=validates, CIFS, cifs, cygcheck X-HELO: mail-wm0-f52.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Sl2uq63q358cEE3UiguWKo1oJ/mglA/jKohR7iwhO4s=; b=hlkAnJN31APOPcxiIY3g0OYNkMwWCNZViFURwJw3ndPsRbkjQREe9CjECqSiV93Ia6 qMApFmyNJrW/Fp2raV8jSI6kRQPLv2sOHFalIFyxvgI/CVYgfmj1TQwRiviv2rBHMxkQ vQwSUMnRKaMYTByl38TSQ60WsctIu7SCJ6vHz9iibGqr9ax/f2dKUZXoajmLfQIz9+/F UhbrCUXJJ4q81v+fKSEiXPfv+s2U7LTHZ3b/NQQi7I/K7wr/j6LMbPj6NLY3PK+afBig AibNW2pfPkMjpo696Hg5WGxZK1O/FNW5CO38D+ylW+NUrs9sA/XdO2PLMSTrZ1JeXI4q dIQg== X-Gm-Message-State: AJaThX6MjEj5iT69pjLijCr9qxXd3libsF0XHuckz0wQHeXvqYaZOzpJ 0PpEqasbwKpNhoXBKrxeZI1kZ8R9gSc= X-Google-Smtp-Source: AGs4zMaEQEZ6UGxBcAdo5Kze71eohNdTeFnfR26VaiW9m0FTJwvTc154y5Ui8CfT/DHODCwSyaH9kw== X-Received: by 10.28.213.143 with SMTP id m137mr815499wmg.67.1511260051910; Tue, 21 Nov 2017 02:27:31 -0800 (PST) Date: Tue, 21 Nov 2017 10:27:28 +0000 From: Adam Dinwoodie To: cygwin AT cygwin DOT com Subject: Re: Git status delay Message-ID: <20171121102728.GM20681@dinwoodie.org> References: <092c4159-1f86-a64a-6ae1-c9909ef4ef90 AT gmail DOT com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <092c4159-1f86-a64a-6ae1-c9909ef4ef90@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-IsSubscribed: yes On Saturday 18 November 2017 at 09:13 pm +0000, Richard H Lee wrote: > I have an issue with git where it hangs for 10 to 20 seconds on several > commands, including "git status". For me this is reproducible on a fresh > install of Cygwin x64 in Windows 7. > > I get the feeling I am doing something wrong on my end as "git status" is a > very commonly used command, yet I see no mentions of this on the Cygwin > mailing list. > > Using gdb I can see git hang in the function validate_headref on an lstat > call. validate_headref pretty much does what it says and validates the HEAD > reference file. validate_headref is called multiple times for different > candidate paths for the HEAD reference file, e.g. ".git/HEAD" etc. For some > reason the path "//HEAD" is checked and this is causing a delay. Paths > starting with "//" are treated in Cygwin as CIFS paths and the delay comes > from the timeout when Windows tries to resolve the hostname "HEAD" to a > server. > > Subsequent executions of "git status" return immediately as I guess the > resolution of "HEAD" as a hostname is cached. > > I don't recall having this problem previously. > > Does anyone else experience this issue? I've seen a couple of reports of this behaviour, although I can't immediately rememeber whether they were from Git users on this mailing list or from Cygwin users on the upstream Git mailing list. Your analysis is spot-on: Git is trying to find the directory that contains all the metadata for the current working copy, and traversing up the directory structure to do so. In circumstances I haven't managed to characterise (I don't see this problem) it sometimes tries to parse //HEAD -- on most POSIX systems, this is equivalent to /HEAD, but on Cygwin it refers to the UNC path \\HEAD, which Windows attempts to look up on the network. That network lookup is the cause of the delay you're seeing. (I believe this is a bug in Git, on the grounds that (a) Git in general supports POSIX systems and giving special meaning to paths starting with `\\` is allowed, if unusual, POSIX behaviour, and (b) Git specifically supports Cygwin, and this is very well documented Cygwin behaviour.) In the name of being able to report this usefully upstream (and ideally being able to reproduce it myself) can you give me a bit more information about your environment? Specifically, I'm after: - The cygcheck output per the bolded bullet in the problem reporting guidelines: http://cygwin.com/problems.html. - The version of Git you're running, per `git --version`, if it hasn't been installed using Cygwin's setup-*.exe installers. - The current working directory when you run `git status`. - Details of the directory structure of the repository you're running `git status` in. I'm mainly after where the `.git` directory is in relation to the current working directory, but if there's anything else that's not entirely standard I'd like to know that, too (e.g. it being a bare repository). - Whether you're running Bash in MinTTY, Windows cmd shell, or something else. - If there's anything special about your shell prompt (e.g. you're using one of the git prompt tools to include repository status summaries in your shell prompt). Cheers, Adam -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple