From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Fix vc-working-revision return nil when default-directory is not inside repo Date: Mon, 18 May 2020 03:05:57 +0300 Message-ID: <23ccbb54-b768-e586-22df-9277c6251c7b@yandex.ru> References: <4fccd048-d286-d1ee-1963-c073fa83cf8e@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="5328"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 Cc: emacs-devel@gnu.org To: Ilya Ostapyshyn Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon May 18 02:11:46 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 1jaTNi-0001JA-Gi for ged-emacs-devel@m.gmane-mx.org; Mon, 18 May 2020 02:11:46 +0200 Original-Received: from localhost ([::1]:45516 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jaTNh-00053O-8w for ged-emacs-devel@m.gmane-mx.org; Sun, 17 May 2020 20:11:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46374) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jaTIK-0003Rj-Bg for emacs-devel@gnu.org; Sun, 17 May 2020 20:06:15 -0400 Original-Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:40778) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jaTIF-0003YD-Eu for emacs-devel@gnu.org; Sun, 17 May 2020 20:06:09 -0400 Original-Received: by mail-wr1-x442.google.com with SMTP id e16so9750358wra.7 for ; Sun, 17 May 2020 17:06:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=kYQFrdRsUJvAFOzKZRrCcawXbA7kgg53oPyEdUCzXcM=; b=K4h/In2YnMVbd3ocodKSmrybtSkzflNO/dYQ7DJciFwHT1g0HIpMqlPb1tHJjllk7x sCkRfXDb8IvClVYqivhpG1W9i02hL1B7bqRNG+qeYDUaXiPqIgxDKZEQbzuVpzBChT8Z zAcmw0OUc3UzVBPmz4d0oJqKPSkJw5QNQvCfGKHoLxmG+ZDbKpesQVI6M1eJOzwfHtDd s1qfYaDaqeP9sOh9flxEA/RVSBfMvhnZAcbTy1sSkuiKhRUoMoblD4Ypsgdh1W+LREh3 UwvK6cgFQL4vWJCJ60nmETIBZCCBNExj1VBEyqDy63WG5DYrkyw60jXfFc1SyqEzGJ9I jXEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=kYQFrdRsUJvAFOzKZRrCcawXbA7kgg53oPyEdUCzXcM=; b=VIY/IZuMRHzZi4wJkwv+jZ+Y5AHd+UEz4osof3imHMGAVvoLT+/JyamZywB9g0ZgxA fKZNBluAbgncbCoFgbWcBiVZeDJxb5T1j4lQZ6u1RrL7hBKzaiJwDThKBwnFQCjAUgat AxiIvfGpc9ovUm9w4f4AShH3FP0rrR2WjNcl3nnLyQ/BecXwFDqYjWmqihdyTuW5Ezji 7+JM72sX+KCndxb9DYMJVC3HRE+L+g6B1ULFET9c3LM9p7XSjiLQX7qdENJIwQFArgiS CZcXnFJG2XoYAnHE9NHqktd/60ZFkAAMoWxq1LM0adivGbONG9iiUwtLmvguLWhlGwX8 DLHg== X-Gm-Message-State: AOAM5332BiO4uZakYlU+tx1lLWfgjZGdGrqLqO4Gdcyi2N8vmW2SBT2O vyaPwofujb0a1i0+jH9B3/tKbKNn X-Google-Smtp-Source: ABdhPJw8gGYZZkmMzfSEvZK5rvJhPtgZjDvdvAwLrZvugJMjuZ0tenf8KMyt0BVnLj/khz3WwblyAg== X-Received: by 2002:a5d:6087:: with SMTP id w7mr18038173wrt.158.1589760359161; Sun, 17 May 2020 17:05:59 -0700 (PDT) Original-Received: from [192.168.0.3] ([66.205.73.129]) by smtp.googlemail.com with ESMTPSA id z11sm14114353wro.48.2020.05.17.17.05.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 17 May 2020 17:05:58 -0700 (PDT) In-Reply-To: Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::442; envelope-from=raaahh@gmail.com; helo=mail-wr1-x442.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: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-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:250688 Archived-At: On 17.05.2020 17:17, Ilya Ostapyshyn wrote: > Despite the complex scenario I described, the issue is not hard to > reproduce. > > 1. Open a file in a Git repository > 2. (vc-working-revision buffer-file-name) > => working revision hash > 3. (cd "/") > 4. (vc-file-clearprops buffer-file-name) ;; clear the cached revision in symbol's props > 5. (vc-working-revision buffer-file-name) > => nil OK, thank you for the examples. Indeed, the behavior is not well-defined, so let's fix it, especially considering the performance difference is negligible. I've pushed a fix to master, a slightly different version of your patch. This will be in Emacs 28. Regarding doing it in another place, that would be inside vc-git-working-revision. Maybe we'll switch to that approach later, given that neither Hg not Bzr seem to have exhibited the same problem. But I went with the "safer" option now.