From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Ilya Ostapyshyn Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Fix vc-working-revision return nil when default-directory is not inside repo Date: Sun, 17 May 2020 16:49:07 +0300 Message-ID: References: <4fccd048-d286-d1ee-1963-c073fa83cf8e@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="64577"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.91 (darwin) Cc: emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun May 17 15:49:41 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jaJfh-000Ggw-B9 for ged-emacs-devel@m.gmane-mx.org; Sun, 17 May 2020 15:49:41 +0200 Original-Received: from localhost ([::1]:59522 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jaJfg-0000oB-Ea for ged-emacs-devel@m.gmane-mx.org; Sun, 17 May 2020 09:49:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39402) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jaJfE-0000N6-Tj for emacs-devel@gnu.org; Sun, 17 May 2020 09:49:12 -0400 Original-Received: from mail-lf1-x144.google.com ([2a00:1450:4864:20::144]:44067) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jaJfD-0001EL-Uy for emacs-devel@gnu.org; Sun, 17 May 2020 09:49:12 -0400 Original-Received: by mail-lf1-x144.google.com with SMTP id d22so5662262lfm.11 for ; Sun, 17 May 2020 06:49:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:message-id:user-agent :mime-version; bh=hNx2HuK8aEzT0axk3cfA+76Fi4cV3p6N3Tw78be3Vo8=; b=k5MdUXoW4Qf8JwQLXXV7/1g33RqNQbmJM9e5RwI+SlDFlU3ZAmE6PEGDBk07qDcxhw qqULkGrfLSNeV7gfZnIFNatIVMKJ8dOY1adnMfEG152J5mDLxrgazDOmuISOG37ixqKE eUkolZpv1eRXjsaNaGjfCjUD9Pa+iPsMKC87JuZJgrjocHH86ZG3oVNZcZe4YMSSrLtu 45+Oih8Erksu9BaJ4G74SYAY3I7wSAaO0ENScnPEJ7BXmOKX7v2EUOjsU7cOLcOHIH0l h9QOj7Qd0YFrsEosBQAU/XB0eBhPKKVeC8gBj7xd0i1hsjebcJMjPxYa+Fza6AQJ2azm StOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:message-id :user-agent:mime-version; bh=hNx2HuK8aEzT0axk3cfA+76Fi4cV3p6N3Tw78be3Vo8=; b=n3xNnM5BK7Ed6RhbX0JKfv2y6cDiJDDpgKL5vo0cVuX440owo6ku15Wlpg8n49/Vut SCI1V5ZTKyqt9IPlXzmPNFwtwJqYa+bCoHSviTD66zHKPYTmjmtnjgKTXFmiPQxOWEK6 PcF6io+OjIiamLvtj3sOnoMaAwYc4L6/LiGrMPM/SpQZE6TuW5gPKdTSdU518Ae/NY3L gT62c1ak8q6k+hHqvgzwqLAj2+m684UN4dx2cLlIaCFopWyNGdq8Zjjp3A9XDiSdvl6/ 6qgRekt3++cYWm0kViVxAKHvXbfZeE8ysaoW3TvWH2DcwY02tHIK6VqqOHo0OWYt6VZV 5G8Q== X-Gm-Message-State: AOAM531DhXQdkZnnIPiJRowi+zOOYEG7Xqr0O6LfI9drSk8R1qOk1U/K 5iqLjJVNXc5/4y3QkPsI+cN0TFYi2hw= X-Google-Smtp-Source: ABdhPJx/gbb4Ksqy9YFOIF0/6gAgTLy0otgkWXfWdOzHql3qPHD7FBHh5SuNsTmmJBXWW0K5YVbX3A== X-Received: by 2002:a19:7104:: with SMTP id m4mr8527291lfc.75.1589723349757; Sun, 17 May 2020 06:49:09 -0700 (PDT) Original-Received: from ilya-mbp.local ([195.114.146.13]) by smtp.gmail.com with ESMTPSA id f9sm4774753ljf.99.2020.05.17.06.49.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 May 2020 06:49:09 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::144; envelope-from=ilya.ostapyshyn@gmail.com; helo=mail-lf1-x144.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:250600 Archived-At: Dmitry Gutov writes: > Hi Ilya, > > On 17.05.2020 14:16, Ilya Ostapyshyn wrote: >> "vc-git-mode-line-string" (which is called automatically) failed >> occasionally with an error message (wrong-type-argument arrayp nil) when >> the default-directory is outside the repository. > > Could you describe a full scenario when this can happen? My initial-buffer-choice is "~/somedir/startup-file.org", and emacs-startup-hook sets the default-directory to $HOME, so that it's not "~/somedir/" after starting up emacs. ~/somedir/ is also a git repository, containing the gnus configuration (.newsrc in particular). I usually start gnus just after loading up emacs (to remind, default-directory: "~", current buffer: "~/somedir/startup-file.org") and that's the only situation when this error has happened to me. Not every time, but often enough to be annoying. When this happens I am unable to reach gnus until I explicitly cd into ~/somedir/ directory. The buffer in which the error has been occuring is .newsrc-dribble I am unsure why this does not show up consistently, but it's clear that the cause is the mismatch of the directories. The patch has fixed the issue for me. I am running GNU Emacs 27.0.91 (build 2, x86_64-apple-darwin17.7.0, NS appkit-1561.61 Version 10.13.6 (Build 17G11023)). The issue has also appeared on Emacs 26.3.