From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Resent-From: Jonathan Ganc Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Mar 2017 02:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 26066@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.148928669510725 (code B ref -1); Sun, 12 Mar 2017 02:45:02 +0000 Received: (at submit) by debbugs.gnu.org; 12 Mar 2017 02:44:55 +0000 Received: from localhost ([127.0.0.1]:51901 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cmtV9-0002mv-A4 for submit@debbugs.gnu.org; Sat, 11 Mar 2017 21:44:55 -0500 Received: from eggs.gnu.org ([208.118.235.92]:43047) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cmtTM-0002jp-46 for submit@debbugs.gnu.org; Sat, 11 Mar 2017 21:43:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cmtTF-0001D0-Ar for submit@debbugs.gnu.org; Sat, 11 Mar 2017 21:42:58 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:52967) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cmtTF-0001Cw-7R for submit@debbugs.gnu.org; Sat, 11 Mar 2017 21:42:57 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34006) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cmtTD-0006aW-P8 for bug-gnu-emacs@gnu.org; Sat, 11 Mar 2017 21:42:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cmtT8-0001CF-SQ for bug-gnu-emacs@gnu.org; Sat, 11 Mar 2017 21:42:55 -0500 Received: from mail-qk0-x22e.google.com ([2607:f8b0:400d:c09::22e]:33599) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cmtT8-0001CA-NV for bug-gnu-emacs@gnu.org; Sat, 11 Mar 2017 21:42:50 -0500 Received: by mail-qk0-x22e.google.com with SMTP id y76so203112761qkb.0 for ; Sat, 11 Mar 2017 18:42:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=/BeGPDOgZ/XK7q1zUi2/rNkN05j4f6oH8dXvHfOHqcs=; b=OADaOfVBQ8kxKtalErh7HHIXZ9AfeF3mXadcppJ5gzTDAjo/GKI5bOn1E5BuoU7CHv ZkV0Zr36Z/M4Fe1lRtx5QHtktRQwA5+N00oEIML+w44Nf1Dbr1HT4KMcUOfp0uApj1sv WB4fP0l/Nwf/iQFHlPDHbq57/SYN/g5XYAc4xmVQtcchZsru+rsbXX2ShN0iQNVULTDL HVjEazRePrmA6BDwHTJg7U/MXDjugwe83QYv+rMkzw2hCUNJ2Tq+LKwhMk1u2KDVyBJL De5u62vBd85PQsYw8SBYeMT52ACrh/Qkt5OM8L89y8WIt7g3GHUgp3DvR243ZPMqWOQ6 LQMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=/BeGPDOgZ/XK7q1zUi2/rNkN05j4f6oH8dXvHfOHqcs=; b=kobwjPTuhxUjcdkdCNO4Whou/7no0AGEn/64k7nwBBIPDAQTTPce7Q1WSYuMbnZz3B GxRKAhnUJK3vzlerFsSoRg0hRqFrUStqDenwROeD3MznexyVlfUUOVJh6O/dXfsTxz0a BMB8BeAHPhAV/xH2Qp+Pd6+0/5+dgKW4ZOfgKEXD4lpYVU6Z78+e9Cgtg9CUnNj4gamq Szbwx7KPBxdKo3y1Zf9iYm/D86KBlwcCBqmWp31uVlIwcGk2Ro4AqhFLK24JrUFnFl/g kPlr1j41cG+LvUx0jJc49siP0r2spuMapvKczFP03tqL9WytXxOH/sBBDSGJcgwl0E1l I5qA== X-Gm-Message-State: AMke39nH9StlCceRZ3YXHovLTTD3Dlrk0bjBxrl3gywiLarm/1gXriFnp9Lw/fzVBYE/aA== X-Received: by 10.55.17.99 with SMTP id b96mr26439545qkh.74.1489286568610; Sat, 11 Mar 2017 18:42:48 -0800 (PST) Received: from [192.168.1.198] (static-98-118-34-152.bstnma.fios.verizon.net. [98.118.34.152]) by smtp.gmail.com with ESMTPSA id z4sm5525919qkc.22.2017.03.11.18.42.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 11 Mar 2017 18:42:48 -0800 (PST) From: Jonathan Ganc Message-ID: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> Date: Sat, 11 Mar 2017 21:42:46 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Mailman-Approved-At: Sat, 11 Mar 2017 21:44:55 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) **To reproduce:** First, we create a simple git repository in a shell: $ mkdir -p ~/Desktop/temp $ cd ~/Desktop/temp $ git init $ echo abc > file.txt $ git add . && git commit -a -m "Init" You can verify that the repository is up to date by running, e.g. 'git status'. Next, we load emacs -Q and run the following: (progn (setq default-directory "/") (require 'vc-git) (vc-git-state "/home/ganc/Desktop/temp/file.txt")) The response is `added'. It should be `up-to-date'. **Notes** I get this same behavior on emacs 24.5, 25.1. I have some ideas about how to fix the problems but I want to make sure this isn't somehow the expected behavior. In GNU Emacs 26.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.20.9) of 2017-03-10 built on lcy01-22 Windowing system distributor 'The X.Org Foundation', version 11.0.11804000 System Description: Ubuntu 16.10 Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Configured using: 'configure --build=x86_64-linux-gnu --prefix=/usr '--includedir=${prefix}/include' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' --sysconfdir=/etc --localstatedir=/var --disable-silent-rules '--libdir=${prefix}/lib/x86_64-linux-gnu' '--libexecdir=${prefix}/lib/x86_64-linux-gnu' --disable-maintainer-mode --disable-dependency-tracking --prefix=/usr --sharedstatedir=/var/lib --program-suffix=-snapshot --with-modules=yes --with-x=yes --with-x-toolkit=gtk3 --with-xwidgets=yes 'CFLAGS=-g -O2 -fdebug-prefix-map=/build/emacs-snapshot-rvTCtk/emacs-snapshot-93192-26848af-emacs=. -fstack-protector-strong -Wformat -Werror=format-security' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro'' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS NOTIFY LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 MODULES XWIDGETS LIBSYSTEMD Important settings: value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message puny seq byte-opt subr-x gv bytecomp byte-compile cl-extra help-mode cconv cl-loaddefs pcase cl-lib dired dired-loaddefs format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind inotify dynamic-setting system-font-setting font-render-setting xwidget-internal move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 96617 5698) (symbols 48 20192 1) (miscs 40 48 115) (strings 32 17613 4552) (string-bytes 1 565163) (vectors 16 14650) (vector-slots 8 482994 4091) (floats 8 48 68) (intervals 56 241 0) (buffers 976 11)) From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 14 Mar 2017 13:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jonathan Ganc Cc: 26066@debbugs.gnu.org Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.148949906625983 (code B ref 26066); Tue, 14 Mar 2017 13:45:01 +0000 Received: (at 26066) by debbugs.gnu.org; 14 Mar 2017 13:44:26 +0000 Received: from localhost ([127.0.0.1]:55019 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cnmkU-0006kx-1L for submit@debbugs.gnu.org; Tue, 14 Mar 2017 09:44:26 -0400 Received: from mail-io0-f193.google.com ([209.85.223.193]:33199) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cnmkS-0006kf-EE; Tue, 14 Mar 2017 09:44:24 -0400 Received: by mail-io0-f193.google.com with SMTP id f84so16431994ioj.0; Tue, 14 Mar 2017 06:44:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=ioXi/d8ggGNeZDc/TLsuwjKfbgD0BxpHuyZhLHDlwQg=; b=p3bQ+q9KYdJQsE/Z1nAXw5687g1AdkRieO+T3ajENhPEQYCoUL+4MseV6erjZ1rtD+ 0tQbjDhXxH1hKhGSh26JeA1gKNhMEr+YTM7+h+YeGzWqA7CwqrRjHRGckELBq4DSdumW sEBRjkOr5Lg1QhfGKxDOb02Jl8IqZRUinHFfSrDjRuHr37e2Pla8h/meII/4pYg2x0IO TG36PSkYjzi614D5s0ozcNBYssNZXJVrkw5ywNJ2RnMsPjCjQLgXTZ9Tw2HTqy5LsrT4 4AkrQU3C4wq4qKnFPUc2YO4bU3rIq1UmVTPkbiREs+uBDYWvVAz5ol5M+INq3+A4XBy3 20BQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=ioXi/d8ggGNeZDc/TLsuwjKfbgD0BxpHuyZhLHDlwQg=; b=d2fMEpjrNDvO+Yb5ZqpD9+jMyAKCYofP8dOI0OXPULELZ78r76d6RLf96tLm8ogSD9 qhrz6VEoR8nNsJg0/DbDkuev+s6r52goRto5PfaYESAG6KeJg0sNpBrVsc1fgltQoZ9m LhZe6V8yWhmq+o+eX8hIXSAUj3n8ePPoIknkA8s7E9o9oDDBoMcXX9cw2PArQZBIbKLJ IVyhlrJ+xuOq1c0K0eK5jkObQDwRiygKXm6AdwD4EVl26ZUvFWHDaFTxsYvaAEuU2ZWM OPKnzKD9I7AUS9/sUKS7mjceZ5jbTstMBprcE4Mq01S5dmlhFrBzOE294KWlZUdNnNik WgKg== X-Gm-Message-State: AMke39mfK4dP1cCeYND+w/mB2aruYFAQ9mptT4FS2e0uxggvKMWt6FSzf9/oIDEuvvec2A== X-Received: by 10.107.181.10 with SMTP id e10mr32969292iof.156.1489499058795; Tue, 14 Mar 2017 06:44:18 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id f196sm215115itc.2.2017.03.14.06.44.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 Mar 2017 06:44:18 -0700 (PDT) From: npostavs@users.sourceforge.net References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> Date: Tue, 14 Mar 2017 09:45:36 -0400 In-Reply-To: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> (Jonathan Ganc's message of "Sat, 11 Mar 2017 21:42:46 -0500") Message-ID: <87y3w855vj.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.1 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) retitle 26066 vc-git-status gives wrong result when called from outside repository severity 26066 minor found 26066 24.5 found 26066 25.2 quit (list (let ((default-directory "/")) (require 'vc-git) (vc-git-state "/home/npostavs/src/emacs/emacs-master/README")) (let ((default-directory "/home/npostavs/src/emacs/emacs-master/")) (require 'vc-git) (vc-git-state "README"))) ;=> (added up-to-date) Jonathan Ganc writes: > I get this same behavior on emacs 24.5, 25.1. I have some ideas about > how to fix the problems but I want to make sure this isn't somehow the > expected behavior. I doubt this particular behaviour is expected, but it's probably unexpected that you would call vc-git-status from outside the repo. If you can fix things to handle this case without harming the normal case, that sounds fine to me. From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> In-Reply-To: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 16 Mar 2017 00:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 26066@debbugs.gnu.org Cc: Jonathan Ganc Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.148962490420568 (code B ref 26066); Thu, 16 Mar 2017 00:42:01 +0000 Received: (at 26066) by debbugs.gnu.org; 16 Mar 2017 00:41:44 +0000 Received: from localhost ([127.0.0.1]:57702 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1coJU7-0005Lg-Tx for submit@debbugs.gnu.org; Wed, 15 Mar 2017 20:41:44 -0400 Received: from mail-it0-f52.google.com ([209.85.214.52]:37341) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1coJU6-0005LT-Gk for 26066@debbugs.gnu.org; Wed, 15 Mar 2017 20:41:42 -0400 Received: by mail-it0-f52.google.com with SMTP id g138so30736890itb.0 for <26066@debbugs.gnu.org>; Wed, 15 Mar 2017 17:41:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version; bh=gkFzTfWvWnbuYK/4HsI2iRT410Cr6McQj3QWl+PI3aE=; b=a9EcluGpL6Jo/N7V5f7ku6ZQrkndqh7/NMM6FHl8QRyVO5FpzMK1ECNAOEjksUqtIH 6eFkDUxj9CdKAjXtuEhkmjdMJCUij9krkLwI4lKIbPHstXEmZIV2fQQoJZ2C8YPL6Kvm qKeLId934pq1JnZjAU7bAU3PlWdR9SqwlrybmioWyosMcKUzv/+U0XJxkDNniicDzpvR sMsoxifnWSyYnZkgO0SyRzeE3mmgLUTk+SYtP4aW1NKnRC7R9K+nPggME+Wj0Yig0Ra4 qUwP9I8c06zbcovF24MfIQu1mWYAGkBzEx9U+xgxITpYKGHWTQvvvFpI7STKm+yXHXQm wnCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version; bh=gkFzTfWvWnbuYK/4HsI2iRT410Cr6McQj3QWl+PI3aE=; b=W+RFrqPpjkdg0vPCVjv5eomMC+NMH4Js1iVaPjwfT69nhaqCDCgTr0b05NXuZc5cME yn0zhpac73efyJDiCkrZAbILIqcvaBk45BvwW8vbYwemIpIplTi5ZCCstaV5XUWOoNyn oV3AEg8dENWbYfcH3/V8ddsBKXgG/1sV2luOf9tvOkaOWlPrHy4TmY4MZYVCPBG7IkCl mI5A0nSC8SAgj5408JiJ1YvLCeujFY7u2rgIGRdLgpksISvta4d5fHh5YNVY6riAlG4L taiyZubWNy/pzBPGXRH25aHAKIVo+wnCzUS9PH3KGO9TxsnF6iEe7I0JL/sfHL/hoc/K uYMQ== X-Gm-Message-State: AFeK/H333d04D7VXhXh8Y44zUddnmW/0NthTbjVp6qtSdU5kH+NzK92/m0mfl92iMAyAlQ== X-Received: by 10.36.212.129 with SMTP id x123mr7521975itg.103.1489624896791; Wed, 15 Mar 2017 17:41:36 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id f196sm299226itc.2.2017.03.15.17.41.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Mar 2017 17:41:35 -0700 (PDT) From: npostavs@users.sourceforge.net Date: Wed, 15 Mar 2017 20:42:54 -0400 Message-ID: <87efxy59wx.fsf@users.sourceforge.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) --=-=-= Content-Type: text/plain [Please use Reply All to keep 26066@debbugs.gnu.org on Cc] --=-=-= Content-Type: message/rfc822 Content-Disposition: inline Subject: Re: bug#26066: 26.0.50; vc-git-status gives wrong result To: npostavs@users.sourceforge.net References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <87y3w855vj.fsf@users.sourceforge.net> From: Jonathan Ganc Message-ID: <6fb773c4-5f05-1965-8fb1-a425cefbfddd@gmail.com> Date: Tue, 14 Mar 2017 20:25:57 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 In-Reply-To: <87y3w855vj.fsf@users.sourceforge.net> X-Spam-Score: -1.1 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (jonganc[at]gmail.com) -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.220.171 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.5 RCVD_IN_SORBS_SPAM RBL: SORBS: sender is a spam source [209.85.220.171 listed in dnsbl.sorbs.net] X-Headers-End: 1cnwlQ-0001HR-Bi MIME-Version: 1.0 Content-Type: text/plain The actual problem is with the function vc-git--empty-db-p, which acts in the directory default-directory (implicitly, through vc-git--call and then process-file). Thus, I think replacing (in vc-git-state) (vc-git--empty-db-p) with (let ((default-directory (file-name-directory file))) (vc-git--empty-db-p)) should resolve the issue without side effect. As an aside, is there a reason that vc-git-status does not use "git status -z --porcelain --ignored"? It seems more natural/straightfoward and it would also deal with ignored and removed files. It could also work with directories, which the current function doesn't. --=-=-= Content-Type: text/plain Let-binding default-directory sounds okay. Regarding 'status -z --porcelain', I think it might not have been available at the time te code was written. I'm not sure how far back we need to maintain compatibility. --=-=-=-- From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 16 Mar 2017 00:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: npostavs@users.sourceforge.net, 26066@debbugs.gnu.org Cc: Jonathan Ganc Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.148962531521319 (code B ref 26066); Thu, 16 Mar 2017 00:49:02 +0000 Received: (at 26066) by debbugs.gnu.org; 16 Mar 2017 00:48:35 +0000 Received: from localhost ([127.0.0.1]:57723 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1coJal-0005Xn-8l for submit@debbugs.gnu.org; Wed, 15 Mar 2017 20:48:35 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:34696) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1coJaj-0005XY-OQ for 26066@debbugs.gnu.org; Wed, 15 Mar 2017 20:48:34 -0400 Received: by mail-wr0-f196.google.com with SMTP id u48so3983551wrc.1 for <26066@debbugs.gnu.org>; Wed, 15 Mar 2017 17:48:33 -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=9O2zeV2K1N0Yycts9AwMYHbX3yE6xiJxgniE3af+BX0=; b=r6BIXcHdOyEFez2sVj+8BK1Qzr+13f5R6vFzourUB3Itxl03tP39zFOwbg+j8OfUoN JV8wDJEb//bDhBkXQJzt6KG7Rvpn1NJdIWP6wzepa5WTmg48WbO4IpFsbIvFHaINr1Yw cCDo8Nw5qTKiJlOl3RRQVQ4wi8BdM2K/c1x36HHfdYDZ4Zq5lkAYHApPHJAtzx54p1TR lXZDK0ubq/n7kprOvV9U37EmAlPFjhy5XOZVjyY9pxM8R3FsjneqEIJ6BmNupaoyfpPr xAOwgIQG3P+Sl+0FC46lhUrGwMVeQjOIb6SbQPEM1UuDDfAO/D8XdQIM/GEHLwMrawAV ff7g== 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=9O2zeV2K1N0Yycts9AwMYHbX3yE6xiJxgniE3af+BX0=; b=smD/AcRlQwjh6y12HIzPWm5l+Yve1/36NnFV4NjFWI5HTt9a9SHwgqN8EbMTaOTWNs TXoqoZlX1o+lDuquWCEqoxbp1+C3dZkWa7CO3WvsT5Ucz6ROhSJtWeYdFbq3VdUxzKQv Mlb6GZXEsc92C21MzOLdwqXI3P1WCU2ZVdPzrq/pIiPnk2bKu4G3xebpdnc4EfHQrtcq tTAJ8YKx6IUuCMcU+K4mU+WDRgzXhW9NjBPTbHcFy98v929390ppdnAxjzGCUyTP2fAf i8Pwplp8/emqB3I7X0NGUE0/jmchi3RQ0p/QvXzTw7+TGMYe/8q0Np2CNJC0LhwYaxnI yUBA== X-Gm-Message-State: AFeK/H3LJxDqTLAYOMUJ7TmvHJb0YWbyBjPNSBDMVI5UTyt/42UqVnRVJDUENBtZxuhCkA== X-Received: by 10.223.164.9 with SMTP id d9mr5466425wra.146.1489625308097; Wed, 15 Mar 2017 17:48:28 -0700 (PDT) Received: from [192.168.1.3] ([185.105.173.156]) by smtp.googlemail.com with ESMTPSA id r8sm4168875wrb.33.2017.03.15.17.48.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Mar 2017 17:48:27 -0700 (PDT) References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <87efxy59wx.fsf@users.sourceforge.net> From: Dmitry Gutov Message-ID: <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> Date: Thu, 16 Mar 2017 02:48:24 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: <87efxy59wx.fsf@users.sourceforge.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -2.1 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) On 16.03.2017 02:42, npostavs@users.sourceforge.net wrote: > As an aside, is there a reason that vc-git-status does not use "git > status -z --porcelain --ignored"? It seems more natural/straightfoward > and it would also deal with ignored and removed files. It could also > work with directories, which the current function doesn't. Like mentioned in a discussion on a different bug, we'll accept a patch like that. You can even reuse some code from `vc-git-conflicted-files`. From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Resent-From: Jonathan Ganc Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 16 Mar 2017 02:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dmitry Gutov , npostavs@users.sourceforge.net, 26066@debbugs.gnu.org Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.148963204913222 (code B ref 26066); Thu, 16 Mar 2017 02:41:01 +0000 Received: (at 26066) by debbugs.gnu.org; 16 Mar 2017 02:40:49 +0000 Received: from localhost ([127.0.0.1]:57787 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1coLLN-0003RB-6j for submit@debbugs.gnu.org; Wed, 15 Mar 2017 22:40:49 -0400 Received: from mail-qk0-f193.google.com ([209.85.220.193]:36773) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1coLLL-0003Qv-4H for 26066@debbugs.gnu.org; Wed, 15 Mar 2017 22:40:48 -0400 Received: by mail-qk0-f193.google.com with SMTP id n141so4380523qke.3 for <26066@debbugs.gnu.org>; Wed, 15 Mar 2017 19:40:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=V/v1h598aea7xqx9ZlU7hhXc3ribJZDVHsO9lDI+GLw=; b=Ip56iw11Fmo81NfISYPsKTGHBrohh1mNejE8BVkyvEZITG8PF8A+4pbT2IihlcwA8Z pjbfy1HbWtI7EPXD3zZWimYvQAJvtrV4B4q7QzXZ1wwEojH+baNZSjoa28Ty+zWcujzs AqodX2BV54xUYaGfWUSZjYbP7NMcK+uMUMIPs7oYcJp4N1hWAdDNAKkIvSCTyyNwi1So xG7CcykCKlyoC5iFPxzdaAlluLci+aobwWtWXtAX9P5LeNdKd6o5pc7NrXFiBy7hmEo9 943wA0zEk5Hm/H777KGArPctOOY9nnKMlPGthJ3kFJuAyeKjXoY54kLM17+dSJ7KksN1 I1sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=V/v1h598aea7xqx9ZlU7hhXc3ribJZDVHsO9lDI+GLw=; b=kSc3m4MlhaNvC5osm+KFdhPDonAIbKss/NEDnihcnhD4nHbJRhz7Snkr6H7RfizA2U 50jPk28/jx53MHc7DgoYQGTpwHoml4mSxDdWVMPSQsEZ53oH9acIN4v5Z04wB5TXgMLL ruH6ch3hdQpFWMjitCU2l3QtV2ZiktPNLkdKZPVwQKJWBJ7UFRSwqnf0sSKqT/tIfT7A UqLySyi/os+i4ZwOhhGUB6jHjH5JMGpYnonGZ1DpIeqYSQOzkvfhDgXxqm31cxMMD+Dg DKpOkiHvH6/kbZzP+EB/f5hKRBv7ieub5Cpe3r/zozVeGXOSTrSO1L2E7nCqmbZPZRrQ Y8wA== X-Gm-Message-State: AFeK/H29gnV8i84jYBaJugRBrNRVrdfbmfBYCtShMwaHWoIQJiYpQpk9Aw34DMyModzgXw== X-Received: by 10.55.64.139 with SMTP id n133mr5758978qka.38.1489632041577; Wed, 15 Mar 2017 19:40:41 -0700 (PDT) Received: from [192.168.1.198] (static-98-118-34-152.bstnma.fios.verizon.net. [98.118.34.152]) by smtp.gmail.com with ESMTPSA id j20sm2704389qke.14.2017.03.15.19.40.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Mar 2017 19:40:41 -0700 (PDT) References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <87efxy59wx.fsf@users.sourceforge.net> <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> From: Jonathan Ganc Message-ID: <29d4a5ae-0ca0-3a86-6b9a-ab616803f39e@gmail.com> Date: Wed, 15 Mar 2017 22:40:40 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) First of all, I realized that the let binding needs to surround the entire vc-git-state function, not just (vc-git--empty-db-p) (because vc-git--run-command-string, vc-git--call have the same issue with default-directory). E.g., change (let ((diff (vc-git--run-command-string file "diff-index" "-p" "--raw" "-z" "HEAD" "--"))) to (let* ((default-directory (file-name-directory file)) (diff (vc-git--run-command-string file "diff-index" "-p" "--raw" "-z" "HEAD" "--"))) But yes, I will work on an improved version using git status and try incorporate/improve on vc-git-conflicted-files. (My ultimate goal is to try to get something like atom's status for git files into emacs, which is how I noticed the problem to begin with). On 03/15/2017 08:48 PM, Dmitry Gutov wrote: > On 16.03.2017 02:42, npostavs@users.sourceforge.net wrote: >> As an aside, is there a reason that vc-git-status does not use "git >> status -z --porcelain --ignored"? It seems more natural/straightfoward >> and it would also deal with ignored and removed files. It could also >> work with directories, which the current function doesn't. > > Like mentioned in a discussion on a different bug, we'll accept a > patch like that. You can even reuse some code from > `vc-git-conflicted-files`. From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Resent-From: Jonathan Ganc Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 Mar 2017 02:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dmitry Gutov , npostavs@users.sourceforge.net, 26066@debbugs.gnu.org Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.14898046965817 (code B ref 26066); Sat, 18 Mar 2017 02:39:02 +0000 Received: (at 26066) by debbugs.gnu.org; 18 Mar 2017 02:38:16 +0000 Received: from localhost ([127.0.0.1]:33120 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cp4G0-0001Vk-ID for submit@debbugs.gnu.org; Fri, 17 Mar 2017 22:38:16 -0400 Received: from mail-qt0-f193.google.com ([209.85.216.193]:32982) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cp4Fy-0001VV-UP for 26066@debbugs.gnu.org; Fri, 17 Mar 2017 22:38:15 -0400 Received: by mail-qt0-f193.google.com with SMTP id r45so11568533qte.0 for <26066@debbugs.gnu.org>; Fri, 17 Mar 2017 19:38:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to; bh=3z3FIRyDE15d034Msfy2rMsXG+yMwO2grogVkBu9ftg=; b=InX4pJC+hu9vukB1WYsGBTa/xoVwXzI1W3wzASAsQ2kHtGHd71fkDTSCrdR+81hXZ6 j88wtvPqvU9MjmnoGVZdK/mYQarr/fzop01K12grgOVQHLuCVLeE5RaZfVJiglzWUEaW QzC3IMwcgg/2/0550Qa8EzdiQjFsKSHHoHmgvyEzmdpWYEl4TvEygco2nbFR3+qBSyEF ee0PerPM6X8hShyhjZRX+TVlg5ipq9K4v7dpVlYNnwQUiPXrhlc71HXkAfNVgwkpMVKQ mRjhCgV3mDJM20piQDI5Ws+YNAicU9tWYTWXDxLak/vN/IOYGM2fVhyOfa/IVG6q1Tfw MGZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to; bh=3z3FIRyDE15d034Msfy2rMsXG+yMwO2grogVkBu9ftg=; b=opjhNlIqQpnFyg0oP4pnLfOnafIGXPmClYoDS0t6VT9rva/nxx4v/G0if51Ank8zbI l7ve8SlPGd2yKOPa8wkf5TVbv67gbzG0m1eOmQvhW5IpFNr9yKeL4O3bvh4wmS/6ui5A xj8st533mEeW3gEafe83MJm4mZnhJYL1SRY0NINLTh6bqqglnFxExBAkCIsDFbtQOlEP T3KXxGqVk+Bz0sVnDTeUKu1ZTByUrlpndF+HGfIZLyRdkmeZ2Yv2xO1Ei8SfA+XpcNjB fL7YHIY8x8fNUtdYRQnbsdcIbb880+4b+chzcHCGkqEwFag1kI2uq2ux1IGjxbbKJmW+ If7Q== X-Gm-Message-State: AFeK/H1d7aeb697cSsYxsqmtzbyOn6yaaq22W0s2FsV+ftXeTrpA0dzJfqiGfHUqwdKUMg== X-Received: by 10.237.60.41 with SMTP id t38mr16460011qte.148.1489804689464; Fri, 17 Mar 2017 19:38:09 -0700 (PDT) Received: from [192.168.1.200] (static-98-118-34-152.bstnma.fios.verizon.net. [98.118.34.152]) by smtp.gmail.com with ESMTPSA id x2sm7255201qkc.61.2017.03.17.19.38.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Mar 2017 19:38:08 -0700 (PDT) References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <87efxy59wx.fsf@users.sourceforge.net> <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> From: Jonathan Ganc Message-ID: <0c76ec71-c0d2-42c7-a04e-a4f2520fadf7@gmail.com> Date: Fri, 17 Mar 2017 22:38:07 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> Content-Type: multipart/mixed; boundary="------------2C1B4862E5E5BC4E5B7B4625" X-Spam-Score: 0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) This is a multi-part message in MIME format. --------------2C1B4862E5E5BC4E5B7B4625 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Hi. I have never submitted an emacs patch before so I don't know if I am doing this correctly (or if one of you has already submitted a fix). I have attached a patch file. Later, I will submit the more elegant fix. On 03/15/2017 08:48 PM, Dmitry Gutov wrote: > On 16.03.2017 02:42, npostavs@users.sourceforge.net wrote: >> As an aside, is there a reason that vc-git-status does not use "git >> status -z --porcelain --ignored"? It seems more natural/straightfoward >> and it would also deal with ignored and removed files. It could also >> work with directories, which the current function doesn't. > > Like mentioned in a discussion on a different bug, we'll accept a > patch like that. You can even reuse some code from > `vc-git-conflicted-files`. --------------2C1B4862E5E5BC4E5B7B4625 Content-Type: text/x-patch; name="0001-Fix-default-directory-for-vc-git-Bug-2606.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Fix-default-directory-for-vc-git-Bug-2606.patch" >From 85a9df8a15b32dc7d884efa74e53c6d20fabaee6 Mon Sep 17 00:00:00 2001 From: Jonathan Ganc Date: Fri, 17 Mar 2017 22:35:46 -0400 Subject: [PATCH] Fix default-directory for vc-git (Bug#2606) --- lisp/vc/vc-git.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 1a3f1bf..6f20a8d 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -244,8 +244,12 @@ (defun vc-git-state (file) ;; This assumes that status is known to be not `unregistered' because ;; we've been successfully dispatched here from `vc-state', that ;; means `vc-git-registered' returned t earlier once. Bug#11757 - (let ((diff (vc-git--run-command-string - file "diff-index" "-p" "--raw" "-z" "HEAD" "--"))) + + ;; `default-directory' determines where vc-git-... looks for the + ;; local git repository + (let* ((default-directory (file-name-directory file)) + (diff (vc-git--run-command-string + file "diff-index" "-p" "--raw" "-z" "HEAD" "--"))) (if (and diff (string-match ":[0-7]\\{6\\} [0-7]\\{6\\} [0-9a-f]\\{40\\} [0-9a-f]\\{40\\} \\([ADMUT]\\)\0[^\0]+\0\\(.*\n.\\)?" diff)) -- 2.9.3 --------------2C1B4862E5E5BC4E5B7B4625-- From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 21 Mar 2017 09:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jonathan Ganc , npostavs@users.sourceforge.net, 26066@debbugs.gnu.org Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.149008798017196 (code B ref 26066); Tue, 21 Mar 2017 09:20:01 +0000 Received: (at 26066) by debbugs.gnu.org; 21 Mar 2017 09:19:40 +0000 Received: from localhost ([127.0.0.1]:37205 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cqFx5-0004TH-CP for submit@debbugs.gnu.org; Tue, 21 Mar 2017 05:19:39 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:33982) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cqFx3-0004T4-7T for 26066@debbugs.gnu.org; Tue, 21 Mar 2017 05:19:37 -0400 Received: by mail-wm0-f65.google.com with SMTP id u132so1770471wmg.1 for <26066@debbugs.gnu.org>; Tue, 21 Mar 2017 02:19:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=rBg9AtEq4T4fCscrWxECoMnNUGEHjbF2UiJ2Na3qp9g=; b=L0wWqS66yWnKgeL15IbGXXAjallketdKXB7fbOlEvlpchmO08/v5G1IsBE53yOOakT hw/B1YzDDCzdNXVxVJDODm+s1s4nfyyKHzt+QAoWMnYBFi2Bymz8oRrh4Cnv/bskC/hX XpLNq7Ifg0WOdhiGk1SfQvw2+2qOhT1+Hkhl2+pDZJum0BwIZmesfA7eZp66ob51EhxU AF5POhlNuxNiBOvbyJ+nKSjNXYKrdwpXDVZAg1XZAgVfwF/bCT1XIoSnnnADkS3mqM24 B/qZ3S1ZPlR/ZLt3vfaLqCm3cjdB8zJDpPfFxtCX8vRDDW9bj1xX+CW5PEtBrnlDm6V0 Mb8Q== 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:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=rBg9AtEq4T4fCscrWxECoMnNUGEHjbF2UiJ2Na3qp9g=; b=Tn/0Q+d11pY+1gDZRVfoDYey9R5mRrRuhGndO1r63bWRMueXuJJK2EhRPxlzbLlTxe 2/lFoCNuswRR9GLAlBWX+1Nl3b6GJ1psYh7YZLQP/netn61uSqT/pj/ZftZqYQpKErYo Nf6LSgh5ZUSCTXmFeyDb9h0mMUWKVHv90eGFayfesUnDzRH2Und+PHN0eTQBpIVDKc1M R//RHbTfglKBK0VJG/LRfu/2xzTrC5ImIABfZvYvqlDAWgwCZ37SwGQinRdfD2JSPYuP KeXinqcBsy+arQ+VpHvgJkq4kRGIuqZJ7hFpmCZDjnyIe2dlS4C9LgImmMeU7cGjI51B jn1g== X-Gm-Message-State: AFeK/H3Pd5vyyvKOEz2eW3m0eKG29Io1NNuhs2DQ/zysuSFcPFs1nufWwwZrlRhyIwo6KA== X-Received: by 10.28.227.213 with SMTP id a204mr1629937wmh.120.1490087971567; Tue, 21 Mar 2017 02:19:31 -0700 (PDT) Received: from [192.168.1.3] ([185.105.173.156]) by smtp.googlemail.com with ESMTPSA id l21sm24086177wrl.59.2017.03.21.02.19.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Mar 2017 02:19:31 -0700 (PDT) References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <87efxy59wx.fsf@users.sourceforge.net> <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> <29d4a5ae-0ca0-3a86-6b9a-ab616803f39e@gmail.com> From: Dmitry Gutov Message-ID: <4741bddf-9765-0d94-d0cd-b94e3e4914e1@yandex.ru> Date: Tue, 21 Mar 2017 11:19:29 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: <29d4a5ae-0ca0-3a86-6b9a-ab616803f39e@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) Hi Jonathan, On 16.03.2017 04:40, Jonathan Ganc wrote: > (My ultimate goal is to try to get something like atom's status for git > files into emacs, which is how I noticed the problem to begin with). Could you expand on what you are trying to do, and how this bug stops you from doing it? From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Resent-From: Jonathan Ganc Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 21 Mar 2017 16:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dmitry Gutov , npostavs@users.sourceforge.net, 26066@debbugs.gnu.org Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.149011264230837 (code B ref 26066); Tue, 21 Mar 2017 16:11:01 +0000 Received: (at 26066) by debbugs.gnu.org; 21 Mar 2017 16:10:42 +0000 Received: from localhost ([127.0.0.1]:38180 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cqMMs-00081J-Ea for submit@debbugs.gnu.org; Tue, 21 Mar 2017 12:10:42 -0400 Received: from mail-qt0-f169.google.com ([209.85.216.169]:32865) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cqMMq-000817-O3 for 26066@debbugs.gnu.org; Tue, 21 Mar 2017 12:10:40 -0400 Received: by mail-qt0-f169.google.com with SMTP id i34so134760155qtc.0 for <26066@debbugs.gnu.org>; Tue, 21 Mar 2017 09:10:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=KnugyW4eUt5jnHfWmD0zzxvgtYMsGU4RYn8O3pd5r5A=; b=pNEIPdL6U5zuHMgn+xWJXCzwEZEVAL7jfTkgrLtU2FpizEXC3zzZ/uSWT2GdfqXmbj dIKXNtjqEOxWco6td3zE0hpB/RaZV4VaGV57Kboy68VQT6+RLRYqQxQdP4JMKMBcDiNZ qEjTLokBJsgff1NtqPfB904/ZIWzgCviyOXZXxw9RSOsk4C6LqTJXXGc/7pFrcxMTZhq Ebq37P4MG8oloIDk3eV9UMDjoCZ04O6SDVc13S7U8Zdg0lGBUjV0AfeUIN+g9HM2iDgZ 8m8ljnqs+YupA+staFe2o2CDa40gUuzlMB0S6uO//IyfBq/k3kxR7+HTH2dUfhKFNZ0g 1qAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=KnugyW4eUt5jnHfWmD0zzxvgtYMsGU4RYn8O3pd5r5A=; b=WTnDqAQzTl46dEEw+0MeftY8dlOlsWH5dPw0aZNLiHjugydTbZUWYUehfrcIJmKapC jWpK22rfJsHUKGFCl0Sj4PFBGh9v2lVPZCesr0WRcb4y0EIgJZa3WXSJPm2mIAY5oA9e 3kd/7rShN6vBW1JhHOqrdriC74OIvQl1NT9UrSSZFirs7iLKAAo07McxQpRP7//ulcd0 /dSixZDsjgHw8SrA9FwLCixoNFsC7VQoD7DumoQT7hX2TAjet30xmruiJbihiLjnshuO fh2HBfL6waj0QdlM472s2DSbmuvXYHMeTvcJFq28YXwZkX3uKVvRzR9PFOw+E39oXfL+ AHGA== X-Gm-Message-State: AFeK/H3UU1faMDofeftsuP1kngFg77g9nJS0ZpASOYLG80tqZ9DXdN5MO/WhTKEt7MIbXA== X-Received: by 10.200.4.171 with SMTP id s43mr34538138qtg.150.1490112635040; Tue, 21 Mar 2017 09:10:35 -0700 (PDT) Received: from [10.148.5.39] (c-65-96-175-120.hsd1.ma.comcast.net. [65.96.175.120]) by smtp.gmail.com with ESMTPSA id a184sm11689097qkc.68.2017.03.21.09.10.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Mar 2017 09:10:34 -0700 (PDT) References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <87efxy59wx.fsf@users.sourceforge.net> <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> <29d4a5ae-0ca0-3a86-6b9a-ab616803f39e@gmail.com> <4741bddf-9765-0d94-d0cd-b94e3e4914e1@yandex.ru> From: Jonathan Ganc Message-ID: <8530cd03-0158-f198-9b14-ade983e1c7f4@gmail.com> Date: Tue, 21 Mar 2017 12:10:33 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <4741bddf-9765-0d94-d0cd-b94e3e4914e1@yandex.ru> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) Hi, Well, the ideal situation is if could get a listing like the one atom has for projects, where you get a visual view of directories and can see folders with changed files as well as the status of files (orangish means modified, green means new, greyed means ignored): http://imgur.com/a/PiiGF Actually, emacs has something not so dissimilar in the Neotree package. (Install it and use `(setq neo-vc-integration '(face char))` ). It has a few shortcomings: 1. Because of this bug, it was giving me the wrong status for files, i.e. they showed up wrong. That is how I noticed the bug in the first place. 2. I would like to be able to color directories as well as files. I don't know if that is something that would have a component in vc-git.el / vc-....el or would go entirely in some package (e.g. Neotree) 3. It would be nice to be able to show mutiple directory trees at once in Neotree, though this is not as important. The first, big problem is that, because of this bug, On 03/21/2017 05:19 AM, Dmitry Gutov wrote: > Hi Jonathan, > > On 16.03.2017 04:40, Jonathan Ganc wrote: > >> (My ultimate goal is to try to get something like atom's status for >> git files into emacs, which is how I noticed the problem to begin with). > > Could you expand on what you are trying to do, and how this bug stops > you from doing it? From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 22 Mar 2017 12:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jonathan Ganc Cc: npostavs@users.sourceforge.net, 26066@debbugs.gnu.org, Dmitry Gutov Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.149018468321287 (code B ref 26066); Wed, 22 Mar 2017 12:12:01 +0000 Received: (at 26066) by debbugs.gnu.org; 22 Mar 2017 12:11:23 +0000 Received: from localhost ([127.0.0.1]:38732 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cqf6p-0005XH-6Y for submit@debbugs.gnu.org; Wed, 22 Mar 2017 08:11:23 -0400 Received: from mout.web.de ([212.227.17.11]:49379) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cqf6m-0005X2-4D for 26066@debbugs.gnu.org; Wed, 22 Mar 2017 08:11:20 -0400 Received: from drachen.dragon ([92.208.182.212]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0LkhFg-1cIhnT0XnY-00aYRZ; Wed, 22 Mar 2017 13:10:59 +0100 From: Michael Heerdegen References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <87efxy59wx.fsf@users.sourceforge.net> <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> <29d4a5ae-0ca0-3a86-6b9a-ab616803f39e@gmail.com> <4741bddf-9765-0d94-d0cd-b94e3e4914e1@yandex.ru> <8530cd03-0158-f198-9b14-ade983e1c7f4@gmail.com> Date: Wed, 22 Mar 2017 13:11:01 +0100 In-Reply-To: <8530cd03-0158-f198-9b14-ade983e1c7f4@gmail.com> (Jonathan Ganc's message of "Tue, 21 Mar 2017 12:10:33 -0400") Message-ID: <874lyla4ve.fsf@drachen> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:hyBzbhfI5wz/saMp8+l6s995VEExylr8izcNj6OHGpFbkts9OBS P4LLR79A3UyzDURNKk73W1ftRWqVV/VzcU+TgxfFgNi4vw5a6UlLev68caM+chYNGclpt5U 6Un31nwvr1S5nU1VjvB5QxvJBH1VkH27LcP1xDaHJuim/Gj8DHZr6TJFl5fGVLl/rcJt783 NyZyO/30MAq4nBXQL76TA== X-UI-Out-Filterresults: notjunk:1;V01:K0:8O73dlkyNCs=:5ukal9qK+mFuI4n0QcP20i NUbsjhZMmtt4eH+SlxvLlWGrjuiPjJf60LneL9ujU7nOcFtryOsahUoHgkWYPa4adYLPx7oJy cyKKfwDpxELjliaE1HS180Y7sqmrfZhuyuCQLMe5OCeF3r7/O0P/ow7eqabmeqtX7S/Szgrjw 53QCFXQkg3Y1w8h94fQy9oE7rIBmt5IHX1H+KhO6BdphIen/gLAqp4o4f7YsR1mFc3ayImoWG zAmXbJgOc3aUTzsQ7HHSKjwd9diCuE3rsmDrAuuX+bHwckJrsgnZwKPgO6t1jOW/JdpWXCLOd r9P1CHVD7gK4p9RR5DA/q25SxBA8+2hW/gPbwvDnxSVMiuPYjyHcBrMiuys4zT9VNnRklu1Tg Fbnuwh3cMReGwUjoPkfV0SKjk2z0UbhGyqC4AHrjSg6NBwoNp8jIcSdmOg59phdmPRv3Hn1HA q1TTJPoeqN9qlbLR8Ml11FFs9KrrvRmZxRuLfYhc+Ny9uzecm2OWl16LI5edRM3YxPlL/aWxr SAMVqrDwZ3/PkbDaeIQ4LF64UE6opHYM2ZqKitMCqlF5h39/mdMfS1MUudxejR1xjR9a3sxzm qxeENQrw4ctlVaBjUYkqEMucQEv5GXY5HpwChqmZj7JW2Tc3QCQfr4frQ+phmev/qvK5NbYQH kFdSJjZZjIUQxZJg2H10rDDR2eXINOgYulbokDyZ2Nl05V+Y1VvsUMxc0BZKOK44BvWKEFJug pF/hvQBwxJf3bFulLMhjw2ObMUsFx6B+ewg/tm8Gk3JyL0iwxebjtY97hdsTC744B6NvuEHdt EeTf6h8b7G29bHdpsLH/jqJWYZxKnwqqT33441wzq7t6WkdiGWzSczR+I4cTxATYUCiMQYIHy pcZn7nKW6x85C1+RTJMA== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Jonathan Ganc writes: > http://imgur.com/a/PiiGF I didn't quite follow the whole thread, but you might also want to try `diff-hl-dired-mode' implemented by the diff-hl package in Gnu Elpa. Michael. From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 22 Mar 2017 16:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jonathan Ganc , npostavs@users.sourceforge.net, 26066@debbugs.gnu.org Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.149019961819366 (code B ref 26066); Wed, 22 Mar 2017 16:21:02 +0000 Received: (at 26066) by debbugs.gnu.org; 22 Mar 2017 16:20:18 +0000 Received: from localhost ([127.0.0.1]:39630 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cqizi-00052H-1K for submit@debbugs.gnu.org; Wed, 22 Mar 2017 12:20:18 -0400 Received: from mail-wr0-f173.google.com ([209.85.128.173]:34053) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cqizf-000523-6i for 26066@debbugs.gnu.org; Wed, 22 Mar 2017 12:20:15 -0400 Received: by mail-wr0-f173.google.com with SMTP id l37so132470640wrc.1 for <26066@debbugs.gnu.org>; Wed, 22 Mar 2017 09:20:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=iWIzoPwkauUWIIC3Gb6+cuv5V8oFvS7CUY5ymSoFlBU=; b=EiLiBb5JYPRYkNpPWrslEcpjcCC6z2+bm61Y9Qe3F/BAJQpkxtnDnRUGts78b/Vc9V a86kgSS51lCTbL9w24xd+8JFdjKeNo/8qd5htB8ip0CDn1Ts8sgH6+FjPEwOFB9PDfBJ 1dh099IPwP8rqE2PEV7puGGwvOT8Y+NemW7D8fW7o03bB3L5GX6bSkDl1MZl4Mham709 p5WXxNqDVG+/FvE/WEwuTp1Vu53uIFu9i6z0kBlih1eHvr1WcwkwRQQGZEO1pJnnvivp 9oEOopHvuN0toLJOe+XaEKm6WztPrT8CGJ8orlCdg7P/ewMzSSSjAKzQJwA9SFlp25lx JfmA== 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:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=iWIzoPwkauUWIIC3Gb6+cuv5V8oFvS7CUY5ymSoFlBU=; b=bDTZXh33tmCoH855U4FbGacFPu4ZTDqhMdWB7rkQAiJzLPyGTOi5oMDsfEyvb9Ww8P AlqwjhEQiXsC5EVW29/U8NaZPWTzUI/Xnqekxd+HgHqGw9Z4I0WaKSUMGBF2aoPlq0cf fAieTXG7k+auebmshCSPd9FkxGx7DTndbE2CJ4hOA4Becay2ye4yyR2aJhUeIUe4DSC4 t6MVPKi8BMsjlIYLMP4HlXshLblOkCoVH3mXB23XBKEuG4vGufpnI4h/sMGjDzZL1HE2 H4HL3XSE3dP3UAL6K06YKRfkC5N4Nv4/oQE9tmYn/2Nt5/B7W2iHpnBR0TWGIXQefjfx 2AyA== X-Gm-Message-State: AFeK/H35BCSdDnoC1qfiUmN+GZe3PHZYeWSoknGf7YC/ZqEvYU5/0evJoJAzSW045ZWqHA== X-Received: by 10.223.134.149 with SMTP id 21mr39679184wrx.1.1490199609271; Wed, 22 Mar 2017 09:20:09 -0700 (PDT) Received: from [192.168.0.133] (static-nbl2-118.cytanet.com.cy. [212.31.107.118]) by smtp.googlemail.com with ESMTPSA id c35sm2381102wra.1.2017.03.22.09.20.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Mar 2017 09:20:07 -0700 (PDT) References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <87efxy59wx.fsf@users.sourceforge.net> <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> <29d4a5ae-0ca0-3a86-6b9a-ab616803f39e@gmail.com> <4741bddf-9765-0d94-d0cd-b94e3e4914e1@yandex.ru> <8530cd03-0158-f198-9b14-ade983e1c7f4@gmail.com> From: Dmitry Gutov Message-ID: <022c0e0a-e039-24ef-66ff-82bcedbacd93@yandex.ru> Date: Wed, 22 Mar 2017 18:20:04 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: <8530cd03-0158-f198-9b14-ade983e1c7f4@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -2.1 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) On 21.03.2017 18:10, Jonathan Ganc wrote: > Well, the ideal situation is if could get a listing like the one atom > has for projects, where you get a visual view of directories and can see > folders with changed files as well as the status of files (orangish > means modified, green means new, greyed means ignored): > > http://imgur.com/a/PiiGF > > Actually, emacs has something not so dissimilar in the Neotree package. > (Install it and use `(setq neo-vc-integration '(face char))` ). It has a > few shortcomings: > > 1. Because of this bug, it was giving me the wrong status for files, > i.e. they showed up wrong. That is how I noticed the bug in the first > place. I see, thanks. Neotree does have an optional feature that colors the tree leaves according to their VC statuses. The problem might have gone unnoticed until now because file's status is cached, and because it can only be apparent if several projects are opened at the same time. While the problem is fairly obvious, a proper fix would most likely touch other backends and commands, to the point that the default-directory binding might have to be done inside vc-call-backend. There is a very simple workaround on the caller's side, though: bind default-directory inside the Neotree code, to the respective project root (or just the file's parent directory). That will be necessary anyway for it to work in the released Emacs versions. > 2. I would like to be able to color directories as well as files. I > don't know if that is something that would have a component in vc-git.el > / vc-....el or would go entirely in some package (e.g. Neotree) This differs from one version control system to another, but Git doesn't actually track directories. So the notion of "directory status" is poorly defined. But see the previously mentioned diff-hl-dired-mode. > 3. It would be nice to be able to show mutiple directory trees at once > in Neotree, though this is not as important. If it's unable to show the non-current projects, how is the bug triggered? default-directory would have to be outside of the project. From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Resent-From: Jonathan Ganc Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 23 Mar 2017 02:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dmitry Gutov , npostavs@users.sourceforge.net, 26066@debbugs.gnu.org Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.14902355159281 (code B ref 26066); Thu, 23 Mar 2017 02:19:01 +0000 Received: (at 26066) by debbugs.gnu.org; 23 Mar 2017 02:18:35 +0000 Received: from localhost ([127.0.0.1]:39971 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cqsKg-0002Pd-VM for submit@debbugs.gnu.org; Wed, 22 Mar 2017 22:18:35 -0400 Received: from mail-qk0-f194.google.com ([209.85.220.194]:35140) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cqsKf-0002PR-65 for 26066@debbugs.gnu.org; Wed, 22 Mar 2017 22:18:33 -0400 Received: by mail-qk0-f194.google.com with SMTP id o135so28480938qke.2 for <26066@debbugs.gnu.org>; Wed, 22 Mar 2017 19:18:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:references:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=babLhV8iCh4Ba7QSYoGavZ9oxtyVMDKtoG9ZtoB5PRk=; b=vG19Oa86rPUZzOT57POoNX7yIOgl0EBG5sk+jnPZuTJem4dFkExbSj0Ou2cN4iaH3M f3aZq31c4ZIAPnIlrsHry95KD//Djkhkk+6VaAsLZKCxo/hh08zyagT1xpJJW/vuK6pk swbq4Rv/lmpy7i1RB7Wh8tm+opAPp1TcID8Q5sU0w46dkFCOXvOvk7yPDjUxqYpHsUK/ 9tFvvd6Y/bZqbG0ZpD9+DZp0BVQVWbhI/zZn/SP0QnMaes9gC2MCYZeeEH1zoXIY9RRh 7/Bvim5zl/VnSSJJi2wlowGii0+7ip3yd1Z/IWj49hI+NRHhG0mPHReCqPGEuK9z0gt7 Zjqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=babLhV8iCh4Ba7QSYoGavZ9oxtyVMDKtoG9ZtoB5PRk=; b=KFuWukX7WXCSVWj7tqz/HZ46vJ4mbhqGBD5p/ygGAnjYuf8gLTtH1RHdafsam+ug/w MrtPiFpBkxwLCJXZihge41pt4gMH7Jf7I9MukcRMJ2hUmwLQsk0DAsnaIWvjCVo8mxqj RzaxiYC7IOIwpXeeXPa6oePNDSXYclHBE2L0depXBKKwnWj/jXTPdfiJKQ1Or4+LL/OL /+eIo2TRpJvZFzML7PLMyirziFxoCHl/68ccWZBg4HaHvwK3wG/30VKFAtiWPIvNz6xO Tjuwig1dIeKMxOWzjGAsejDxNqWckocBaiCmxloLLoNc5PNG6MfahYLR/vBuovMmJ/6I icog== X-Gm-Message-State: AFeK/H1p7x+QWWcXamKVosaI/0cMQjjK6/aG+PX1GGZ7UHZN5hC7XkNXNYNuHG5o4TSSpQ== X-Received: by 10.55.12.67 with SMTP id 64mr73857qkm.291.1490235507605; Wed, 22 Mar 2017 19:18:27 -0700 (PDT) Received: from [192.168.1.200] (static-98-118-34-152.bstnma.fios.verizon.net. [98.118.34.152]) by smtp.gmail.com with ESMTPSA id o91sm2296296qte.42.2017.03.22.19.18.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Mar 2017 19:18:26 -0700 (PDT) From: Jonathan Ganc References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <87efxy59wx.fsf@users.sourceforge.net> <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> <29d4a5ae-0ca0-3a86-6b9a-ab616803f39e@gmail.com> <4741bddf-9765-0d94-d0cd-b94e3e4914e1@yandex.ru> <8530cd03-0158-f198-9b14-ade983e1c7f4@gmail.com> <022c0e0a-e039-24ef-66ff-82bcedbacd93@yandex.ru> Message-ID: Date: Wed, 22 Mar 2017 22:18:25 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <022c0e0a-e039-24ef-66ff-82bcedbacd93@yandex.ru> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) Hi, Thanks for both responses. >> 3. It would be nice to be able to show mutiple directory trees at >> once in Neotree, though this is not as important. > > If it's unable to show the non-current projects, how is the bug > triggered? default-directory would have to be outside of the project. I'm not actually sure why it is causing me problems. I just tried using Neotree and encountered this problem. I didn't try anything special besides opening the window. I'm not sure how/why Neotree sets default-directory. I need to look into this. > The problem might have gone unnoticed until now because file's status > is cached, and because it can only be apparent if several projects are > opened at the same time. > > While the problem is fairly obvious, a proper fix would most likely > touch other backends and commands, to the point that the > default-directory binding might have to be done inside vc-call-backend. Yeah, I'm not really sure what the workflow should be; I'm just getting started with the vc functions in emacs. One issue, though, is that default-directory can only be set for functions that identify a filename, because we need to have a directory to set things to. For this reason, I don't know that one could generally set default-directory in vc-call-backend. It could make sense to set default-directory for vc-git--run-command-string (although to get vc-git-state to work, one would still need to set it for vc-git--empty-db-p). It's worth nothing there seems to be inconsistency within vc-git. Some commands like vc-git-checkin, vc-git-next-revision, do set default-directory to the directory of the input file; other comands like vc-git-merge-branch seem to do the opposite and assume the root is already given by default-directory. At the very least, the documentation for vc-git-state should note that default-directory needs to be set. > > There is a very simple workaround on the caller's side, though: bind > default-directory inside the Neotree code, to the respective project > root (or just the file's parent directory). That will be necessary > anyway for it to work in the released Emacs versions. > That may be the best answer. I am not so familiar with the Neotree code but it should be doable. >> 2. I would like to be able to color directories as well as files. I >> don't know if that is something that would have a component in >> vc-git.el / vc-....el or would go entirely in some package (e.g. >> Neotree) > > This differs from one version control system to another, but Git > doesn't actually track directories. So the notion of "directory > status" is poorly defined. But see the previously mentioned > diff-hl-dired-mode. > You're right, in principle, but atom handles it by coloring directories based on if they have modified files within. I don't know if there is a "canonical" way to do this, although one idea would be to return a list of all file status in the directory, e.g. `(up-to-date modified ignored)`. I started looking through diff-hl. It looks like it has a bunch of neat and useful features, though I admit I was a bit confused by the workflow. From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Resent-From: Jonathan Ganc Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 31 Mar 2017 03:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dmitry Gutov , npostavs@users.sourceforge.net, 26066@debbugs.gnu.org Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.149093017211725 (code B ref 26066); Fri, 31 Mar 2017 03:17:02 +0000 Received: (at 26066) by debbugs.gnu.org; 31 Mar 2017 03:16:12 +0000 Received: from localhost ([127.0.0.1]:53406 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ctn2q-000333-2z for submit@debbugs.gnu.org; Thu, 30 Mar 2017 23:16:12 -0400 Received: from mail-qt0-f193.google.com ([209.85.216.193]:36435) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ctn2o-00032q-Ji for 26066@debbugs.gnu.org; Thu, 30 Mar 2017 23:16:11 -0400 Received: by mail-qt0-f193.google.com with SMTP id n37so8728322qtb.3 for <26066@debbugs.gnu.org>; Thu, 30 Mar 2017 20:16:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to; bh=fvXdrcDgI9xxqXfXKSX19ixlHRXimdDbxGTsDP0ExBM=; b=ZaftMZjQF3s/Kfe9cjdRJMISeJnkXP9zcc4ghg8Z1Iab3E8xkyat+aW6N6XSYbQAiM hxY5krs16FnsSa+jl+x92Vzr/0bEXTIBOic2bHPSm1CgNcrjAEh7GviHJn/wOBkuY2P1 XejJaWlxj8ExdFmhKN7S2sOHQkP0/rpmYwfsF0MrG2eaeAyEcT/fOQ2S9fNh4jVj4UXa BNMFsmRUA/BahdvwT9KZZTcobbTQk8QpGvaOqyWzqtTTtkQXJZ+F364Bklf7UUuHpAut JsBQgilr2JW3BmYg3K6RhFk7SQTX5XyolcHzSTjd3Z4Jpg0jGoRB8HbcQGDXjAq8tb+V 4wIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to; bh=fvXdrcDgI9xxqXfXKSX19ixlHRXimdDbxGTsDP0ExBM=; b=qDjRhRT2II2kuS59h+xVPopRo9/1HGbEMsCgy8OUgD5S/m3i5krAx8wFHfvdfgNXiK 8S2R/fpqGytKMt4+IHtQyrbOxxVRapzSFvBXix7MpQM6O0YzO/V9iC3t4lyDCStkj0xK jlfPWZUz9gPTLI1uc1H2K+1A5EiB7cUi8QBTqn0b304ogqOjCNfcbcpYlsXWcrq+pQxX ElVlGk7uAOv/otdqLSguoqQajBGcn73JITNPJR9k8tixjfIVc4vkYRnv0BWkrMeYw4CI V7xLb+B0ddl911oaofCBavQCzn75X+bQrBNv/v0OFzr0GEqDwnsKkiOgf6b5KaMOYwPL n0tw== X-Gm-Message-State: AFeK/H1LvSLTLBUHK0nQbnb+daB5iL8qIbRcQrxkESQLobZs1EGXZyVhy9pfu/+tVxZ0Qw== X-Received: by 10.237.33.46 with SMTP id 43mr798572qtc.72.1490930164877; Thu, 30 Mar 2017 20:16:04 -0700 (PDT) Received: from [192.168.1.198] (static-98-118-34-152.bstnma.fios.verizon.net. [98.118.34.152]) by smtp.gmail.com with ESMTPSA id j100sm2727983qkh.38.2017.03.30.20.16.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Mar 2017 20:16:04 -0700 (PDT) References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <87efxy59wx.fsf@users.sourceforge.net> <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> <29d4a5ae-0ca0-3a86-6b9a-ab616803f39e@gmail.com> <4741bddf-9765-0d94-d0cd-b94e3e4914e1@yandex.ru> <8530cd03-0158-f198-9b14-ade983e1c7f4@gmail.com> <022c0e0a-e039-24ef-66ff-82bcedbacd93@yandex.ru> From: Jonathan Ganc Message-ID: <7fccafd3-e2c2-204a-05a0-a930a4cbb7e4@gmail.com> Date: Thu, 30 Mar 2017 23:16:02 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------22756C2F6450B47F54C776CB" X-Spam-Score: 0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) This is a multi-part message in MIME format. --------------22756C2F6450B47F54C776CB Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit I have attached my proposed patch to use 'git status' for finding the git status of files. I have also attached git-test.sh, which generates a subdirectory git-test with files in all the relevant git states I could think of (if you use it, look at the mods, repo2, repo3 directories for interesting files). I then verified that 1) my function gives the same result as vc-git-dir-status-files where vc-git-dir-status-files shows the file, with one exception: if a file has a merge conflict (i.e. the status is "UU"), my function returns conflict; 2) it is the same speed as the current vc-git-state. I may try eventually try rewriting vc-git-dir-status-files using this since it appears to be about an order of magnitude faster than the current implementation. On 03/22/2017 10:18 PM, Jonathan Ganc wrote: > Hi, > > Thanks for both responses. > > >>> 3. It would be nice to be able to show mutiple directory trees at >>> once in Neotree, though this is not as important. >> >> If it's unable to show the non-current projects, how is the bug >> triggered? default-directory would have to be outside of the project. > > I'm not actually sure why it is causing me problems. I just tried > using Neotree and encountered this problem. I didn't try anything > special besides opening the window. I'm not sure how/why Neotree sets > default-directory. I need to look into this. > > >> The problem might have gone unnoticed until now because file's status >> is cached, and because it can only be apparent if several projects >> are opened at the same time. >> >> While the problem is fairly obvious, a proper fix would most likely >> touch other backends and commands, to the point that the >> default-directory binding might have to be done inside vc-call-backend. > > Yeah, I'm not really sure what the workflow should be; I'm just > getting started with the vc functions in emacs. One issue, though, is > that default-directory can only be set for functions that identify a > filename, because we need to have a directory to set things to. For > this reason, I don't know that one could generally set > default-directory in vc-call-backend. It could make sense to set > default-directory for vc-git--run-command-string (although to get > vc-git-state to work, one would still need to set it for > vc-git--empty-db-p). > > It's worth nothing there seems to be inconsistency within vc-git. Some > commands like vc-git-checkin, vc-git-next-revision, do set > default-directory to the directory of the input file; other comands > like vc-git-merge-branch seem to do the opposite and assume the root > is already given by default-directory. > > At the very least, the documentation for vc-git-state should note that > default-directory needs to be set. > >> >> There is a very simple workaround on the caller's side, though: bind >> default-directory inside the Neotree code, to the respective project >> root (or just the file's parent directory). That will be necessary >> anyway for it to work in the released Emacs versions. >> > > That may be the best answer. I am not so familiar with the Neotree > code but it should be doable. > >>> 2. I would like to be able to color directories as well as files. I >>> don't know if that is something that would have a component in >>> vc-git.el / vc-....el or would go entirely in some package (e.g. >>> Neotree) >> >> This differs from one version control system to another, but Git >> doesn't actually track directories. So the notion of "directory >> status" is poorly defined. But see the previously mentioned >> diff-hl-dired-mode. >> > > You're right, in principle, but atom handles it by coloring > directories based on if they have modified files within. I don't know > if there is a "canonical" way to do this, although one idea would be > to return a list of all file status in the directory, e.g. > `(up-to-date modified ignored)`. > > I started looking through diff-hl. It looks like it has a bunch of > neat and useful features, though I admit I was a bit confused by the > workflow. > --------------22756C2F6450B47F54C776CB Content-Type: application/x-shellscript; name="git-test.sh" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="git-test.sh" IyEvYmluL2Jhc2gKCnNldCAtdQoKIyMgIHNjcmlwdCBmb3IgbWFraW5nIGEgZ2l0IGRpciB3 aXRoIGFsbCBraW5kcyBvZiBmaWxlcwoKIyMgIHdlIG1ha2UgdHdvIGRpcmVjdG9yeSBzdHJ1 Y3R1cmVzCiMjCiMjICBhIHJlcG8gdGhhdCBoYXMgbW9kaWZpZWQgZmlsZXM6ICBtb2RzLwoj IwojIyAgICBiYXJlLyAgIGNvbW1vbiBiYXJlIHJlcG8KIyMgICAgcmVwbzEvICBiYXNlIHJl cG8gZm9yIGVkaXRpbmcKIyMgICAgcmVwbzIvICBhIHJlcG8gd2hlcmUgd2UgbWFrZSBjaGFu Z2VzIGFuZCBjb21taXQgdGhlbQojIyAgICByZXBvMy8gIGEgcmVwbyB3aGVyZSB3ZSBtYWtl IGNoYW5nZXMgdGhhdCBhcmUgYWxzbyBpbgojIyAgICAgICAgICAgICAgICAgICAgICB0aGUg d29ya2luZyB0cmVlIGFuZC9vciBpbmRleAojIwojIyAgaW4gb3RoZXIgd29yZHMsIGxvb2sg Zm9yIGludGVyZXN0aW5nIHN0YXR1c2VzIGluIG1vZHMvIGFuZAojIyAgcmVwbzIvLCByZXBv My8KCmVycm9yICgpIHsKICAgIDE+JjIgZWNobyAiZXJyb3I6ICQqIgogICAgZXhpdCAxCn0K CmVycm9yX2NuICgpIHsKICAgIGVycm9yICJjb3VsZCBub3QgJCoiCn0KCmVycm9yX2NubSAo KSB7CiAgICBlcnJvciAiY291bGQgbm90OiBtb2RzICQqIgp9CgplcnJvcl9jbmMgKCkgewog ICAgZXJyb3IgImNvdWxkIG5vdDogY29uZmxpY3RzICQqIgp9CgplcnJvcl9jbmwgKCkgewog ICAgZXJyb3IgImNvdWxkIG5vdDogbG9ncyAkKiIKfQoKcmFuZG9tX3N0cmluZyAoKSB7CiAg ICAjIHNoZWxsY2hlY2sgZGlzYWJsZT0yMDAyCiAgICBjYXQgL2Rldi91cmFuZG9tIHwgdHIg LWRjICdhLXpBLVowLTknIHwgaGVhZCAtYzMyCn0KCmluaXRkaXI9IiQocmVhbHBhdGggIiQo ZGlybmFtZSAiJHtCQVNIX1NPVVJDRVswXX0iKSIpIgpkaXI9IiRpbml0ZGlyL2dpdC10ZXN0 IgojIyBzZXQgdXAgZGlyZWN0b3JpZXMKcm0gLXJmICIkZGlyIiAmJiBta2RpciAiJGRpciIg JiYgY2QgIiRkaXIiIHx8IGVycm9yX2NuICJtYWtlICRkaXIiCgoKIyMjIyMjIyMjIyMjIyMj IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjCiMjIyMgIGRvIG1vZHMKCm1vZHNfZGVsZXRlZF9hcnI9KCkKbWtkaXIgbW9kcyAm JiBjZCBtb2RzICYmIGdpdCBpbml0IHx8IGVycm9yX2NubSAiZ2l0IGluaXQiCmVjaG8gInVu bW9kaWZpZWQgJChyYW5kb21fc3RyaW5nKSIgPiB1bm1vZGlmaWVkCmVjaG8gImlnbm9yZWQg JChyYW5kb21fc3RyaW5nKSIgPiBpZ25vcmVkCmVjaG8gImlnbm9yZWQgJChyYW5kb21fc3Ry aW5nKSIgPiBpZ25vcmVkLU5jb21taXQsaW5kZXhfSXRyZWUKZWNobyAiaWdub3JlZCAkKHJh bmRvbV9zdHJpbmcpIiA+IGlnbm9yZWQtSWNvbW1pdCxpbmRleF9OdHJlZQplY2hvICJpZ25v cmVkX21vZCAkKHJhbmRvbV9zdHJpbmcpIiA+IGlnbm9yZWRfbW9kLTFOY29tbWl0LGluZGV4 XzJJdHJlZQoKZWNobyAkJ2lnbm9yZWRcbmlnbm9yZWQtSWNvbW1pdCxpbmRleF9OdHJlZVxu JyA+IC5naXRpZ25vcmUKZWNobyAiQSAkKHJhbmRvbV9zdHJpbmcpIiA+IG1vZGlmeS1BY29t bWl0X0JpbmRleF9DdHJlZQplY2hvICJBICQocmFuZG9tX3N0cmluZykiID4gbW9kaWZ5LUFj b21taXQsaW5kZXhfQnRyZWUKZWNobyAiQSAkKHJhbmRvbV9zdHJpbmcpIiA+IG1vZGlmeS1B Y29tbWl0X0JpbmRleCx0cmVlCnN0cmluZ19tb2RpZnlfQWNvbW1pdF9CaW5kZXhfQXRyZWU9 IkEgJChyYW5kb21fc3RyaW5nKSIKZWNobyAiJHN0cmluZ19tb2RpZnlfQWNvbW1pdF9CaW5k ZXhfQXRyZWUiID4gbW9kaWZ5LUFjb21taXRfQmluZGV4X0F0cmVlCmVjaG8gIkEgJChyYW5k b21fc3RyaW5nKSIgPiBtb2RpZnktQWNvbW1pdCxpbmRleF9YdHJlZQplY2hvICJBICQocmFu ZG9tX3N0cmluZykiID4gbW9kaWZ5LUFjb21taXRfWGluZGV4LHRyZWUKZWNobyAiQSAkKHJh bmRvbV9zdHJpbmcpIiA+IG1vZGlmeS1BY29tbWl0X1hpbmRleF9BdHJlZQplY2hvICJyZW5h bWUgJChyYW5kb21fc3RyaW5nKSIgPiByZW5hbWUtQWNvbW1pdCxpbmRleF9CdHJlZS1jb21t aXQKZWNobyAicmVuYW1lICQocmFuZG9tX3N0cmluZykiID4gcmVuYW1lLUFjb21taXRfQmlu ZGV4LHRyZWUtQQplY2hvICJyZW5hbWUgJChyYW5kb21fc3RyaW5nKSIgPiByZW5hbWUtQWNv bW1pdF9CaW5kZXhfQXRyZWUtQQplY2hvICJyZW5hbWUgJChyYW5kb21fc3RyaW5nKSIgPiBy ZW5hbWUtQWNvbW1pdF9CaW5kZXhfQ3RyZWUtQQplY2hvICJyZW5hbWUgJChyYW5kb21fc3Ry aW5nKSIgPiByZW5hbWUtQWNvbW1pdF9YaW5kZXhfQnRyZWUtQQpnaXQgYWRkIC4gJiYgZ2l0 IGNvbW1pdCAtYSAtbSAiSW5pdCIgfHwgZXJyb3JfY25tICJnaXQgYWRkIGFuZCBjb21taXQi CgojIyAgaGF2ZSBzb21lIHRoaW5ncyBiZSBkaWZmZXJlbnQgaW4gaW5kZXgKZWNobyAiQSAk KHJhbmRvbV9zdHJpbmcpIiA+IG1vZGlmeS1YY29tbWl0X0FpbmRleF9YdHJlZQplY2hvICJB ICQocmFuZG9tX3N0cmluZykiID4gbW9kaWZ5LVhjb21taXRfQWluZGV4LHRyZWUKZWNobyAi QSAkKHJhbmRvbV9zdHJpbmcpIiA+IG1vZGlmeS1YY29tbWl0X0FpbmRleF9CdHJlZQplY2hv ICJCICQocmFuZG9tX3N0cmluZykiID4+IG1vZGlmeS1BY29tbWl0X0JpbmRleF9DdHJlZQpl Y2hvICJCICQocmFuZG9tX3N0cmluZykiID4gbW9kaWZ5LUFjb21taXRfQmluZGV4LHRyZWUK ZWNobyAiQiAkKHJhbmRvbV9zdHJpbmcpIiA+IG1vZGlmeS1BY29tbWl0X0JpbmRleF9BdHJl ZQptdiByZW5hbWUtQWNvbW1pdF9CaW5kZXhfQ3RyZWUtQSByZW5hbWUtQWNvbW1pdF9CaW5k ZXhfQ3RyZWUtQiBcCiAgICB8fCBlcnJvcl9jbm0gIm12IHJlbmFtZS10d2ljZS1pbml0IHJl bmFtZS10d2ljZS1pbmRleCIKbXYgcmVuYW1lLUFjb21taXRfQmluZGV4LHRyZWUtQSByZW5h bWUtQWNvbW1pdF9CaW5kZXgsdHJlZS1CIFwKICAgIHx8IGVycm9yX2NubSAicmVuYW1lIgpt diByZW5hbWUtQWNvbW1pdF9CaW5kZXhfQXRyZWUtQSByZW5hbWUtQWNvbW1pdF9CaW5kZXhf QXRyZWUtQiBcCiAgICB8fCBlcnJvcl9jbm0gInJlbmFtZSIKZ2l0IGFkZCAuIHx8IGVycm9y X2NubSAiZ2l0IGFkZCAuIgpnaXQgcm0gbW9kaWZ5LUFjb21taXRfWGluZGV4LHRyZWUKZ2l0 IHJtIC0tY2FjaGVkIG1vZGlmeS1BY29tbWl0X1hpbmRleF9BdHJlZQoKZ2l0IHJtIC0tY2Fj aGVkIHJlbmFtZS1BY29tbWl0X1hpbmRleF9CdHJlZS1BCm12IHJlbmFtZS1BY29tbWl0X1hp bmRleF9CdHJlZS1BIHJlbmFtZS1BY29tbWl0X1hpbmRleF9CdHJlZS1CCgptb2RzX2RlbGV0 ZWRfYXJyKz0ocmVuYW1lLUFjb21taXRfQmluZGV4X0N0cmVlLUEgXAogICAgICAgICAgICAg ICAgICAgICAgIHJlbmFtZS1BY29tbWl0X0JpbmRleCx0cmVlLUEgXAogICAgICAgICAgICAg ICAgICAgICAgIG1vZGlmeS1BY29tbWl0X1hpbmRleCx0cmVlIFwKICAgICAgICAgICAgICAg ICAgICAgICByZW5hbWUtQWNvbW1pdF9YaW5kZXhfQnRyZWUtQSkKCiMjICBtb2RpZnkgdGhp bmdzIGluIHdvcmtpbmcgdHJlZQplY2hvICQnaWdub3JlZFxuaWdub3JlZC1OY29tbWl0LGlu ZGV4X0l0cmVlXG5pZ25vcmVkX21vZC0xTmNvbW1pdCxpbmRleF8ySXRyZWVcbicgPiAuZ2l0 aWdub3JlCnJtIG1vZGlmeS1BY29tbWl0LGluZGV4X1h0cmVlIHx8IGVycm9yX2NubSAicmVt b3ZlIHJlbW92ZSIKbXYgcmVuYW1lLUFjb21taXQsaW5kZXhfQnRyZWUtY29tbWl0IHJlbmFt ZS1BY29tbWl0LGluZGV4X0J0cmVlLXRyZWUgXAogICAgfHwgZXJyb3JfY25tICJyZW5hbWUi CmVjaG8gIkEgJChyYW5kb21fc3RyaW5nKSIgPiBtb2RpZnktWGNvbW1pdCxpbmRleF9BdHJl ZQplY2hvICJCICQocmFuZG9tX3N0cmluZykiID4+IG1vZGlmeS1BY29tbWl0LGluZGV4X0J0 cmVlCmVjaG8gIiRzdHJpbmdfbW9kaWZ5X0Fjb21taXRfQmluZGV4X0F0cmVlIiA+IG1vZGlm eS1BY29tbWl0X0JpbmRleF9BdHJlZQpybSBtb2RpZnktWGNvbW1pdF9BaW5kZXhfWHRyZWUg fHwgZXJyb3JfY25tICJybSBtb2RpZnktWGNvbW1pdF9BaW5kZXhfWHRyZWUiCmVjaG8gIkMg JChyYW5kb21fc3RyaW5nKSIgPj4gbW9kaWZ5LUFjb21taXRfQmluZGV4X0N0cmVlCm12IHJl bmFtZS1BY29tbWl0X0JpbmRleF9DdHJlZS1CIHJlbmFtZV9BY29tbWl0X0JpbmRleF9DdHJl ZS1DIFwKICAgIHx8IGVycm9yICJtb2RzOiBtdiByZW5hbWUtdHdpY2UtaW5kZXggcmVuYW1l LXR3aWNlLXRyZWUiCm12IHJlbmFtZS1BY29tbWl0X0JpbmRleF9BdHJlZS1CIHJlbmFtZS1B Y29tbWl0X0JpbmRleF9BdHJlZS1BIFwKICAgIHx8IGVycm9yX2NubSAicmVuYW1lIgplY2hv ICJpZ25vcmVkX21vZCAkKHJhbmRvbV9zdHJpbmcpIiA+IGlnbm9yZWRfbW9kLTFOY29tbWl0 LGluZGV4XzJJdHJlZQoKbW9kc19kZWxldGVkX2Fycis9KG1vZGlmeS1BY29tbWl0LGluZGV4 X1h0cmVlIFwKICAgICAgICAgICAgICAgICAgICAgICByZW5hbWUtQWNvbW1pdF9CaW5kZXhf Q3RyZWUtQiBcCiAgICAgICAgICAgICAgICAgICAgICAgcmVuYW1lLUFjb21taXRfQmluZGV4 X0F0cmVlLUIpCmNkIC4uCgojIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMKIyMjICAgZG8gY29uZmxp Y3RzCgojIyBzZXQgdXAgYmFyZQpta2RpciBiYXJlICYmIGNkIGJhcmUgJiYgZ2l0IGluaXQg LS1iYXJlICYmIGNkIC4uIFwKICAgICAgICB8fCBlcnJvcl9jbmMgImdpdCBpbml0IC0tYmFy ZSIKIyMgc2V0IHVwIHJlcG8gMQpnaXQgY2xvbmUgYmFyZSByZXBvMSAmJiBjZCByZXBvMSB8 fCBlcnJvcl9jbmMgInNldHVwIHJlcG8xIgplY2hvICJpbml0ICQocmFuZG9tX3N0cmluZyki ID4gY29uZmxpY3QtY29tbWl0CmVjaG8gImluaXQgJChyYW5kb21fc3RyaW5nKSIgPiBjb25m bGljdC1CY29tbWl0X0NpbmRleCx0cmVlCmVjaG8gImluaXQgJChyYW5kb21fc3RyaW5nKSIg PiBjb25mbGljdC1CY29tbWl0X0NpbmRleF9EdHJlZQplY2hvICJpbml0ICQocmFuZG9tX3N0 cmluZykiID4gY29uZmxpY3QtaW5kZXgsdHJlZQplY2hvICJpbml0ICQocmFuZG9tX3N0cmlu ZykiID4gY29uZmxpY3QtQmluZGV4X0N0cmVlCmdpdCBhZGQgLiAmJiBnaXQgY29tbWl0IC1h IC1tICJJbml0IiB8fCBlcnJvcl9jbmMgImdpdCBhZGQgYW5kIGNvbW1pdCIKZ2l0IHB1c2gg fHwgZXJyb3JfY25jICJnaXQgcHVzaCIKY2QgLi4gfHwgZXJyb3JfY25jICJjZCAuLiIKCiMj ICBmaXJzdCBpc3N1ZXMgd2l0aCByZXBvMgoKIyMgY2xvbmUgZnJvbSByZXBvIDEgdG8gcmVw b3MgMiBhdCB0aGlzIHBvaW50LiBtYWtlIHVubWVyZ2FibGUgY2hhbmdlCmdpdCBjbG9uZSBi YXJlIHJlcG8yIHx8IGVycm9yX2NuYyAibWFrZSByZXBvcyAyIgojIyBnbyBiYWNrIGFuZCBj aGFuZ2Ugc29tZSBtb3JlIHRoaW5ncyBpbiByZXBvMQpjZCByZXBvMSB8fCBlcnJvcl9jbmMg ImNkIHJlcG8xIgplY2hvICJBICQocmFuZG9tX3N0cmluZykiID4gY29uZmxpY3QtY29tbWl0 CmdpdCBhZGQgLiAmJiBnaXQgY29tbWl0IC1hIC1tICJGb3IgcmVwbzIiICYmIGdpdCBwdXNo IFwKICAgICAgICB8fCBlcnJvcl9jbmMgImdpdCBhZGQgYW5kIGNvbW1pdCByZXBvMSBmb3Ig cmVwbzIgYW5kIHB1c2giCmNkIC4uIHx8IGVycm9yX2NuYyAiY2QgLi4gdG8gMiIKCiMjIGRl YWwgd2l0aCByZXBvIDIgbm93LiBqdXN0IGNoYW5nZSBjb25mbGljdC1jb21taXQKY2QgcmVw bzIgfHwgZXJyb3JfY25jICJzd2l0Y2ggdG8gcmVwbzIiCmVjaG8gIkIgJChyYW5kb21fc3Ry aW5nKSIgPiBjb25mbGljdC1jb21taXQKZ2l0IGFkZCAuICYmIGdpdCBjb21taXQgLWEgLW0g IkZvciBtb2RpZnkgcmVtb3RlIiBcCiAgICAgICAgfHwgZXJyb3JfY25jICJnaXQgYWRkIGFu ZCBjb21taXQgcmVwbzIiCmdpdCBwdWxsCmdpdCBtZXJnZQpjZCAuLiB8fCBlcnJvcl9jbmMg ImNkIC4uIHRvIDMiCgojIyBjbG9uZSBmcm9tIHJlcG8xIHRvIHJlcG8gMyBhdCB0aGlzIHBv aW50LiBtYWtlIHVubWVyZ2FibGUgY2hhbmdlCmdpdCBjbG9uZSBiYXJlIHJlcG8zIHx8IGVy cm9yX2NuYyAibWFrZSByZXBvcyAzIgojIyBnbyBiYWNrIGFuZCBjaGFuZ2Ugc29tZSBtb3Jl IHRoaW5ncyBpbiByZXBvMQpjZCByZXBvMSB8fCBlcnJvcl9jbmMgImNkIHJlcG8xIgplY2hv ICJBICQocmFuZG9tX3N0cmluZykiID4gY29uZmxpY3QtQmNvbW1pdF9DaW5kZXgsdHJlZQpl Y2hvICJBICQocmFuZG9tX3N0cmluZykiID4gY29uZmxpY3QtQmNvbW1pdF9DaW5kZXhfRHRy ZWUKc3RyaW5nX2NvbmZsaWN0X0Jjb21taXRfQ2luZGV4X0F0cmVlPSJBICQocmFuZG9tX3N0 cmluZykiCmVjaG8gIiRzdHJpbmdfY29uZmxpY3RfQmNvbW1pdF9DaW5kZXhfQXRyZWUiID4g Y29uZmxpY3QtQmNvbW1pdF9DaW5kZXhfQXRyZWUKZ2l0IGFkZCAuICYmIGdpdCBjb21taXQg LWEgLW0gIkZvciByZXBvMyIgJiYgZ2l0IHB1c2ggXAogICAgICAgIHx8IGVycm9yX2NuYyAi Z2l0IGFkZCBhbmQgY29tbWl0IHJlcG8xIGZvciByZXBvMyBhbmQgcHVzaCIKY2QgLi4gfHwg ZXJyb3JfY25jICJjZCAuLiB0byA0IgoKIyMgZGVhbCB3aXRoIHJlcG8gMyBub3cuCmNkIHJl cG8zIHx8IGVycm9yX2NuYyAic3dpdGNoIHRvIHJlcG8zIgplY2hvICJCICQocmFuZG9tX3N0 cmluZykiID4gY29uZmxpY3QtQmNvbW1pdF9DaW5kZXgsdHJlZQplY2hvICJCICQocmFuZG9t X3N0cmluZykiID4gY29uZmxpY3QtQmNvbW1pdF9DaW5kZXhfRHRyZWUKZWNobyAiQiAkKHJh bmRvbV9zdHJpbmcpIiA+IGNvbmZsaWN0LUJjb21taXRfQ2luZGV4X0F0cmVlCmdpdCBhZGQg LiAmJiBnaXQgY29tbWl0IC1hIC1tICJGb3IgbW9kaWZ5IHJlbW90ZSIgXAogICAgICAgIHx8 IGVycm9yX2NuYyAiZ2l0IGFkZCBhbmQgY29tbWl0IHJlcG8zIgoKIyMgIGhhdmUgc29tZSB0 aGluZ3MgYmUgZGlmZmVyZW50IGluIGluZGV4CmVjaG8gIkMgJChyYW5kb21fc3RyaW5nKSIg PiBjb25mbGljdC1CY29tbWl0X0NpbmRleCx0cmVlCmVjaG8gIkMgJChyYW5kb21fc3RyaW5n KSIgPiBjb25mbGljdC1CY29tbWl0X0NpbmRleF9EdHJlZQplY2hvICJCICQocmFuZG9tX3N0 cmluZykiID4gY29uZmxpY3QtaW5kZXgsdHJlZQplY2hvICJCICQocmFuZG9tX3N0cmluZyki ID4gY29uZmxpY3QtQmluZGV4X0N0cmVlCmVjaG8gIkMgJChyYW5kb21fc3RyaW5nKSIgPiBj b25mbGljdC1CY29tbWl0X0NpbmRleF9BdHJlZQpnaXQgYWRkIC4gfHwgZXJyb3JfY25jICJn aXQgYWRkIC4iCgojIyAgaGF2ZSBzb21lIHRoaW5ncyBiZSBkaWZmZXJlbnQgaW4gdHJlZQpl Y2hvICJEICQocmFuZG9tX3N0cmluZykiID4gY29uZmxpY3QtQmNvbW1pdF9DaW5kZXhfRHRy ZWUKZWNobyAiQyAkKHJhbmRvbV9zdHJpbmcpIiA+IGNvbmZsaWN0LUJpbmRleF9DdHJlZQpl Y2hvICIkc3RyaW5nX2NvbmZsaWN0X0Jjb21taXRfQ2luZGV4X0F0cmVlIiA+IGNvbmZsaWN0 LUJjb21taXRfQ2luZGV4X0F0cmVlCmdpdCBwdWxsCmdpdCBtZXJnZQoKbG9nZGlyPSIke2lu aXRkaXI6P2luaXRpZGlyIG5vdCBzZXR9L2xvZ3MiCnJtIC1yZiAiJGxvZ2RpciIgJiYgbWtk aXIgIiRsb2dkaXIiIHx8IGVycm9yX2NubCAicmVtYWtlICRsb2dkaXIiCgpwcmludF9naXRf c3RhdHVzICgpIHsKICAgIGxvY2FsIHJlcG8gbG9nX3ByZWYgZGVsZXRlZF9hcnIKICAgIHJl cG89IiQxIgogICAgY2QgIiRkaXIvJHJlcG8iIHx8IGVycm9yX2NubCAiY2hhbmdlIGRpciAk ZGlyLyRyZXBvIgogICAgbG9nX3ByZWY9IiRsb2dkaXIvJHJlcG8iCiAgICBzZXQgLS0gZ2l0 IHN0YXR1cyAtLXBvcmNlbGFpbiAtLXVudHJhY2tlZC1maWxlcyAtLWlnbm9yZWQKICAgICMg c2hlbGxjaGVjayBkaXNhYmxlPTIwNjgsMjE1NgogICAgewogICAgICAgICRAIHwgIiRpbml0 ZGlyL2dpdC1zdGF0dXMtc29ydC5zaCIgID4gIiRsb2dfcHJlZi1wbGFpbi5sb2ciIFwKICAg ICAgICAgICAgfHwgZXJyb3JfY25sICJtYWtlIGxvZyAkbG9nX3ByZWYtcGxhaW4ubG9nIgog ICAgICAgIGZpbmQgLiAtbWF4ZGVwdGggMSAtbWluZGVwdGggMSAtdHlwZSBmIC1leGVjICRA ICd7fScgXDsgXAogICAgICAgICAgICB8ICIkaW5pdGRpci9naXQtc3RhdHVzLXNvcnQuc2gi ID4gIiRsb2dfcHJlZi1maW5kLmxvZyIgXAogICAgICAgICAgICB8fCBlcnJvcl9jbmwgIm1h a2UgbG9nICRsb2dfcHJlZi1maW5kLmxvZyIKICAgICAgICBmaW5kIC4gLW1heGRlcHRoIDEg LW1pbmRlcHRoIDEgLXR5cGUgZiAtZXhlYyBcCiAgICAgICAgICAgICBiYXNoIC1jICJlY2hv ICd7fTonICYmICQqIHt9ICYmIGVjaG8iIFw7IFwKICAgICAgICAgICAgID4gIiRsb2dfcHJl Zi1maW5kLXdpdGhuYW1lLmxvZyIgXAogICAgICAgICAgICB8fCBlcnJvcl9jbmwgIm1ha2Ug bG9nICRsb2dfcHJlZi1maW5kLXdpdGhuYW1lLmxvZyIKICAgICAgICAjIyAgYWRkIGRlbGV0 ZWQgZmlsZXMgaWYgcHJlc2VudAogICAgICAgIGlmIFtbIC12ICIke3JlcG99X2RlbGV0ZWRf YXJyIiBdXTsgdGhlbgogICAgICAgICAgICBkZWNsYXJlIC1uIGRlbGV0ZWRfYXJyPSIke3Jl cG99X2RlbGV0ZWRfYXJyIgogICAgICAgICAgICBmb3IgZmlsZSBpbiAiJHtkZWxldGVkX2Fy cltAXX0iOyBkbwogICAgICAgICAgICAgICAgZWNobyAiJGZpbGU6IiA+PiAiJGxvZ19wcmVm LWRlbGV0ZWQtd2l0aGZpbGVuYW1lLmxvZyIKICAgICAgICAgICAgICAgICRAICIkZmlsZSIg fCB0ZWUgLWEgIiRsb2dfcHJlZi1kZWxldGVkLXdpdGhmaWxlbmFtZS5sb2ciIFwKICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPj4gIiRsb2dfcHJlZi1kZWxldGVkLmxvZ34i CiAgICAgICAgICAgIGRvbmUKICAgICAgICAgICAgIiRpbml0ZGlyL2dpdC1zdGF0dXMtc29y dC5zaCIgPCAiJGxvZ19wcmVmLWRlbGV0ZWQubG9nfiIgXAogICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA+ICIkbG9nX3ByZWYtZGVsZXRlZC5sb2ciCiAgICAg ICAgZmkKICAgIH0KfQoKcHJpbnRfZ2l0X3N0YXR1cyAibW9kcyIKcHJpbnRfZ2l0X3N0YXR1 cyAicmVwbzIiCnByaW50X2dpdF9zdGF0dXMgInJlcG8zIgoKZWNobyAiU3VjY2VzcyIK --------------22756C2F6450B47F54C776CB Content-Type: text/x-patch; name="0001-Use-git-status-in-vc-git-status.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Use-git-status-in-vc-git-status.patch" >From ba77e001b719ff289cf0b1d3dcffd647af6d175d Mon Sep 17 00:00:00 2001 From: Jonathan Ganc Date: Thu, 30 Mar 2017 23:13:15 -0400 Subject: [PATCH] Use 'git status' in vc-git-status --- lisp/vc/vc-git.el | 79 +++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 53 insertions(+), 26 deletions(-) diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 1a3f1bf..ce662fb 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -231,34 +231,61 @@ (defun vc-git--state-code (code) (?U 'edited) ;; FIXME (?T 'edited))) ;; FIXME +(defun vc-git--git-status-to-vc-state (code-list) + "Convert a list CODE-LIST of two-letter git status strings to a vc status. + +Each element of CODE-LIST comes from the first two characters of +a line returned by 'git status' and should be passed in the order given by 'git status'. Elements that are nil are simply ignored. + +Note that this function may destroy and/or alter `code-list'. + +\(It is necessary to allow CODE-LIST to be a list because +sometimes git status returns multiple lines, e.g. for a file that +is removed from the index but is present in the HEAD and working +tree.) " + (setq code-list (remq nil code-list)) + (pcase code-list + ('nil 'up-to-date) + (`(,code) + (pcase code + ("!!" 'ignored) + ("??" 'unregistered) + ;; have only seen this with a file that is only present in the + ;; index. let us call this `removed' + ("AD" 'removed) + (_ (cond + ((string-match-p "^[ RD]+$" code) 'removed) + ((string-match-p "^[ M]+$" code) 'edited) + ((string-match-p "^[ A]+$" code) 'added) + ((string-match-p "^[ U]+$" code) 'conflict) + (t 'edited))))) + ;; I know of two times when git state returns more than one element, + ;; in both cases returning '("D " "??")': + ;; 1. when a file is removed from the index but present in the + ;; HEAD and working tree, the CODE-LIST will be + ;; 2. when a file A is renamed to B in the index and then back to A + ;; in the working tree, the CODE-LIST will be '("??" "RD") + ;; In both these instances, `unregistered' is a reasonable response. + (`("D " "??") 'unregistered) + ;; In other cases, let us return `edited' + (_ 'edited))) + (defun vc-git-state (file) "Git-specific version of `vc-state'." - ;; FIXME: This can't set 'ignored or 'conflict yet - ;; The 'ignored state could be detected with `git ls-files -i -o - ;; --exclude-standard` It also can't set 'needs-update or - ;; 'needs-merge. The rough equivalent would be that upstream branch - ;; for current branch is in fast-forward state i.e. current branch - ;; is direct ancestor of corresponding upstream branch, and the file - ;; was modified upstream. But we can't check that without a network - ;; operation. - ;; This assumes that status is known to be not `unregistered' because - ;; we've been successfully dispatched here from `vc-state', that - ;; means `vc-git-registered' returned t earlier once. Bug#11757 - (let ((diff (vc-git--run-command-string - file "diff-index" "-p" "--raw" "-z" "HEAD" "--"))) - (if (and diff - (string-match ":[0-7]\\{6\\} [0-7]\\{6\\} [0-9a-f]\\{40\\} [0-9a-f]\\{40\\} \\([ADMUT]\\)\0[^\0]+\0\\(.*\n.\\)?" - diff)) - (let ((diff-letter (match-string 1 diff))) - (if (not (match-beginning 2)) - ;; Empty diff: file contents is the same as the HEAD - ;; revision, but timestamps are different (eg, file - ;; was "touch"ed). Update timestamp in index: - (prog1 'up-to-date - (vc-git--call nil "add" "--refresh" "--" - (file-relative-name file))) - (vc-git--state-code diff-letter))) - (if (vc-git--empty-db-p) 'added 'up-to-date)))) + + (save-match-data + (let* ((default-directory (file-name-directory (expand-file-name file))) + (status + (vc-git--run-command-string file "status" "--porcelain" "-z" + "--untracked-files" "--ignored" "--")) + code-list) + ;; if this code is adapted to parse git-status for a directory, note + ;; that a renamed file takes up two null values and needs to be + ;; treated slightly more carefully + (while (string-match "^\\(..\\)[^\0]+\0\\(\\(?:a\\|[^a]\\)*\\)$" status) + (add-to-list 'code-list (match-string 1 status) t 'ignore) + (setq status (match-string 2 status))) + (vc-git--git-status-to-vc-state code-list)))) (defun vc-git-working-revision (_file) "Git-specific version of `vc-working-revision'." -- 2.9.3 --------------22756C2F6450B47F54C776CB-- From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Resent-From: Jonathan Ganc Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 Apr 2017 02:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dmitry Gutov , npostavs@users.sourceforge.net, 26066@debbugs.gnu.org Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.149179059426160 (code B ref 26066); Mon, 10 Apr 2017 02:17:02 +0000 Received: (at 26066) by debbugs.gnu.org; 10 Apr 2017 02:16:34 +0000 Received: from localhost ([127.0.0.1]:40352 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxOsb-0006ns-QS for submit@debbugs.gnu.org; Sun, 09 Apr 2017 22:16:34 -0400 Received: from mail-qk0-f195.google.com ([209.85.220.195]:36540) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxOsa-0006ne-Jy for 26066@debbugs.gnu.org; Sun, 09 Apr 2017 22:16:32 -0400 Received: by mail-qk0-f195.google.com with SMTP id v75so17313314qkb.3 for <26066@debbugs.gnu.org>; Sun, 09 Apr 2017 19:16:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=zY7GKnVSlZIG+/JTjjgKh2YLqemWEKGSJMkcDBOkJbc=; b=hBZa0YnUTRxx6SYEFp3qSJiecCLh8hkpSZfmayExiMwakXL0n9nV/mAflaM2GrBRgS 4psmfWcnOiO0+gqRjX1n3MRbU7+LsjI98tfEwN26dWntc7liU5OzHK19zr4J4xuohuaS hD2Vwa/eg7yQbKgMQxWvV/dN9aMgCeHJxKqcrYH32VICvlqGqP8f3ddDfSrwZ+Oh5s7o LDWfxr1v5zdxHCwt7BYUsp97bNrjtqVzwjTIH4MbsBt3pI4pOB2ETEFSMQi9YL6Zo2nF rF2pxL5xI96vTvs4z7MAV+PZmrsASNZ9+OOgMq3K5Q2rj27UjIfZMmtPlVacykW1MNSW bh9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=zY7GKnVSlZIG+/JTjjgKh2YLqemWEKGSJMkcDBOkJbc=; b=HyVdEiIna7pZmO6q/I/RIxbFBfoIkq2tvCihJem4/AabsFlKviul+N/3yPiFB9h2+M LJzFkMHNWVrFRWBOboth7c7lW5LFZNc6yraJrv2fyiZbW2QOsFr9pJSndnCBYd8xeOsa p4aMrE3aknt8XnxT09hKHU/pq9B+Mec8UmRFrcSzs7gMJ9Paxp1dbPNfL2domnOaDFWF ncUSsItF2xNjnzpCbTBQrc12VSIPxFp4mf/eFmclkiW2GmOG5m3e13CWIJE/QHwR/cMY ESpQjJDB16av9m+y4OmR/6V1qhlsvqu72aU04+3IVE6vMwerxXk1m/KdmksiBQar4Z8H hnsw== X-Gm-Message-State: AFeK/H2nOoZU46LlMBXpvfzptY8laUuyt/O7Z8LibcejaeSiCRZ7RCbASKQYPi7SdbwCAg== X-Received: by 10.55.31.1 with SMTP id f1mr41404392qkf.255.1491790587028; Sun, 09 Apr 2017 19:16:27 -0700 (PDT) Received: from [192.168.1.200] (static-98-118-34-152.bstnma.fios.verizon.net. [98.118.34.152]) by smtp.gmail.com with ESMTPSA id z4sm7903233qkc.68.2017.04.09.19.16.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Apr 2017 19:16:26 -0700 (PDT) References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <87efxy59wx.fsf@users.sourceforge.net> <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> <29d4a5ae-0ca0-3a86-6b9a-ab616803f39e@gmail.com> <4741bddf-9765-0d94-d0cd-b94e3e4914e1@yandex.ru> <8530cd03-0158-f198-9b14-ade983e1c7f4@gmail.com> <022c0e0a-e039-24ef-66ff-82bcedbacd93@yandex.ru> <7fccafd3-e2c2-204a-05a0-a930a4cbb7e4@gmail.com> From: Jonathan Ganc Message-ID: <22831afe-cda8-2061-f747-8eb457943e49@gmail.com> Date: Sun, 9 Apr 2017 22:16:24 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <7fccafd3-e2c2-204a-05a0-a930a4cbb7e4@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) Hi, I am just checking if anyone has had a chance to review my proposed improvement to vc-git-status? I have been using it without problem but I would love to get feedback. Jonathan On 03/30/2017 11:16 PM, Jonathan Ganc wrote: > I have attached my proposed patch to use 'git status' for finding the > git status of files. > > I have also attached git-test.sh, which generates a subdirectory > git-test with files in all the relevant git states I could think of > (if you use it, look at the mods, repo2, repo3 directories for > interesting files). > > I then verified that 1) my function gives the same result as > vc-git-dir-status-files where vc-git-dir-status-files shows the file, > with one exception: if a file has a merge conflict (i.e. the status is > "UU"), my function returns conflict; 2) it is the same speed as the > current vc-git-state. > > I may try eventually try rewriting vc-git-dir-status-files using this > since it appears to be about an order of magnitude faster than the > current implementation. > > On 03/22/2017 10:18 PM, Jonathan Ganc wrote: >> Hi, >> >> Thanks for both responses. >> >> >>>> 3. It would be nice to be able to show mutiple directory trees at >>>> once in Neotree, though this is not as important. >>> >>> If it's unable to show the non-current projects, how is the bug >>> triggered? default-directory would have to be outside of the project. >> >> I'm not actually sure why it is causing me problems. I just tried >> using Neotree and encountered this problem. I didn't try anything >> special besides opening the window. I'm not sure how/why Neotree sets >> default-directory. I need to look into this. >> >> >>> The problem might have gone unnoticed until now because file's >>> status is cached, and because it can only be apparent if several >>> projects are opened at the same time. >>> >>> While the problem is fairly obvious, a proper fix would most likely >>> touch other backends and commands, to the point that the >>> default-directory binding might have to be done inside vc-call-backend. >> >> Yeah, I'm not really sure what the workflow should be; I'm just >> getting started with the vc functions in emacs. One issue, though, is >> that default-directory can only be set for functions that identify a >> filename, because we need to have a directory to set things to. For >> this reason, I don't know that one could generally set >> default-directory in vc-call-backend. It could make sense to set >> default-directory for vc-git--run-command-string (although to get >> vc-git-state to work, one would still need to set it for >> vc-git--empty-db-p). >> >> It's worth nothing there seems to be inconsistency within vc-git. >> Some commands like vc-git-checkin, vc-git-next-revision, do set >> default-directory to the directory of the input file; other comands >> like vc-git-merge-branch seem to do the opposite and assume the root >> is already given by default-directory. >> >> At the very least, the documentation for vc-git-state should note >> that default-directory needs to be set. >> >>> >>> There is a very simple workaround on the caller's side, though: bind >>> default-directory inside the Neotree code, to the respective project >>> root (or just the file's parent directory). That will be necessary >>> anyway for it to work in the released Emacs versions. >>> >> >> That may be the best answer. I am not so familiar with the Neotree >> code but it should be doable. >> >>>> 2. I would like to be able to color directories as well as files. I >>>> don't know if that is something that would have a component in >>>> vc-git.el / vc-....el or would go entirely in some package (e.g. >>>> Neotree) >>> >>> This differs from one version control system to another, but Git >>> doesn't actually track directories. So the notion of "directory >>> status" is poorly defined. But see the previously mentioned >>> diff-hl-dired-mode. >>> >> >> You're right, in principle, but atom handles it by coloring >> directories based on if they have modified files within. I don't know >> if there is a "canonical" way to do this, although one idea would be >> to return a list of all file status in the directory, e.g. >> `(up-to-date modified ignored)`. >> >> I started looking through diff-hl. It looks like it has a bunch of >> neat and useful features, though I admit I was a bit confused by the >> workflow. >> > From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 Apr 2017 02:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jonathan Ganc Cc: 26066@debbugs.gnu.org, Dmitry Gutov Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.149179301429862 (code B ref 26066); Mon, 10 Apr 2017 02:57:02 +0000 Received: (at 26066) by debbugs.gnu.org; 10 Apr 2017 02:56:54 +0000 Received: from localhost ([127.0.0.1]:40389 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxPVd-0007la-RS for submit@debbugs.gnu.org; Sun, 09 Apr 2017 22:56:54 -0400 Received: from mail-io0-f195.google.com ([209.85.223.195]:34968) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxPVc-0007lL-3l for 26066@debbugs.gnu.org; Sun, 09 Apr 2017 22:56:52 -0400 Received: by mail-io0-f195.google.com with SMTP id t68so1355749iof.2 for <26066@debbugs.gnu.org>; Sun, 09 Apr 2017 19:56:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=yz6uGAAcD02pR7/J1unlhmHLhE8cCpIN7XLOhnBnKYg=; b=m11TZ7XIPFj4MGEoukohghTgQpkI+UcXf4Mtf1tJgkx4uD0O3gqTN3K7U+/Wc9Wg3i Z5t+edu6/NtPL6j8GOlqTfsxXVT8v643Ony/0pL5MRx8lijSrGnZUYjCjlE+0Iat/rzr nE5AJUMQkSD03n0ycKv4HI6RdjBY5YrsnhFUFK0GvzAWN1QVTymtrKEuSLhN7782aXFq 64C1uP9IWAn2ZedsacA3kPDZb0NIu79teRoMkt5FOAqVJGVntRdm49tvLq+r80mcW8S2 CbT/m699FTzC1CXvr4wRL0/mN0FlPaT0Eq+UdAf7XDHXJEuX5TLGuT0JWPND07r0Mt86 WlKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=yz6uGAAcD02pR7/J1unlhmHLhE8cCpIN7XLOhnBnKYg=; b=k/tI/Tqr/cm7n27y9mGWFFCR7IuKYBP2XchdViyxXzRyrALH8MBR/KMfKASSnA4zIC rpoo32BzPs4ccZyMJc00KB02tuTffHy/H/Mkszjb1+dn67E4nsppzdZPT3we/F9n1tUa lsDtaGnzz5aYmFUuDoZJF1c6HjNs7XvrJqOHKJPOafwybvCNGsfEYozsUCnayj0Qoy3d J1VbTmLUeg1EIaIY9FE0B8eziO+O55GRZB9XgF/PvWj3x8Vz9JripeXPzpUDmX53YNOc T4XZozBzRuuP0y2KqUMWuyr5ZYEfNPleIx3Ts1olLfuLPLxJ5PzRGU5Gk35XopTMspeJ UCKw== X-Gm-Message-State: AN3rC/4yY8UC2ZSKJEH34z0d546F9w254FK7RkR81MzN3Y0DhYIlqC5EzFeCxSe/jsAjQA== X-Received: by 10.107.6.6 with SMTP id 6mr11066758iog.78.1491793006503; Sun, 09 Apr 2017 19:56:46 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id u63sm439624itb.16.2017.04.09.19.56.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Apr 2017 19:56:46 -0700 (PDT) From: npostavs@users.sourceforge.net References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <87efxy59wx.fsf@users.sourceforge.net> <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> <29d4a5ae-0ca0-3a86-6b9a-ab616803f39e@gmail.com> <4741bddf-9765-0d94-d0cd-b94e3e4914e1@yandex.ru> <8530cd03-0158-f198-9b14-ade983e1c7f4@gmail.com> <022c0e0a-e039-24ef-66ff-82bcedbacd93@yandex.ru> <7fccafd3-e2c2-204a-05a0-a930a4cbb7e4@gmail.com> Date: Sun, 09 Apr 2017 22:58:11 -0400 In-Reply-To: <7fccafd3-e2c2-204a-05a0-a930a4cbb7e4@gmail.com> (Jonathan Ganc's message of "Thu, 30 Mar 2017 23:16:02 -0400") Message-ID: <87inmdt1do.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.1 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) Jonathan Ganc writes: > > +(defun vc-git--git-status-to-vc-state (code-list) > + (setq code-list (remq nil code-list)) > + (pcase code-list > + ('nil 'up-to-date) You seem to be handling nil in 2 different ways. > + ;; have only seen this with a file that is only present in the > + ;; index. let us call this `removed' Comments should be full sentences (start with uppercase, end with period), and sentences should be separated with double spaces. > (defun vc-git-state (file) > "Git-specific version of `vc-state'." > + > + (save-match-data > + (let* ((default-directory (file-name-directory (expand-file-name file))) > + (status > + (vc-git--run-command-string file "status" "--porcelain" "-z" > + "--untracked-files" "--ignored" "--")) > + code-list) > + (while (string-match "^\\(..\\)[^\0]+\0\\(\\(?:a\\|[^a]\\)*\\)$" status) I think you're missing a space after the first 2 characters. alternate -z format recommended for machine parsing. [...] Second, a NUL (ASCII 0) follows each filename, [...] (but a space still separates the status field from the first filename). > + (add-to-list 'code-list (match-string 1 status) t 'ignore) Don't use `add-to-list' on local variables. The usual idiom for collecting a series of items in a list would be (let ((code-list nil)) (while ... (push ... code-list)) (setq code-list (nreverse code-list))) > + (setq status (match-string 2 status))) Instead of matching the rest of the string in the regexp, just set a position variable to (match-end 0), and then pass that position as the string-match's START parameter. From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 Apr 2017 03:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jonathan Ganc , npostavs@users.sourceforge.net, 26066@debbugs.gnu.org Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.149179478732512 (code B ref 26066); Mon, 10 Apr 2017 03:27:01 +0000 Received: (at 26066) by debbugs.gnu.org; 10 Apr 2017 03:26:27 +0000 Received: from localhost ([127.0.0.1]:40399 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxPyF-0008SK-9N for submit@debbugs.gnu.org; Sun, 09 Apr 2017 23:26:27 -0400 Received: from mail-wm0-f48.google.com ([74.125.82.48]:34473) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxPyC-0008S6-Sm for 26066@debbugs.gnu.org; Sun, 09 Apr 2017 23:26:25 -0400 Received: by mail-wm0-f48.google.com with SMTP id w204so6354994wmd.1 for <26066@debbugs.gnu.org>; Sun, 09 Apr 2017 20:26:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=cw/zgMOV89TGpD5htuQMdd3DJvtK8l8jAUdYm116MBw=; b=W2bqSYIwbQVmU5LYA344cV+jud95MZoXPGHA4KKXK6Rb1W7euzGqv+XOtcaeF1+WOP Otm0QhBwmJ8cIUmCUQ3VM9Q2Jt8m++THE1XdV0cx4qw8YDazoAaCFfPLoynvo7S1gmsp f+Hrmb6FgzjS3W4wX7WfsrpBUxWileFJpiK9u6b3ANPnLG0YzqOObGH4I8NxEqw8GzSC OznqvLvb40LMRUtNROZ9TgMWCId/EynQk96O2witpS68WHC05OhMnfy1Un5mYzRv+kLu MY9ofFjYVsgM8JDQIXsj8v11sAaSWxFoZXT+ct+cv9yhPTjQd5aon4Ocga3YHj+Adw/z QgXw== 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:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=cw/zgMOV89TGpD5htuQMdd3DJvtK8l8jAUdYm116MBw=; b=Z36Sb/e3ndIf/mZKrS459sYiQyzRZR8XpXpGVq9yJg5U0ZR1pl4b7t1by3zxDLnZYS d7jbeBucm+T2oSSTU5Z8sOHyXAzhzMhAkumW5qjtB2zGXi26BvyZgtvqE0WOfJ3eYYSv /2sUYn3zxcyiMqRO4PvUeTJ4Mwbb3mCN6Cgv9b8SemxG1S1psPaUdq7+6vzqzIoW4AH5 VxWfr83HSY9fjFmGY/4Onu6Dox1Djh8KYpHZvlhKoeJo0WL9qYn/pUShtX53cuHfnUSv BWRtMfnPaOVlg1bowhnOeSTrfbBnpYsgVwrTwjmpmLxu63bcjprO4HWhgiaQcy/kN7V5 vwTA== X-Gm-Message-State: AN3rC/7xWIextqYrxBa6oQymkQds/ymPpbSKESmm8tDqXeWbAWq+gMwJ GSGNWc4qJZW6sQ== X-Received: by 10.28.212.67 with SMTP id l64mr8446906wmg.76.1491794779023; Sun, 09 Apr 2017 20:26:19 -0700 (PDT) Received: from [192.168.1.3] ([185.105.173.156]) by smtp.googlemail.com with ESMTPSA id u145sm8434664wmu.1.2017.04.09.20.26.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Apr 2017 20:26:18 -0700 (PDT) References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <87efxy59wx.fsf@users.sourceforge.net> <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> <29d4a5ae-0ca0-3a86-6b9a-ab616803f39e@gmail.com> <4741bddf-9765-0d94-d0cd-b94e3e4914e1@yandex.ru> <8530cd03-0158-f198-9b14-ade983e1c7f4@gmail.com> <022c0e0a-e039-24ef-66ff-82bcedbacd93@yandex.ru> <7fccafd3-e2c2-204a-05a0-a930a4cbb7e4@gmail.com> From: Dmitry Gutov Message-ID: <85978a9c-8b2f-484b-1330-be915fe05085@yandex.ru> Date: Mon, 10 Apr 2017 06:26:16 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: <7fccafd3-e2c2-204a-05a0-a930a4cbb7e4@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) On 31.03.2017 06:16, Jonathan Ganc wrote: > + (save-match-data > + (let* ((default-directory (file-name-directory (expand-file-name file))) We don't require or expect that any particular function keeps the match data intact. I don't think that save-match-data is needed here. Aside from this an Noam's comments, the patch is long enough to require a copyright assignment. I didn't find yours on file. Will you sign one? From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Resent-From: Jonathan Ganc Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 Apr 2017 04:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dmitry Gutov , npostavs@users.sourceforge.net, 26066@debbugs.gnu.org Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.14917992846834 (code B ref 26066); Mon, 10 Apr 2017 04:42:02 +0000 Received: (at 26066) by debbugs.gnu.org; 10 Apr 2017 04:41:24 +0000 Received: from localhost ([127.0.0.1]:40424 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxR8m-0001mA-E2 for submit@debbugs.gnu.org; Mon, 10 Apr 2017 00:41:24 -0400 Received: from mail-qt0-f193.google.com ([209.85.216.193]:34522) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxR8k-0001lx-6D for 26066@debbugs.gnu.org; Mon, 10 Apr 2017 00:41:22 -0400 Received: by mail-qt0-f193.google.com with SMTP id r49so4750035qta.1 for <26066@debbugs.gnu.org>; Sun, 09 Apr 2017 21:41:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to; bh=TR1miUIinQmx6rni6Mk6W9CYwlJuejRgn2J+iEmhHIk=; b=n7n740qG+/XYuxtsEkjztZ3T4Xn3CPStwsZ8n6PTR0x1CAbETMTnHo1U9TSH2MKZkX agGVh2nmvQb4B/+2d7siWrHlSM2bX74XnhJzzjxdCKp6cOoRz5hhL5wXkompiPV4ECtg G/sTc1njY7jzJBqe1oI08EkbDLm6HWihZZ81LJXIyv2tP3ZiRcsrJ3r7qUx5+k/jsbxo jpk0Vzw40pNawD80De06LzGL5E35La+MfitpRxOIppr5YfPPPctFdfoo77PpePHZoWJa fjOCQG5f2yfjBikbS4SeWPrxpZqoAwPxSen0iWw620JB6uwfYYxCQcui1Ub4Sfu+cu4+ CiEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to; bh=TR1miUIinQmx6rni6Mk6W9CYwlJuejRgn2J+iEmhHIk=; b=iqvxI1z+gTun19pj4c8TukIwTAXe5iA07nuidX+yg2ho+YDvGX6k0hxg+EADPhQsGK qYwG5t4mqPwUP7qunAZEXO8+g/RhPilVLa0d7rNvFer0S9zy1akLGElhV7vPIFpUilWD Eaim54TT4Y/ji7bsK5PkvMKfbFdZh8WQn/r+CKOrNCIrIf1hlVPNFnVOJ2d3OqqPbhxs aYM/p/CyIDN0tO/wzAAKdtCwZJ/q9wZkY5khuTrVPzjSL8D7dEoAakRMZDpRrwjmlTrw 0hoEz8QsA1ZKkzaCjt8udR431lWHQk4X22Y4PKEe8WCksN8zq2MQpYw6BQRoL5hvBU7w zAxA== X-Gm-Message-State: AFeK/H2TibY3OcREeC7fzKMJ82Hx8H8cpuUWxWGZv9S5fY+Fg6GCa8fsK4iZLvOmIzobHg== X-Received: by 10.237.33.251 with SMTP id m56mr55538830qtc.121.1491799276676; Sun, 09 Apr 2017 21:41:16 -0700 (PDT) Received: from [192.168.1.200] (static-98-118-34-152.bstnma.fios.verizon.net. [98.118.34.152]) by smtp.gmail.com with ESMTPSA id 44sm8126057qts.15.2017.04.09.21.41.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Apr 2017 21:41:15 -0700 (PDT) References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <87efxy59wx.fsf@users.sourceforge.net> <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> <29d4a5ae-0ca0-3a86-6b9a-ab616803f39e@gmail.com> <4741bddf-9765-0d94-d0cd-b94e3e4914e1@yandex.ru> <8530cd03-0158-f198-9b14-ade983e1c7f4@gmail.com> <022c0e0a-e039-24ef-66ff-82bcedbacd93@yandex.ru> <7fccafd3-e2c2-204a-05a0-a930a4cbb7e4@gmail.com> <85978a9c-8b2f-484b-1330-be915fe05085@yandex.ru> From: Jonathan Ganc Message-ID: <39da25d7-95d1-5b23-f5b1-c6b996aaece7@gmail.com> Date: Mon, 10 Apr 2017 00:41:15 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <85978a9c-8b2f-484b-1330-be915fe05085@yandex.ru> Content-Type: multipart/mixed; boundary="------------4F537D67227018580F1D0513" X-Spam-Score: 0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) This is a multi-part message in MIME format. --------------4F537D67227018580F1D0513 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit I agree with the suggestions from both of you and have made the corrections. I have attached a new patch. Please let me know if you have further thoughts. I will gladly sign a copyright assignment, if you point me to where I can do that. On 04/09/2017 11:26 PM, Dmitry Gutov wrote: > On 31.03.2017 06:16, Jonathan Ganc wrote: >> + (save-match-data >> + (let* ((default-directory (file-name-directory (expand-file-name >> file))) > > We don't require or expect that any particular function keeps the > match data intact. I don't think that save-match-data is needed here. > > Aside from this an Noam's comments, the patch is long enough to > require a copyright assignment. I didn't find yours on file. > > Will you sign one? --------------4F537D67227018580F1D0513 Content-Type: text/x-patch; name="0001-update-vc-git.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-update-vc-git.patch" >From 78bcdd00927bc8f14ef2999b8bf0b4ad25ab6dac Mon Sep 17 00:00:00 2001 From: Jonathan Ganc Date: Mon, 10 Apr 2017 00:38:52 -0400 Subject: [PATCH] update vc-git --- lisp/vc/vc-git.el | 75 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 49 insertions(+), 26 deletions(-) diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 1a3f1bf..a8d686a 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -231,34 +231,57 @@ (defun vc-git--state-code (code) (?U 'edited) ;; FIXME (?T 'edited))) ;; FIXME +(defun vc-git--git-status-to-vc-state (code-list) + "Convert a list CODE-LIST of two-letter git status strings to a vc status. + +Each element of CODE-LIST comes from the first two characters of +a line returned by 'git status' and should be passed in the order given by 'git status'. + +\(It is necessary to allow CODE-LIST to be a list because +sometimes git status returns multiple lines, e.g. for a file that +is removed from the index but is present in the HEAD and working +tree.) " + (pcase code-list + ('nil 'up-to-date) + (`(,code) + (pcase code + ("!!" 'ignored) + ("??" 'unregistered) + ;; I have only seen this with a file that is only present in the + ;; index. Let us call this `removed' + ("AD" 'removed) + (_ (cond + ((string-match-p "^[ RD]+$" code) 'removed) + ((string-match-p "^[ M]+$" code) 'edited) + ((string-match-p "^[ A]+$" code) 'added) + ((string-match-p "^[ U]+$" code) 'conflict) + (t 'edited))))) + ;; I know of two times when git state returns more than one element, + ;; in both cases returning '("D " "??")': + ;; 1. when a file is removed from the index but present in the + ;; HEAD and working tree + ;; 2. when a file A is renamed to B in the index and then back to A + ;; in the working tree + ;; In both these instances, `unregistered' is a reasonable response. + (`("D " "??") 'unregistered) + ;; In other cases, let us return `edited'. + (_ 'edited))) + (defun vc-git-state (file) "Git-specific version of `vc-state'." - ;; FIXME: This can't set 'ignored or 'conflict yet - ;; The 'ignored state could be detected with `git ls-files -i -o - ;; --exclude-standard` It also can't set 'needs-update or - ;; 'needs-merge. The rough equivalent would be that upstream branch - ;; for current branch is in fast-forward state i.e. current branch - ;; is direct ancestor of corresponding upstream branch, and the file - ;; was modified upstream. But we can't check that without a network - ;; operation. - ;; This assumes that status is known to be not `unregistered' because - ;; we've been successfully dispatched here from `vc-state', that - ;; means `vc-git-registered' returned t earlier once. Bug#11757 - (let ((diff (vc-git--run-command-string - file "diff-index" "-p" "--raw" "-z" "HEAD" "--"))) - (if (and diff - (string-match ":[0-7]\\{6\\} [0-7]\\{6\\} [0-9a-f]\\{40\\} [0-9a-f]\\{40\\} \\([ADMUT]\\)\0[^\0]+\0\\(.*\n.\\)?" - diff)) - (let ((diff-letter (match-string 1 diff))) - (if (not (match-beginning 2)) - ;; Empty diff: file contents is the same as the HEAD - ;; revision, but timestamps are different (eg, file - ;; was "touch"ed). Update timestamp in index: - (prog1 'up-to-date - (vc-git--call nil "add" "--refresh" "--" - (file-relative-name file))) - (vc-git--state-code diff-letter))) - (if (vc-git--empty-db-p) 'added 'up-to-date)))) + (let* ((default-directory (file-name-directory (expand-file-name file))) + (status + (vc-git--run-command-string file "status" "--porcelain" "-z" + "--untracked-files" "--ignored" "--")) + code-list (next-match 0)) + ;; If this code is adapted to parse git-status for a directory, note + ;; that a renamed file takes up two null values and needs to be + ;; treated slightly more carefully. + (while (string-match "\\(..\\) [^\0]+\0" status next-match) + (push (match-string 1 status) code-list) + (setq next-match (match-end 0))) + (setq code-list (nreverse code-list)) + (vc-git--git-status-to-vc-state code-list))) (defun vc-git-working-revision (_file) "Git-specific version of `vc-working-revision'." -- 2.9.3 --------------4F537D67227018580F1D0513-- From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Resent-From: Jonathan Ganc Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 Apr 2017 04:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dmitry Gutov , npostavs@users.sourceforge.net, 26066@debbugs.gnu.org Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.14917994237041 (code B ref 26066); Mon, 10 Apr 2017 04:44:01 +0000 Received: (at 26066) by debbugs.gnu.org; 10 Apr 2017 04:43:43 +0000 Received: from localhost ([127.0.0.1]:40428 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxRB0-0001pV-Te for submit@debbugs.gnu.org; Mon, 10 Apr 2017 00:43:43 -0400 Received: from mail-qt0-f194.google.com ([209.85.216.194]:32877) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxRAz-0001pJ-Um for 26066@debbugs.gnu.org; Mon, 10 Apr 2017 00:43:42 -0400 Received: by mail-qt0-f194.google.com with SMTP id c45so9047758qtb.0 for <26066@debbugs.gnu.org>; Sun, 09 Apr 2017 21:43:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=gxUiXPBGze4QOoXWPgNyZg66/AiXKPpM8l8kurLS1j8=; b=qAEKniaB0xGAMw+a5EJzp3Sagz0i2GlAuvngX327qASCnzL/7pxY4l1QQQxv180khD 1HQRR2Hmm+t0RY5xgQ0lkEiDNn4ZU0DoUu5KP0JPXay3u5mtEsPu5OEsOouNhXNCtWdf O6zbuxsQcrEAJ5RrF/GfEeutNxA/W0pQ5legkIzx/nVP0nONaZ8AWpgxW9uzFZUpVIvJ IWYU00fgtcmwuGc7k/DeM6+umbiA2OioA524Mb/ftbxCBkAAoodTy0s+i9cEoM/k2ta5 VS1ZBj7c83KYfVbrK6gyBJAHN9wTaCV9aC2cwZmP2fvfcbRgYKBPjcnN5v6OXNNwrTgo f1fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=gxUiXPBGze4QOoXWPgNyZg66/AiXKPpM8l8kurLS1j8=; b=FYb3TlY95aLUR3vTcMiyBPU5e7+ZENui+r1lZ47oeyFwTXAyWR3ZpPngkzCbFVlY9A 9dZvZof2z+TWySO9eTSJVoIWYTyH6ZmOFc00fBDsNs8wz+39LUBcnSYOqyeZOsA0kv7D uof+R8Gd4y0nlo05M4fYIRt/9Ct539XeuP0znjwtKMRETMvFb0jaKSWiYu50fzLWqKJs CQzwUhrPPcF8SV+8GQPoqV7zVDmxXyTfizcMttVbRTQeIH0L2/eI0lh4SQC1AZw1iYqt 0CSrLVIthdIfD+o6Dv/YOjcT5gPvaiq2XOJR1iVs31ZsHLajUascfQDH3qiHEIdQ3LXZ n2Bw== X-Gm-Message-State: AN3rC/5uxHzrv9bupfI0tJUGuKLT+XPQ2sqdcEf2mDL2UIj3u98R1U6ydrux+V5RMH6oyw== X-Received: by 10.200.53.202 with SMTP id l10mr5232945qtb.133.1491799416607; Sun, 09 Apr 2017 21:43:36 -0700 (PDT) Received: from [192.168.1.200] (static-98-118-34-152.bstnma.fios.verizon.net. [98.118.34.152]) by smtp.gmail.com with ESMTPSA id s3sm8096500qte.57.2017.04.09.21.43.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Apr 2017 21:43:36 -0700 (PDT) References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <87efxy59wx.fsf@users.sourceforge.net> <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> <29d4a5ae-0ca0-3a86-6b9a-ab616803f39e@gmail.com> <4741bddf-9765-0d94-d0cd-b94e3e4914e1@yandex.ru> <8530cd03-0158-f198-9b14-ade983e1c7f4@gmail.com> <022c0e0a-e039-24ef-66ff-82bcedbacd93@yandex.ru> <7fccafd3-e2c2-204a-05a0-a930a4cbb7e4@gmail.com> <85978a9c-8b2f-484b-1330-be915fe05085@yandex.ru> From: Jonathan Ganc Message-ID: <60e28ad2-a875-617d-5a8d-5e17caab21fd@gmail.com> Date: Mon, 10 Apr 2017 00:43:35 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <85978a9c-8b2f-484b-1330-be915fe05085@yandex.ru> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) BTW, Dmitry, I've started using Diff-Hl and it's really nice! On 04/09/2017 11:26 PM, Dmitry Gutov wrote: > On 31.03.2017 06:16, Jonathan Ganc wrote: >> + (save-match-data >> + (let* ((default-directory (file-name-directory (expand-file-name >> file))) > > We don't require or expect that any particular function keeps the > match data intact. I don't think that save-match-data is needed here. > > Aside from this an Noam's comments, the patch is long enough to > require a copyright assignment. I didn't find yours on file. > > Will you sign one? From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 Apr 2017 06:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jonathan Ganc Cc: npostavs@users.sourceforge.net, 26066@debbugs.gnu.org, dgutov@yandex.ru Reply-To: Eli Zaretskii Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.149180432315054 (code B ref 26066); Mon, 10 Apr 2017 06:06:02 +0000 Received: (at 26066) by debbugs.gnu.org; 10 Apr 2017 06:05:23 +0000 Received: from localhost ([127.0.0.1]:40442 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxSS3-0003uk-EE for submit@debbugs.gnu.org; Mon, 10 Apr 2017 02:05:23 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55499) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxSS2-0003uY-3R for 26066@debbugs.gnu.org; Mon, 10 Apr 2017 02:05:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cxSRr-0000HA-Ui for 26066@debbugs.gnu.org; Mon, 10 Apr 2017 02:05:16 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33984) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cxSRr-0000H6-Rv; Mon, 10 Apr 2017 02:05:11 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1683 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cxSRq-0004WA-WC; Mon, 10 Apr 2017 02:05:11 -0400 Date: Mon, 10 Apr 2017 09:05:25 +0300 Message-Id: <83inmclrve.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <39da25d7-95d1-5b23-f5b1-c6b996aaece7@gmail.com> (message from Jonathan Ganc on Mon, 10 Apr 2017 00:41:15 -0400) References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <87efxy59wx.fsf@users.sourceforge.net> <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> <29d4a5ae-0ca0-3a86-6b9a-ab616803f39e@gmail.com> <4741bddf-9765-0d94-d0cd-b94e3e4914e1@yandex.ru> <8530cd03-0158-f198-9b14-ade983e1c7f4@gmail.com> <022c0e0a-e039-24ef-66ff-82bcedbacd93@yandex.ru> <7fccafd3-e2c2-204a-05a0-a930a4cbb7e4@gmail.com> <85978a9c-8b2f-484b-1330-be915fe05085@yandex.ru> <39da25d7-95d1-5b23-f5b1-c6b996aaece7@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Jonathan Ganc > Date: Mon, 10 Apr 2017 00:41:15 -0400 > > I will gladly sign a copyright assignment, if you point me to where I > can do that. I sent the form off-list. Thanks. From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Resent-From: Thien-Thi Nguyen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 Apr 2017 07:33:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 26066@debbugs.gnu.org Cc: Jonathan Ganc Reply-To: 26066@debbugs.gnu.org Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.149180955323273 (code B ref 26066); Mon, 10 Apr 2017 07:33:03 +0000 Received: (at 26066) by debbugs.gnu.org; 10 Apr 2017 07:32:33 +0000 Received: from localhost ([127.0.0.1]:40495 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxToP-00063J-AV for submit@debbugs.gnu.org; Mon, 10 Apr 2017 03:32:33 -0400 Received: from mail.agora-net.com ([67.59.132.6]:55873) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxToN-00063B-ML for 26066@debbugs.gnu.org; Mon, 10 Apr 2017 03:32:31 -0400 Received: from ttn by mail.agora-net.com with local (Exim 4.82) (envelope-from ) id 1cxToM-0002nK-Mg; Mon, 10 Apr 2017 03:32:30 -0400 Received: from ttn by zigzag.favinet with local (Exim 4.80) (envelope-from ) id 1cxTrR-00061E-Mb; Mon, 10 Apr 2017 09:35:41 +0200 From: Thien-Thi Nguyen References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <87efxy59wx.fsf@users.sourceforge.net> <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> <29d4a5ae-0ca0-3a86-6b9a-ab616803f39e@gmail.com> <4741bddf-9765-0d94-d0cd-b94e3e4914e1@yandex.ru> <8530cd03-0158-f198-9b14-ade983e1c7f4@gmail.com> <022c0e0a-e039-24ef-66ff-82bcedbacd93@yandex.ru> <7fccafd3-e2c2-204a-05a0-a930a4cbb7e4@gmail.com> <85978a9c-8b2f-484b-1330-be915fe05085@yandex.ru> <39da25d7-95d1-5b23-f5b1-c6b996aaece7@gmail.com> Mail-Followup-To: 26066@debbugs.gnu.org Date: Mon, 10 Apr 2017 09:35:28 +0200 In-Reply-To: <39da25d7-95d1-5b23-f5b1-c6b996aaece7@gmail.com> (Jonathan Ganc's message of "Mon, 10 Apr 2017 00:41:15 -0400") Message-ID: <87fuhgd8an.fsf@zigzag> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: ttn@gnuvola.org X-SA-Exim-Scanned: No (on mail.agora-net.com); SAEximRunCond expanded to false X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable () Jonathan Ganc () Mon, 10 Apr 2017 00:41:15 -0400 + (while (string-match "\\(..\\) [^\0]+\0" status next-match) + (push (match-string 1 status) code-list) + (setq next-match (match-end 0))) + (setq code-list (nreverse code-list)) You can also use something like: (mapcar (lambda (s) (substring s 0 2)) (split-string status "\0")) to compute the value of =E2=80=98code-list=E2=80=99. Might be quicker, too. =2D-=20 Thien-Thi Nguyen ----------------------------------------------- (defun responsep (query) (pcase (context query) (`(technical ,ml) (correctp ml)) ...)) 748E A0E8 1CB8 A748 9BFA =2D-------------------------------------- 6CE4 6703 2224 4C80 7502 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAljrNcQACgkQZwMiJEyAdQLNuACgn/yzkHpitD6NitcHEYnDrs/z LFkAniQNn+RHPUabYX6PG8dpmGex053o =F6Uc -----END PGP SIGNATURE----- --=-=-=-- From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 Apr 2017 23:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jonathan Ganc , npostavs@users.sourceforge.net, 26066@debbugs.gnu.org Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.149186680823869 (code B ref 26066); Mon, 10 Apr 2017 23:27:01 +0000 Received: (at 26066) by debbugs.gnu.org; 10 Apr 2017 23:26:48 +0000 Received: from localhost ([127.0.0.1]:41693 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxihr-0006Cv-UK for submit@debbugs.gnu.org; Mon, 10 Apr 2017 19:26:48 -0400 Received: from mail-wm0-f48.google.com ([74.125.82.48]:35731) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxihq-0006Cf-Dz for 26066@debbugs.gnu.org; Mon, 10 Apr 2017 19:26:46 -0400 Received: by mail-wm0-f48.google.com with SMTP id w64so50656858wma.0 for <26066@debbugs.gnu.org>; Mon, 10 Apr 2017 16:26:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=GUTNmxxnIFLD55wHMy5zmAHj7vps55oB9vXkUtIqpJM=; b=T532BHU6jCTXTBhLT1agD7R2R53H9sbTZbQ5sxnLdYi0m+If6J/CngeuMge7oEuzCw c1MTDRR/ilBbPahTn6Df1+6deXwDpSd2FFwH7CGYG8gMT0OcqKg/Bjkz+GoCehRefGBg o5pigrcx+tBFWVwHkX9zoAuTrhhHq5mKegmMAfxR1FBinNwsSYLBtGh4OFZ5Pw5Digzv pdJRFO+Pn1nh4TkyHvxut/6MV2h5Jc8APmQem/80GeaCPaWndoQlRwWM5DRUl11CVJKP AHeM/uyPmNYkSVOnLm2hiiCibKxKXbG+Gr3YZrrOURIXapCQgCT+p8BrU6GHT4ITcqT1 mU4w== 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:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=GUTNmxxnIFLD55wHMy5zmAHj7vps55oB9vXkUtIqpJM=; b=Fan+Zc212wv/vPPbPU2iFSbj7J9XrBeoxZADq4nOHxTKxW1ryzJwb7YjQ4ZO1j27+H uM7q9OG8Gme8QYJ9Gg8SR0SE61lzk8XeHyPlvRpNUsy+xZ1pkvPL2mcY9JDuMSZJwozp zeelCorYN46gI9Rcgbx/SA7u5WoCkE3N8B844y3KCK4cppk0B+bunNWhnp0MQhpLJ7sB rDnjnPUZKot1aBCysi54xffA+Ugwyk7gzCFsnnkJAqjV4V820t6MKhJnADTDswfA0kFH vGi1uEY077LIPmE8cNzFRWQk3EMqjiNXbYAOLJBQEuU1o2b6+jYewWi73lFPSH/++o+6 f2Tw== X-Gm-Message-State: AN3rC/6ku7BjoZlLxR424p6eHOy5iWdZNe2JgOVstSRPw7g3ULwKbyA7 Db+dzmaQfhCzJg== X-Received: by 10.28.236.135 with SMTP id h7mr10547693wmi.74.1491866800847; Mon, 10 Apr 2017 16:26:40 -0700 (PDT) Received: from [192.168.1.3] ([185.105.173.156]) by smtp.googlemail.com with ESMTPSA id q129sm1184375wmg.1.2017.04.10.16.26.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Apr 2017 16:26:40 -0700 (PDT) References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <87efxy59wx.fsf@users.sourceforge.net> <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> <29d4a5ae-0ca0-3a86-6b9a-ab616803f39e@gmail.com> <4741bddf-9765-0d94-d0cd-b94e3e4914e1@yandex.ru> <8530cd03-0158-f198-9b14-ade983e1c7f4@gmail.com> <022c0e0a-e039-24ef-66ff-82bcedbacd93@yandex.ru> <7fccafd3-e2c2-204a-05a0-a930a4cbb7e4@gmail.com> <85978a9c-8b2f-484b-1330-be915fe05085@yandex.ru> <60e28ad2-a875-617d-5a8d-5e17caab21fd@gmail.com> From: Dmitry Gutov Message-ID: Date: Tue, 11 Apr 2017 02:26:39 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: <60e28ad2-a875-617d-5a8d-5e17caab21fd@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) On 10.04.2017 07:43, Jonathan Ganc wrote: > BTW, Dmitry, I've started using Diff-Hl and it's really nice! I'm glad you like it :) From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 Apr 2017 23:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jonathan Ganc , npostavs@users.sourceforge.net, 26066@debbugs.gnu.org Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.149186801025818 (code B ref 26066); Mon, 10 Apr 2017 23:47:01 +0000 Received: (at 26066) by debbugs.gnu.org; 10 Apr 2017 23:46:50 +0000 Received: from localhost ([127.0.0.1]:41703 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxj1G-0006iM-MY for submit@debbugs.gnu.org; Mon, 10 Apr 2017 19:46:50 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:32769) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxj1E-0006i9-Vw for 26066@debbugs.gnu.org; Mon, 10 Apr 2017 19:46:49 -0400 Received: by mail-wm0-f66.google.com with SMTP id o81so12155813wmb.0 for <26066@debbugs.gnu.org>; Mon, 10 Apr 2017 16:46:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=HAPhX4dostMUXBi2mzENjqyMqm7DtrcQiHhQb0J6MAA=; b=pcq/wLafBr1TeEfC+Ffj0y1bgpIJuOosMgyU8rl1yL0yXveeNCVT80INcwGuCD5qIc ff2GsFJDLohG8rQLFeRpBDfK2FfLqPZvWcKV8F2Qs2KS8V+vZb4IoV+nHsc9grjm9TY+ GWiOyuuEMRMb5fYqccC86W8qRDWRFMcTHXxok+gUZ5M5W6YDmNIOo3DF307RXQK9w2gE MmdXeHXJ7C7VNYjNwNMKOTjzJ8Eq5Jun9WHTeP0znzv6Jz0VhG5gDO4B6xW81ySMtp5y KvVsQahDel3E6vgLgFj9ikg9w+Zf9Hv3ni7adVNBh9t4N1BFeQaQpa7cNWmL3eDgsETO 0w4g== 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:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=HAPhX4dostMUXBi2mzENjqyMqm7DtrcQiHhQb0J6MAA=; b=aEzd/D5ZuASrGrMp+sNmMT41NZJdHienNFoH6Ot9U81K5a83vdgtPoZ+gDWUSDDhfG fD8W3UfHMhahIACYTPIjsoNxJihoGGpFRMF5IZTc0wxBsaKVPrzC8zpMRfRXd/TEbtiX wMUk8UVfSBkF4yBrJ+bYxPJ2u/13uzDqnAwlOQLQpvIMy6RPqrgkqyhYbsat8N7HdbMS JD7rjpTx1YMzdRWV29MFqa3hnds/vBdftfSpGsbfXIVkbh30GV4A6G1qIwv+h6HzEB4o Bx4lfLeervd9bLGe/7xBA8vcdFM4wJwzKCRB+N6rFPhpoPZV0vslHYfZh4gwTfIo7PvM 6mRQ== X-Gm-Message-State: AN3rC/521ict+KdB5OaclWDNoDbzHeV/YNzPVYbogbN5Wx2fZsh7zIOR4ox5R2k/kU1zRA== X-Received: by 10.28.107.13 with SMTP id g13mr11596219wmc.117.1491868003350; Mon, 10 Apr 2017 16:46:43 -0700 (PDT) Received: from [192.168.1.3] ([185.105.173.156]) by smtp.googlemail.com with ESMTPSA id 32sm19243520wrq.25.2017.04.10.16.46.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Apr 2017 16:46:42 -0700 (PDT) References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <87efxy59wx.fsf@users.sourceforge.net> <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> <29d4a5ae-0ca0-3a86-6b9a-ab616803f39e@gmail.com> <4741bddf-9765-0d94-d0cd-b94e3e4914e1@yandex.ru> <8530cd03-0158-f198-9b14-ade983e1c7f4@gmail.com> <022c0e0a-e039-24ef-66ff-82bcedbacd93@yandex.ru> <7fccafd3-e2c2-204a-05a0-a930a4cbb7e4@gmail.com> <85978a9c-8b2f-484b-1330-be915fe05085@yandex.ru> <39da25d7-95d1-5b23-f5b1-c6b996aaece7@gmail.com> From: Dmitry Gutov Message-ID: <68331a1a-b4c4-ac7f-b047-ceb6174d1217@yandex.ru> Date: Tue, 11 Apr 2017 02:46:40 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: <39da25d7-95d1-5b23-f5b1-c6b996aaece7@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.2 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.2 (/) On 10.04.2017 07:41, Jonathan Ganc wrote: > I agree with the suggestions from both of you and have made the > corrections. I have attached a new patch. Please let me know if you have > further thoughts. Thanks. I guess the main thing left is to decide whether vc-git-state should bind default-directory. For example, vc-bzr-state doesn't, while vc-hg-state does. Does this binding affect the command output, in this particular case? From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 Apr 2017 00:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jonathan Ganc , npostavs@users.sourceforge.net, 26066@debbugs.gnu.org, Stefan Monnier Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.149186925127805 (code B ref 26066); Tue, 11 Apr 2017 00:08:01 +0000 Received: (at 26066) by debbugs.gnu.org; 11 Apr 2017 00:07:31 +0000 Received: from localhost ([127.0.0.1]:41722 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxjLH-0007EP-Ir for submit@debbugs.gnu.org; Mon, 10 Apr 2017 20:07:31 -0400 Received: from mail-wr0-f179.google.com ([209.85.128.179]:33637) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxjLF-0007ED-Ov for 26066@debbugs.gnu.org; Mon, 10 Apr 2017 20:07:30 -0400 Received: by mail-wr0-f179.google.com with SMTP id l28so29183429wre.0 for <26066@debbugs.gnu.org>; Mon, 10 Apr 2017 17:07:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Oku28FYCZff8JN7a2eGSHqOE3AU4WfQ/B3hl1/tobUk=; b=GKS4K5rQbZqrTkjzkvhVrMZJeibua1cjTvPI0GoB+QWEc0+UkMlB6RqY0uNo9fO8I9 2cPPtuQk/ycVG8A/N1DDe66l+CH62eS0GvlhVneDSUAJejobTx0YQhDSdh3RG/uue+3U 4k+muWKZBTtptcVxk1zGd6DT3cwRpK9I2RzVysbat/jfGQr0rfNQ42d4rJ2iMYqlgqFj 3EghxWKeYjOf729hhMrbZkwH06t6xXda8c6EmhIXLzgAXTwpZvODGeqWuvMDozYsyYT8 peIjVxXeq4v/JXX2zAr4vlSkP7sz9gD7QA7cnf9uOI7j3xhyd+R7q/TmH1zi/OotEVSX IfBA== 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:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Oku28FYCZff8JN7a2eGSHqOE3AU4WfQ/B3hl1/tobUk=; b=fd11rcvsRe4l+H/SZrtuUbgpkIfOZPJt0u6EAhQ6ggmYascex8PTY34kOrm+3L4P6O jKOy+vqZDyTdo2dV5g+PLAPpWVV1oPGYz2NVnpEdTAhnqycmDedMU2tU6u3WGNHiUdfw Yd0qEYZzfWELfPOzCBinucnYo27csanQQ8A+6N94g0OJSssCWU3kZqb4ugzEALU+PIag pGsFN/RLfwfEemcoLv5lWMNN6FqEKt2w8b+TNBO35v/QGBPYKnngVWRLDDu6hBkjwVM7 GKjKTLLiroEejgnmg2rGr5EIPaSVkRrdLVBkEkJxROwC79vxKgIRs9QoesdjxnlMD84b 9xhg== X-Gm-Message-State: AN3rC/75j6uG+cyf8rMEO1VhGTn9hwWKiNq171+7CP/88Z0JzQ/dKQGN8z84cgdrqMQY7g== X-Received: by 10.223.163.17 with SMTP id c17mr7884042wrb.186.1491869244164; Mon, 10 Apr 2017 17:07:24 -0700 (PDT) Received: from [192.168.1.3] ([185.105.173.156]) by smtp.googlemail.com with ESMTPSA id h68sm211469wmd.19.2017.04.10.17.07.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Apr 2017 17:07:23 -0700 (PDT) References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <87efxy59wx.fsf@users.sourceforge.net> <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> <29d4a5ae-0ca0-3a86-6b9a-ab616803f39e@gmail.com> <4741bddf-9765-0d94-d0cd-b94e3e4914e1@yandex.ru> <8530cd03-0158-f198-9b14-ade983e1c7f4@gmail.com> <022c0e0a-e039-24ef-66ff-82bcedbacd93@yandex.ru> From: Dmitry Gutov Message-ID: <505388da-e642-8c98-35c0-261d09ff13e1@yandex.ru> Date: Tue, 11 Apr 2017 03:07:21 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) On 23.03.2017 04:18, Jonathan Ganc wrote: > Yeah, I'm not really sure what the workflow should be; I'm just getting > started with the vc functions in emacs. One issue, though, is that > default-directory can only be set for functions that identify a > filename, because we need to have a directory to set things to. For this > reason, I don't know that one could generally set default-directory in > vc-call-backend. You are right. But we could set it in vc-state-refresh. > It could make sense to set default-directory for > vc-git--run-command-string (although to get vc-git-state to work, one > would still need to set it for vc-git--empty-db-p). That's also an option, yes. But binding it on the higher level would be better, I think. > It's worth nothing there seems to be inconsistency within vc-git. Some > commands like vc-git-checkin, vc-git-next-revision, do set > default-directory to the directory of the input file; other comands like > vc-git-merge-branch seem to do the opposite and assume the root is > already given by default-directory. True. Some of those occurrences are most likely there just so the DIR argument is not left unused. Some have less obvious reasons. vc-git-checkin, for instance, does it to call 'git commit' from the repository root, instead of an arbitrary directory in it. I'm sure it's really necessary, though. > At the very least, the documentation for vc-git-state should note that > default-directory needs to be set. The backend-specific functions are largely internal, we don't expect clients to call them directly. If anything, the documentation can be clarified on whether an arbitrary backend's 'state' command should set default-directory, or use the current one. > You're right, in principle, but atom handles it by coloring directories > based on if they have modified files within. I don't know if there is a > "canonical" way to do this, although one idea would be to return a list > of all file status in the directory, e.g. `(up-to-date modified ignored)`. Yeah, diff-hl-dired does something like that. If all the "interesting" statuses in a directory are the same, we assign it that status. If they're mixed, we mark it as "changed". From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Resent-From: Jonathan Ganc Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 Apr 2017 03:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dmitry Gutov , npostavs@users.sourceforge.net, 26066@debbugs.gnu.org, Stefan Monnier Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.149188275324738 (code B ref 26066); Tue, 11 Apr 2017 03:53:01 +0000 Received: (at 26066) by debbugs.gnu.org; 11 Apr 2017 03:52:33 +0000 Received: from localhost ([127.0.0.1]:41826 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxmr2-0006Qw-Mm for submit@debbugs.gnu.org; Mon, 10 Apr 2017 23:52:32 -0400 Received: from mail-qt0-f194.google.com ([209.85.216.194]:34574) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxmr1-0006Qk-Ih for 26066@debbugs.gnu.org; Mon, 10 Apr 2017 23:52:31 -0400 Received: by mail-qt0-f194.google.com with SMTP id r49so8864826qta.1 for <26066@debbugs.gnu.org>; Mon, 10 Apr 2017 20:52:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to; bh=AwE0AV+Yw6DG9ShIPjrC+51aeURUDYcHGi1kv7eWYy8=; b=FQyFc3L0cabW6BRmWN5caBsIFOS7q/wfKGf1suTMqfhHNmuwt4qDe5NJH8GwzPk5rf zWQYE+2Vin03Kw4gnxLCWl6AK6bS/q4FmY5/06bRCasNueMrCsoGOPcDXzI2GuYBwt0P rgpA1CWIxA6RllRpA/tieFQS4ExsOjoBnHTkSyHmmbNJetXq7DTF4iObuxJWfA1chsJL mq4BcQ6NLkEwoG7/vud7YMDgMeDecQX7/oHbW2bhSD3RVEJjVCfBMZyqUqS0DRqlbkKM ih69gTUvK7de8mroWk2zWER/eoPJgoXlp27GNYMmKPejNHW02g+gIgdWvXzObjrzsmdc RffQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to; bh=AwE0AV+Yw6DG9ShIPjrC+51aeURUDYcHGi1kv7eWYy8=; b=bFKU7K+2/qK3Q7EVLfH9AJu9C3VoMlGEPQLYWxvOvhcbOPp6lZo4M76EEygAP8TIoQ A/3DP5JCMap2lNlZqEq/95g3cKEojOxauPCiK43XssHTI8hvu+/W9SH95B0wGt/l6ISa 5W7irFXKlnQ4a7QuR+Ahm13/XX10rQum6+I1nwcVOTAsv2vahoHnTDccLDIdeGGVWLCL 31kxGf3uUthauuq44+knUNU6FffbozgM/HZDcN661ccxtkd4Mb35qizToBhuyu5NWYBC oNLb3d/lBDgvaf0PbVMaZDNgMy6apxEfSvF2z3u2HbVcWWG4m5HavaVEfMYXgUxKsAX+ Md4w== X-Gm-Message-State: AN3rC/5bqLJGAkzJRGwFykHkNYL3GZY3CygKXJKcAW6A9TjMUzwL7FqgtEyAZTsTJE/Ydw== X-Received: by 10.237.44.99 with SMTP id f90mr6158925qtd.24.1491882745938; Mon, 10 Apr 2017 20:52:25 -0700 (PDT) Received: from [192.168.1.198] (static-98-118-34-152.bstnma.fios.verizon.net. [98.118.34.152]) by smtp.gmail.com with ESMTPSA id 1sm5132602qtm.59.2017.04.10.20.52.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Apr 2017 20:52:25 -0700 (PDT) References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <87efxy59wx.fsf@users.sourceforge.net> <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> <29d4a5ae-0ca0-3a86-6b9a-ab616803f39e@gmail.com> <4741bddf-9765-0d94-d0cd-b94e3e4914e1@yandex.ru> <8530cd03-0158-f198-9b14-ade983e1c7f4@gmail.com> <022c0e0a-e039-24ef-66ff-82bcedbacd93@yandex.ru> <505388da-e642-8c98-35c0-261d09ff13e1@yandex.ru> From: Jonathan Ganc Message-ID: <1a23269d-1ead-1771-1afd-e2c9c5840cb4@gmail.com> Date: Mon, 10 Apr 2017 23:52:24 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <505388da-e642-8c98-35c0-261d09ff13e1@yandex.ru> Content-Type: multipart/mixed; boundary="------------1D6459AC6D25AF909738FB0B" X-Spam-Score: 0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) This is a multi-part message in MIME format. --------------1D6459AC6D25AF909738FB0B Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit I've incorporated Thien-Thi's suggestion, as well as an if to check status for nil (which indicates unregistered). On 04/10/2017 08:07 PM, Dmitry Gutov wrote: > You are right. But we could set it in vc-state-refresh. > On 04/10/2017 07:46 PM, Dmitry Gutov wrote: > > Thanks. I guess the main thing left is to decide whether vc-git-state > should bind default-directory. For example, vc-bzr-state doesn't, > while vc-hg-state does. > > Does this binding affect the command output, in this particular case? The binding affects the output if default-directory is not set inside the file's repository. Since, in principle, the vc functions should be agnostic to the choice of vcs, either a) vc-state documentation should state that default-directory should be set to get generally correct responses or b) it should be set in some function (and I agree that vc-state-refresh makes sense). I think the overhead of setting the directory is rather low. In some admittedly rudimentary benchmarks, there is almost no difference in performance setting default-directory. There's also the question of how to handle default-directory. You cannot simply do (file-name-directory file), because that fails if FILE is given without a directory. I think the correct one is (file-name-directory (expand-file-name file)) (which, surprisingly, is slighly faster than (file-name-directory (concat default-directory file)) ). --------------1D6459AC6D25AF909738FB0B Content-Type: text/x-patch; name="0001-update-vc-git.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-update-vc-git.patch" >From 8892f98fc0a8a956bc1adefcc0394ac6cf5e47d3 Mon Sep 17 00:00:00 2001 From: Jonathan Ganc Date: Mon, 10 Apr 2017 00:38:52 -0400 Subject: [PATCH] update vc-git --- lisp/vc/vc-git.el | 79 +++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 53 insertions(+), 26 deletions(-) diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 1a3f1bf..7c16125 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -231,34 +231,61 @@ (defun vc-git--state-code (code) (?U 'edited) ;; FIXME (?T 'edited))) ;; FIXME +(defun vc-git--git-status-to-vc-state (code-list) + "Convert a list CODE-LIST of two-letter git status strings to a vc status. + +Each element of CODE-LIST comes from the first two characters of +a line returned by 'git status' and should be passed in the order given by 'git status'. + +\(It is necessary to allow CODE-LIST to be a list because +sometimes git status returns multiple lines, e.g. for a file that +is removed from the index but is present in the HEAD and working +tree.) " + (pcase code-list + ('nil 'up-to-date) + (`(,code) + (pcase code + ("!!" 'ignored) + ("??" 'unregistered) + ;; I have only seen this with a file that is only present in the + ;; index. Let us call this `removed' + ("AD" 'removed) + (_ (cond + ((string-match-p "^[ RD]+$" code) 'removed) + ((string-match-p "^[ M]+$" code) 'edited) + ((string-match-p "^[ A]+$" code) 'added) + ((string-match-p "^[ U]+$" code) 'conflict) + (t 'edited))))) + ;; I know of two times when git state returns more than one element, + ;; in both cases returning '("D " "??")': + ;; 1. when a file is removed from the index but present in the + ;; HEAD and working tree + ;; 2. when a file A is renamed to B in the index and then back to A + ;; in the working tree + ;; In both these instances, `unregistered' is a reasonable response. + (`("D " "??") 'unregistered) + ;; In other cases, let us return `edited'. + (_ 'edited))) + (defun vc-git-state (file) "Git-specific version of `vc-state'." - ;; FIXME: This can't set 'ignored or 'conflict yet - ;; The 'ignored state could be detected with `git ls-files -i -o - ;; --exclude-standard` It also can't set 'needs-update or - ;; 'needs-merge. The rough equivalent would be that upstream branch - ;; for current branch is in fast-forward state i.e. current branch - ;; is direct ancestor of corresponding upstream branch, and the file - ;; was modified upstream. But we can't check that without a network - ;; operation. - ;; This assumes that status is known to be not `unregistered' because - ;; we've been successfully dispatched here from `vc-state', that - ;; means `vc-git-registered' returned t earlier once. Bug#11757 - (let ((diff (vc-git--run-command-string - file "diff-index" "-p" "--raw" "-z" "HEAD" "--"))) - (if (and diff - (string-match ":[0-7]\\{6\\} [0-7]\\{6\\} [0-9a-f]\\{40\\} [0-9a-f]\\{40\\} \\([ADMUT]\\)\0[^\0]+\0\\(.*\n.\\)?" - diff)) - (let ((diff-letter (match-string 1 diff))) - (if (not (match-beginning 2)) - ;; Empty diff: file contents is the same as the HEAD - ;; revision, but timestamps are different (eg, file - ;; was "touch"ed). Update timestamp in index: - (prog1 'up-to-date - (vc-git--call nil "add" "--refresh" "--" - (file-relative-name file))) - (vc-git--state-code diff-letter))) - (if (vc-git--empty-db-p) 'added 'up-to-date)))) + (let* ((default-directory (file-name-directory (expand-file-name file))) + (status + (vc-git--run-command-string file "status" "--porcelain" "-z" + "--untracked-files" "--ignored" "--")) + code-list) + (if (null status) + ;; If status is nil, there was an error running git, likely because + ;; the file is not in a git repo. + 'unregistered + ;; If this code is adapted to parse 'git status' for a directory, + ;; note that a renamed file takes up two null values and needs to be + ;; treated slightly more carefully. + (setq code-list + (mapcar (lambda (s) + (substring s 0 2)) + (delete "" (split-string status "\0")))) + (vc-git--git-status-to-vc-state code-list)))) (defun vc-git-working-revision (_file) "Git-specific version of `vc-working-revision'." -- 2.9.3 --------------1D6459AC6D25AF909738FB0B-- From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Resent-From: Jonathan Ganc Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 Apr 2017 13:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dmitry Gutov , npostavs@users.sourceforge.net, 26066@debbugs.gnu.org, Stefan Monnier Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.149191612427806 (code B ref 26066); Tue, 11 Apr 2017 13:09:01 +0000 Received: (at 26066) by debbugs.gnu.org; 11 Apr 2017 13:08:44 +0000 Received: from localhost ([127.0.0.1]:42056 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxvXI-0007EQ-97 for submit@debbugs.gnu.org; Tue, 11 Apr 2017 09:08:44 -0400 Received: from mail-qk0-f195.google.com ([209.85.220.195]:36153) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxvXG-0007ED-Av for 26066@debbugs.gnu.org; Tue, 11 Apr 2017 09:08:42 -0400 Received: by mail-qk0-f195.google.com with SMTP id v75so24001965qkb.3 for <26066@debbugs.gnu.org>; Tue, 11 Apr 2017 06:08:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=cuO/fWJYW+H6zgr/n0lPOgNTmQMCSPCE6y3ApEtX5v0=; b=qnKmbpNep+r+dW7Y/pZolY5yhKquRcerzCXEqltQyx6bPPKCAgCX+88uYrAWfRfncH nUcaz8V2/+xk97KFzb9MTNsLVzGQakczLHwPgcGefW1AVdjIKXCqwOKRfJL0tIOPrY1Y lm9OsRcYhR4xDS+0cvXzkcN4R2yYBob7l3MXFKc9TVG1/ZfKqI/SYJSBm7YOUw0tBwpt eG18XGMP55kmcL7J512hh9W6dPaAJwjHbUVWb5pEZ2agPt1TjZHw1HczynXrHo0AfwLV RLGV5tLIn7odF4zUlGMY5IwEjBKXTBOnxI/7192dIW77vVM90GMaL3jjbEso2fmX26cA ScsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=cuO/fWJYW+H6zgr/n0lPOgNTmQMCSPCE6y3ApEtX5v0=; b=HXkLi+Wt7uPSdlaky3kKrKP4cZzJgwClgD1n92FUv/alU2URdybIUxLGfriS0ajkjN NFP8aipOI7pM0p8gpXlMG+Bc7L9g41ZYSb5cNE08dg5AAU05nRSa0NFSZlxY5e/ZishN ktBg85Yv9IjFk3mwwna33xXdGvdsFXZ/IBorfEwOaD+f1bhKtr9cloAdFQY9xaaKJww/ rMvnMT5xq3gqftMTEBDILkyXCHiJ+uiOeEr/iZzfUWUPBJ4qrzTVxyrYgkcxUfFIZxXx 7rIzE2uRB4BBUpoOFuBdCco0QQPKUDsVUNnNgtO6VJXAzuO95VzceXLYP4XEVOHXtvMc AUkw== X-Gm-Message-State: AN3rC/6Xw5wEOd8cH3QQvS0v3CLRcM9mw/aSaU0j7E3ytreBgwG//EJlSj5jWpsoUsNe5g== X-Received: by 10.55.210.1 with SMTP id f1mr16718107qkj.165.1491916116857; Tue, 11 Apr 2017 06:08:36 -0700 (PDT) Received: from [192.168.1.198] (static-98-118-34-152.bstnma.fios.verizon.net. [98.118.34.152]) by smtp.gmail.com with ESMTPSA id s28sm10971877qts.65.2017.04.11.06.08.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Apr 2017 06:08:36 -0700 (PDT) References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <87efxy59wx.fsf@users.sourceforge.net> <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> <29d4a5ae-0ca0-3a86-6b9a-ab616803f39e@gmail.com> <4741bddf-9765-0d94-d0cd-b94e3e4914e1@yandex.ru> <8530cd03-0158-f198-9b14-ade983e1c7f4@gmail.com> <022c0e0a-e039-24ef-66ff-82bcedbacd93@yandex.ru> <505388da-e642-8c98-35c0-261d09ff13e1@yandex.ru> <1a23269d-1ead-1771-1afd-e2c9c5840cb4@gmail.com> From: Jonathan Ganc Message-ID: <30d8b181-d869-de24-9c86-cc1dc6ec461b@gmail.com> Date: Tue, 11 Apr 2017 09:08:35 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <1a23269d-1ead-1771-1afd-e2c9c5840cb4@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) I think I've changed my mind about where/whether to bind default-directory. Since it is not universally bound by all vcs engines, it should probably be considered "backend specific", which would therefore suggest that it not be bound before the backend specific functions, e.g. vc-git-state. On the other hand, since it sometimes is necessary for correct output, I do think it should be bound in vc-git-state. On 04/10/2017 11:52 PM, Jonathan Ganc wrote: > > The binding affects the output if default-directory is not set inside > the file's repository. > > Since, in principle, the vc functions should be agnostic to the choice > of vcs, either a) vc-state documentation should state that > default-directory should be set to get generally correct responses or > b) it should be set in some function (and I agree that > vc-state-refresh makes sense). > > I think the overhead of setting the directory is rather low. In some > admittedly rudimentary benchmarks, there is almost no difference in > performance setting default-directory. > > There's also the question of how to handle default-directory. You > cannot simply do (file-name-directory file), because that fails if > FILE is given without a directory. I think the correct one is > (file-name-directory (expand-file-name file)) (which, surprisingly, is > slighly faster than (file-name-directory (concat default-directory > file)) ). From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 Apr 2017 23:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jonathan Ganc , npostavs@users.sourceforge.net, 26066@debbugs.gnu.org, Stefan Monnier Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.14919532722616 (code B ref 26066); Tue, 11 Apr 2017 23:28:01 +0000 Received: (at 26066) by debbugs.gnu.org; 11 Apr 2017 23:27:52 +0000 Received: from localhost ([127.0.0.1]:43443 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cy5CR-0000g8-O7 for submit@debbugs.gnu.org; Tue, 11 Apr 2017 19:27:51 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:34408) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cy5CP-0000ft-Nz for 26066@debbugs.gnu.org; Tue, 11 Apr 2017 19:27:50 -0400 Received: by mail-wm0-f65.google.com with SMTP id x75so3214668wma.1 for <26066@debbugs.gnu.org>; Tue, 11 Apr 2017 16:27:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=tAMvQLwcx5HSSnGPB4F3Fni9ftNCGaXX7GsYOTFUJAU=; b=EwzLrCSLfqJORcuuH6ZVxwYfN8lHB05OuklQlgQAoo00FzyzUC+FozVss5HHQ6KW8S m0OkN/Er99etgF08FLOgzuEsPm+/FBrBWZvPN4veaqCIZHb1C0pBncR9I2xWrOgXa/mo JEtyxruG4lgr1v6Az1jJ/N9zWuDu9Q21VeazetLUFl7T8bWc+V6YUPRJzYk1XHbquWyb 77XCYXs3HJ1sSjRqBFUtgqv2yCtOGW02e6labeNnFdjBuhNXmjDBgbDAWMgVa6+IdapG me55qAHU16jRFEtX1/ZgQXUK7AcBhCH/7YjauC+dBJvII5ElhpW3ahngkCIilWAtu0V9 0e6w== 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:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=tAMvQLwcx5HSSnGPB4F3Fni9ftNCGaXX7GsYOTFUJAU=; b=ezx92R4jXApBZ6O55LDmMsIl4gyqpAx7ABrhflPa3N0lNKKCTLm79na8XlbfofDogB Or5xrtQwkxBf1WCAocbeR2eWao2PoxmRKyRjCkhrU3W5lB9y0sfc47muacXwJKNOzcEJ N+muO6UfNwqhC2pFmJsSxNv+lj6TH0OCC2EFV84ZvLwul38B+jp7Kb/bzOHl1YGbEY7+ F89ep9mappzzzRp+bbVLjM4ETOT4pittkhpRTljxf3cnRj7Jt5c3mz5Q52++nObbuvWh Nhj7I94UNiWYB4MBwvFmx6itmrq5uWCEgE8RewVceTiOQNkv6uAQDZpqjwlPH7c7ZauE S3KA== X-Gm-Message-State: AN3rC/4snvFcDdFXUYFaZ9v6ijBpqB6WXVDMTxhzO5bh2iXeWxV1ZDKg CT+v6xcOZly15Q== X-Received: by 10.28.143.71 with SMTP id r68mr17826807wmd.61.1491953263887; Tue, 11 Apr 2017 16:27:43 -0700 (PDT) Received: from [192.168.1.3] ([185.105.173.156]) by smtp.googlemail.com with ESMTPSA id 204sm4298272wmw.0.2017.04.11.16.27.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Apr 2017 16:27:42 -0700 (PDT) References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <87efxy59wx.fsf@users.sourceforge.net> <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> <29d4a5ae-0ca0-3a86-6b9a-ab616803f39e@gmail.com> <4741bddf-9765-0d94-d0cd-b94e3e4914e1@yandex.ru> <8530cd03-0158-f198-9b14-ade983e1c7f4@gmail.com> <022c0e0a-e039-24ef-66ff-82bcedbacd93@yandex.ru> <505388da-e642-8c98-35c0-261d09ff13e1@yandex.ru> <1a23269d-1ead-1771-1afd-e2c9c5840cb4@gmail.com> <30d8b181-d869-de24-9c86-cc1dc6ec461b@gmail.com> From: Dmitry Gutov Message-ID: <6ea0d89d-1a24-30fe-dd9a-26a0157a4eae@yandex.ru> Date: Wed, 12 Apr 2017 02:27:41 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: <30d8b181-d869-de24-9c86-cc1dc6ec461b@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) On 11.04.2017 16:08, Jonathan Ganc wrote: > I think I've changed my mind about where/whether to bind > default-directory. Since it is not universally bound by all vcs engines, That doesn't necessarily imply that they shouldn't. > On the other hand, since it sometimes is > necessary for correct output, I do think it should be bound in > vc-git-state. Is it necessary for correct output in other backends, in similar scenarios? I agree that fixing this makes sense, but it should be done in an organized fashion, and separately from this patch. If vc-git supports calling vc-git-state from outside of the repository, but not some other commands, or if vc-git-state does but some other backends' vc-xx-state does not, this will increase inconsistency and make it harder for the programmers to write VCS-agnostic code, which is one of the main goals of VC. vc-state is also among the first functions a piece of third-party code would call. So it becomes the choke point which forces the caller to get the value of default-directory right, before any other backend commands are called. Until we take inventory of them, it's better to keep the bug in vc-state, I think. >> Since, in principle, the vc functions should be agnostic to the choice >> of vcs, either a) vc-state documentation should state that >> default-directory should be set to get generally correct responses or If we decide that, that should be the rule we declare for all VC backend commands, not just vc-state. >> b) it should be set in some function (and I agree that >> vc-state-refresh makes sense). >> >> I think the overhead of setting the directory is rather low. In some >> admittedly rudimentary benchmarks, there is almost no difference in >> performance setting default-directory. Yeah, I'm not worried about performance here either. >> There's also the question of how to handle default-directory. You >> cannot simply do (file-name-directory file), because that fails if >> FILE is given without a directory. I think the correct one is >> (file-name-directory (expand-file-name file)) Yup, that should work. I'm not sure any of these commands are ever called with relative names, though. > (which, surprisingly, is >> slighly faster than (file-name-directory (concat default-directory >> file)) ). That probably depends on the file. The first option was faster in the example I've tried. From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 Apr 2017 23:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jonathan Ganc , npostavs@users.sourceforge.net, 26066@debbugs.gnu.org, Stefan Monnier Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.14919537893449 (code B ref 26066); Tue, 11 Apr 2017 23:37:01 +0000 Received: (at 26066) by debbugs.gnu.org; 11 Apr 2017 23:36:29 +0000 Received: from localhost ([127.0.0.1]:43448 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cy5Kn-0000tZ-Ju for submit@debbugs.gnu.org; Tue, 11 Apr 2017 19:36:29 -0400 Received: from mail-wm0-f49.google.com ([74.125.82.49]:36738) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cy5Kl-0000tK-Mt for 26066@debbugs.gnu.org; Tue, 11 Apr 2017 19:36:27 -0400 Received: by mail-wm0-f49.google.com with SMTP id o81so74892978wmb.1 for <26066@debbugs.gnu.org>; Tue, 11 Apr 2017 16:36:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:from:to:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=j9+wvAbJzW1ZRaK3YcDL9XA8pl+mxCYCMfd7JTF8Df8=; b=QjCuEYsgeqJFSQfOJdq2F8FyzcxdYm6GB0qjGycATIqqKgv62mAE/qIllHZBZa7dko lwY6PFQlNSSmwVm/KTXZ/mTtk8f3jPzW0uw1LTuIf/qQHZ4yMN3+r/0HkCUjklJRXZN2 red+fnMTsnLt57WGso7TiPfMKxhLKLMcieYl9VTkolAthFREn9PBL3q1sSyDRDiBmtKO GeJHlpQ9TeHU5JJ8ZTjjIPCbvEUt4Tb4T68eQU9/Y6I7gQmPix3o+Q3tSgzpHQv+ZWy8 miSRMM7G+QM/Js4czU+A8qmvXNoQBoAWbuYwi5euTpRm3DIMSIcXcP+ttfupZzJqdZQ3 GzRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:from:to:references:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=j9+wvAbJzW1ZRaK3YcDL9XA8pl+mxCYCMfd7JTF8Df8=; b=MyUslLmA6sDtumvAsx6TKft1vaR2rmKD1BbFqNxszIYOA0Eak0+WoJolA8DTby4eT6 6OIekh8RaIyjOnaqi018T51V2HUHedp9k+4LAYZqger1bRDxahrKQn0kTXfpJiybqjeP u/jOECkUazEWliXgg2IJLnerR8KJ16julh5ubXRsgOqNwsKNw9G91kfaPf+ug751bzt4 w8GZFCax9Al4xc+gTugaUC1w13I2fUjv4fENTBfBVcj7rvepjeQh6kF7wKWDqLfqYK5h ZV8Tfo0U3Vb17TLacSQIFI3tIapAn3fggfJvsOuCjxLRlRIbegcfc2W2G845Wks6ao7r WYyQ== X-Gm-Message-State: AN3rC/7Ho0yibQFINaivKs+3TyaICVeHqhZHrt6Gs1m6zeWrOAyKe3iJw8atI4kAm7uNYw== X-Received: by 10.28.184.73 with SMTP id i70mr139218wmf.104.1491953782092; Tue, 11 Apr 2017 16:36:22 -0700 (PDT) Received: from [192.168.1.3] ([185.105.173.156]) by smtp.googlemail.com with ESMTPSA id 92sm23451631wrh.8.2017.04.11.16.36.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Apr 2017 16:36:21 -0700 (PDT) From: Dmitry Gutov References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <87efxy59wx.fsf@users.sourceforge.net> <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> <29d4a5ae-0ca0-3a86-6b9a-ab616803f39e@gmail.com> <4741bddf-9765-0d94-d0cd-b94e3e4914e1@yandex.ru> <8530cd03-0158-f198-9b14-ade983e1c7f4@gmail.com> <022c0e0a-e039-24ef-66ff-82bcedbacd93@yandex.ru> <505388da-e642-8c98-35c0-261d09ff13e1@yandex.ru> <1a23269d-1ead-1771-1afd-e2c9c5840cb4@gmail.com> <30d8b181-d869-de24-9c86-cc1dc6ec461b@gmail.com> <6ea0d89d-1a24-30fe-dd9a-26a0157a4eae@yandex.ru> Message-ID: <7ba3bbb3-389a-ccf0-a9d1-baf25489c8af@yandex.ru> Date: Wed, 12 Apr 2017 02:36:19 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: <6ea0d89d-1a24-30fe-dd9a-26a0157a4eae@yandex.ru> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.2 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.2 (/) On 12.04.2017 02:27, Dmitry Gutov wrote: >> (which, surprisingly, is >>> slighly faster than (file-name-directory (concat default-directory >>> file)) ). > > That probably depends on the file. The first option was faster in the > example I've tried. I meant the second one, sorry. From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Resent-From: Jonathan Ganc Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 14 Apr 2017 00:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dmitry Gutov , npostavs@users.sourceforge.net, 26066@debbugs.gnu.org, Stefan Monnier Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.149213057217061 (code B ref 26066); Fri, 14 Apr 2017 00:43:02 +0000 Received: (at 26066) by debbugs.gnu.org; 14 Apr 2017 00:42:52 +0000 Received: from localhost ([127.0.0.1]:46273 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cypK8-0004R7-2K for submit@debbugs.gnu.org; Thu, 13 Apr 2017 20:42:52 -0400 Received: from mail-qk0-f193.google.com ([209.85.220.193]:36195) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cypK6-0004Qq-9a for 26066@debbugs.gnu.org; Thu, 13 Apr 2017 20:42:50 -0400 Received: by mail-qk0-f193.google.com with SMTP id v75so10463120qkb.3 for <26066@debbugs.gnu.org>; Thu, 13 Apr 2017 17:42:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to; bh=gArGKLOFfqUpVCwe/RATs00xg363sv5DrJ4x3LzXW6Q=; b=Jqq0HjHvRrvM4Jnl1X+6Yj2Uue7BGX8TExbsl5xAqv/piPhV9zx3lzPIhshwYfW0mX nFopQmlHq0CH3FT5gYQmqKEnoDiz6lrkn0vZMo5coXsMVI7NMLQ51AenvHB1aQP9sylo MUsksJ5aKbPQamur6xGYwFlIPT2r7gQLXUBgpk5Q9cddXCz3nE5AxZIGN64TCDVpfQyw SKArmkKMLk51enoYdnbY+zVtZppF+rJ0lnDuoKui1nmIKiruUgONnpAZMPLT9nZOT1Au CG4O223IlP+OvRDXKrDo6XWpN9EBXcZdhw4HxrGT0xiS5mhZZ4RrWWtzjuSmoLnmXWpZ aEaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to; bh=gArGKLOFfqUpVCwe/RATs00xg363sv5DrJ4x3LzXW6Q=; b=Xlvxczi1WKn4wZWF/ky/GJCk73pmzrmn+7r1xM9PR0LXU6gkq2VdxNHxLvwqNIFZQW LfN9GjhBiJUfIo4wOEVqHqv8BKS/BX2Nz5CiCOoQBDbwCiiGDHl/OMpAg15EJ4qnBxCt JNV1jO0sDDl8DpYrz2bVBM/snoSCgHHzNOEcP1elYDy8N9y9Yzbvk6AWLxho9pn6Vbkq CkknZCF3vCsNQhf09INiPPz5p5vcgLM9+61BEkNynvQ5hUOf52WrakMvMYMKcxPgDR8Y 4OPfuKsy8Q3OcJVt77rXbl3t7KZsPsaPZYqkTcsx4YuuEIgzdZHQCgShpBv59SSMO8Gy ZNJQ== X-Gm-Message-State: AN3rC/7q2rSuB7QcsEOuGCvuyvJNVSVkZ/ZSwa5oHZG6mz4W4Y+EDKyA QG9VZ4EM7NxPBQ== X-Received: by 10.55.15.72 with SMTP id z69mr4643370qkg.69.1492130564624; Thu, 13 Apr 2017 17:42:44 -0700 (PDT) Received: from [192.168.1.200] (static-98-118-34-152.bstnma.fios.verizon.net. [98.118.34.152]) by smtp.gmail.com with ESMTPSA id z42sm272893qtb.26.2017.04.13.17.42.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Apr 2017 17:42:43 -0700 (PDT) References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <87efxy59wx.fsf@users.sourceforge.net> <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> <29d4a5ae-0ca0-3a86-6b9a-ab616803f39e@gmail.com> <4741bddf-9765-0d94-d0cd-b94e3e4914e1@yandex.ru> <8530cd03-0158-f198-9b14-ade983e1c7f4@gmail.com> <022c0e0a-e039-24ef-66ff-82bcedbacd93@yandex.ru> <505388da-e642-8c98-35c0-261d09ff13e1@yandex.ru> <1a23269d-1ead-1771-1afd-e2c9c5840cb4@gmail.com> <30d8b181-d869-de24-9c86-cc1dc6ec461b@gmail.com> <6ea0d89d-1a24-30fe-dd9a-26a0157a4eae@yandex.ru> From: Jonathan Ganc Message-ID: <01922284-4265-6510-feee-dcc7301787ad@gmail.com> Date: Thu, 13 Apr 2017 20:42:42 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <6ea0d89d-1a24-30fe-dd9a-26a0157a4eae@yandex.ru> Content-Type: multipart/mixed; boundary="------------F4169BC3BC0C2094615A5BDE" X-Spam-Score: 0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) This is a multi-part message in MIME format. --------------F4169BC3BC0C2094615A5BDE Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit First, I'm sorry for this delayed response. I've had a busy few days (and I needed to think about the issue)! I'm fine with decoupling the question about default-directory from the patch for git status. I have attached a patch that does not bind default-directory. (And I now have turned in the assignment paperwork to the FSF!). I continue to think that binding default-directory in vc-git-state makes the most sense. > If vc-git supports calling vc-git-state from outside of the > repository, but not some other commands, or if vc-git-state does but > some other backends' vc-xx-state does not, this will increase > inconsistency and make it harder for the programmers to write > VCS-agnostic code, which is one of the main goals of VC. But being vcs-agnostic is more for people who use vc-state or vc-state-refresh, rather than people actually writing the vc-specific functions, no? If this bug is unchanged, people using vc-state have to ask themselves: "if the backend is git, I have to bind default-directory but if it's not, I don't." That is inconsistent with vc agnosticism. > Is it necessary for correct output in other backends, in similar > scenarios? > > I agree that fixing this makes sense, but it should be done in an > organized fashion That's a valid question and a valid point. But I actually think that adding the binding in vc-git-state furthers the goal of systematically answering them. I doubt we'll be able to find, at one time, people with knowledge of more than 4 or 5 of the vc's (e.g. I know only git) who have the time to address this issue. What we can do instead, though, is to encourage people to properly write the backend specific functions. If, at some point, we notice that every vc-BACKEND-state binds default-directory, then we can move the binding to vc-state. However, this question reinforces my opinion that binding default-directory can be treated satisfactorily as a backend-specific question. The fact that I can't argue in general that an arbitrary vc system needs default-directory set suggests to me that one should leave it to the vc system to decide. For example, I could imagine a backend that wants the current directory to be the root directory of the repository, rather than the directory containing the file. --------------F4169BC3BC0C2094615A5BDE Content-Type: text/x-patch; name="0001-update-vc-git.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-update-vc-git.patch" >From cc492722e9ae974e568a2bf79121dfd8664a766e Mon Sep 17 00:00:00 2001 From: Jonathan Ganc Date: Mon, 10 Apr 2017 00:38:52 -0400 Subject: [PATCH] update vc-git --- lisp/vc/vc-git.el | 78 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 52 insertions(+), 26 deletions(-) diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 1a3f1bf..213bdaa 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -231,34 +231,60 @@ (defun vc-git--state-code (code) (?U 'edited) ;; FIXME (?T 'edited))) ;; FIXME +(defun vc-git--git-status-to-vc-state (code-list) + "Convert a list CODE-LIST of two-letter git status strings to a vc status. + +Each element of CODE-LIST comes from the first two characters of +a line returned by 'git status' and should be passed in the order given by 'git status'. + +\(It is necessary to allow CODE-LIST to be a list because +sometimes git status returns multiple lines, e.g. for a file that +is removed from the index but is present in the HEAD and working +tree.) " + (pcase code-list + ('nil 'up-to-date) + (`(,code) + (pcase code + ("!!" 'ignored) + ("??" 'unregistered) + ;; I have only seen this with a file that is only present in the + ;; index. Let us call this `removed' + ("AD" 'removed) + (_ (cond + ((string-match-p "^[ RD]+$" code) 'removed) + ((string-match-p "^[ M]+$" code) 'edited) + ((string-match-p "^[ A]+$" code) 'added) + ((string-match-p "^[ U]+$" code) 'conflict) + (t 'edited))))) + ;; I know of two times when git state returns more than one element, + ;; in both cases returning '("D " "??")': + ;; 1. when a file is removed from the index but present in the + ;; HEAD and working tree + ;; 2. when a file A is renamed to B in the index and then back to A + ;; in the working tree + ;; In both these instances, `unregistered' is a reasonable response. + (`("D " "??") 'unregistered) + ;; In other cases, let us return `edited'. + (_ 'edited))) + (defun vc-git-state (file) "Git-specific version of `vc-state'." - ;; FIXME: This can't set 'ignored or 'conflict yet - ;; The 'ignored state could be detected with `git ls-files -i -o - ;; --exclude-standard` It also can't set 'needs-update or - ;; 'needs-merge. The rough equivalent would be that upstream branch - ;; for current branch is in fast-forward state i.e. current branch - ;; is direct ancestor of corresponding upstream branch, and the file - ;; was modified upstream. But we can't check that without a network - ;; operation. - ;; This assumes that status is known to be not `unregistered' because - ;; we've been successfully dispatched here from `vc-state', that - ;; means `vc-git-registered' returned t earlier once. Bug#11757 - (let ((diff (vc-git--run-command-string - file "diff-index" "-p" "--raw" "-z" "HEAD" "--"))) - (if (and diff - (string-match ":[0-7]\\{6\\} [0-7]\\{6\\} [0-9a-f]\\{40\\} [0-9a-f]\\{40\\} \\([ADMUT]\\)\0[^\0]+\0\\(.*\n.\\)?" - diff)) - (let ((diff-letter (match-string 1 diff))) - (if (not (match-beginning 2)) - ;; Empty diff: file contents is the same as the HEAD - ;; revision, but timestamps are different (eg, file - ;; was "touch"ed). Update timestamp in index: - (prog1 'up-to-date - (vc-git--call nil "add" "--refresh" "--" - (file-relative-name file))) - (vc-git--state-code diff-letter))) - (if (vc-git--empty-db-p) 'added 'up-to-date)))) + (let ((status + (vc-git--run-command-string file "status" "--porcelain" "-z" + "--untracked-files" "--ignored" "--")) + code-list) + (if (null status) + ;; If status is nil, there was an error running git, likely because + ;; the file is not in a git repo. + 'unregistered + ;; If this code is adapted to parse 'git status' for a directory, + ;; note that a renamed file takes up two null values and needs to be + ;; treated slightly more carefully. + (setq code-list + (mapcar (lambda (s) + (substring s 0 2)) + (delete "" (split-string status "\0")))) + (vc-git--git-status-to-vc-state code-list)))) (defun vc-git-working-revision (_file) "Git-specific version of `vc-working-revision'." -- 2.9.3 --------------F4169BC3BC0C2094615A5BDE-- From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Resent-From: Jonathan Ganc Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 23 Apr 2017 18:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dmitry Gutov , npostavs@users.sourceforge.net, 26066@debbugs.gnu.org, Stefan Monnier Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.14929717296926 (code B ref 26066); Sun, 23 Apr 2017 18:23:01 +0000 Received: (at 26066) by debbugs.gnu.org; 23 Apr 2017 18:22:09 +0000 Received: from localhost ([127.0.0.1]:36734 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d2M9A-0001ne-Uf for submit@debbugs.gnu.org; Sun, 23 Apr 2017 14:22:09 -0400 Received: from mail-qk0-f194.google.com ([209.85.220.194]:33985) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d2M98-0001mt-Lm for 26066@debbugs.gnu.org; Sun, 23 Apr 2017 14:22:06 -0400 Received: by mail-qk0-f194.google.com with SMTP id u75so1117966qka.1 for <26066@debbugs.gnu.org>; Sun, 23 Apr 2017 11:22:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=zej7l5f1ikYCp/pHBDJPvlka5Qqp31ydb8MF5y7gcV8=; b=PCMJIzfcKnOEM1SywyBZ4uMgJnDbLF5pNYG7OB1UsJPS5pGSqNQsWdn5axqkXFnL4M rj1MZ11XutgyZMEvr67C/5CoGa75UgoiArR7PYMq0RBsrOQbSQbf4hxsGcJdPOUCnXAN oj9+m7pavQch1fS1Of8K6WzwzS9Yk2KtzGOxv+360rM2veVDKqyek44SdkK95zMEL19p R35sZAObAuumwYEUtoUA5TstESQHwILv2wkIfU/YxERdNZvdVuFqD1HaLKPAO3rWuWTE 9FxWLJrL2Ic/0fhmSYv+BMmrzreo73XG0Hr14nt8H7ysR4kaRW/mvvCypwzaLV6RSocg MCJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=zej7l5f1ikYCp/pHBDJPvlka5Qqp31ydb8MF5y7gcV8=; b=qtCNr288UM2hUWFaEOsJVvMDnLLtri+4/deR8n9Ecap46oGC58v/o3jnv9UxRfli+/ /cRBmjIP9dCmBNWP+NuHiyw5Cak5R9FpdfixJKywxEK1C4E8zWrLEeSh+MTsFsvwO0Ko ohJNPfNSajhO9YPjGYLiGoA8tUmkB7QtisoLqsMtwtgDKzpae4aG6WdNj4vdt7Ahe2RY 6u864icPr6FOMGcTUp7bCh1Mm4pxHuX8ELcVJHUxXICjh15N0GQctrdPq4ODFc8YXxOP I1ngHd+cG3R8oit29ON5TeaLrfPHNheI7U0m5MOhhInxTqO8VJXn6yVy5YsGyDsEqZEl 0KeQ== X-Gm-Message-State: AN3rC/5AyHBKWGzY9aS15FtZpNkHUaA7vv6no7EHgqnMe6jKQENHsx5W 3wllhy+hY7lNyQ== X-Received: by 10.55.65.65 with SMTP id o62mr24209388qka.52.1492971721129; Sun, 23 Apr 2017 11:22:01 -0700 (PDT) Received: from [10.148.5.39] (c-65-96-175-120.hsd1.ma.comcast.net. [65.96.175.120]) by smtp.gmail.com with ESMTPSA id l10sm7383164qte.15.2017.04.23.11.21.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 23 Apr 2017 11:22:00 -0700 (PDT) References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <87efxy59wx.fsf@users.sourceforge.net> <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> <29d4a5ae-0ca0-3a86-6b9a-ab616803f39e@gmail.com> <4741bddf-9765-0d94-d0cd-b94e3e4914e1@yandex.ru> <8530cd03-0158-f198-9b14-ade983e1c7f4@gmail.com> <022c0e0a-e039-24ef-66ff-82bcedbacd93@yandex.ru> <505388da-e642-8c98-35c0-261d09ff13e1@yandex.ru> <1a23269d-1ead-1771-1afd-e2c9c5840cb4@gmail.com> <30d8b181-d869-de24-9c86-cc1dc6ec461b@gmail.com> <6ea0d89d-1a24-30fe-dd9a-26a0157a4eae@yandex.ru> <01922284-4265-6510-feee-dcc7301787ad@gmail.com> From: Jonathan Ganc Message-ID: Date: Sun, 23 Apr 2017 14:21:59 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <01922284-4265-6510-feee-dcc7301787ad@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) Since there have been no more objections to my patch (the one in my previous note does not bind default-directory), could someone merge it in? From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 23 Apr 2017 22:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jonathan Ganc Cc: 26066@debbugs.gnu.org, Stefan Monnier , Dmitry Gutov Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.149298649331918 (code B ref 26066); Sun, 23 Apr 2017 22:29:02 +0000 Received: (at 26066) by debbugs.gnu.org; 23 Apr 2017 22:28:13 +0000 Received: from localhost ([127.0.0.1]:36880 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d2PzJ-0008Ik-82 for submit@debbugs.gnu.org; Sun, 23 Apr 2017 18:28:13 -0400 Received: from mail-io0-f171.google.com ([209.85.223.171]:34132) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d2PzH-0008IS-4v for 26066@debbugs.gnu.org; Sun, 23 Apr 2017 18:28:11 -0400 Received: by mail-io0-f171.google.com with SMTP id a103so167415241ioj.1 for <26066@debbugs.gnu.org>; Sun, 23 Apr 2017 15:28:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=eYT/mLbIULr/WbCWG0DMoLv/4F4d/gP45vQtpmDO9IE=; b=ZXYfc0svV6AdnaA9WGQt06mKv0FU9mbW3JSC3XgXtcPKr3cjTNvHgRAzj9VKFkTt1p MEVzss9rv0xtQ16oZHrjhsZWHKMoYSC5o5r+S+B3wek8JK+gzS9y1x+6OnXRHvRDHWoL 1tKjYKbtFvIQ3T8Em/YETeMK/T3Y0NfmbuUsQ0vNgs+/BMItxcf3MeZ7kCJ/uiWp+6km DrIchD7MHtqgc3Ybe89Rnrc+34tFA7QVX57fMqgyxsqRthVRR2a6zxn+lYRSEuGh6zb/ b+zZFvOGvzFVi9DorulZSHZqIxiViXStPNITT6DfaEEr1UOxm4sDLL8eH4Qd9bcq+sDY msKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=eYT/mLbIULr/WbCWG0DMoLv/4F4d/gP45vQtpmDO9IE=; b=U7XhLn231YEB+29BB6lLn1ru5r+zq2ovUg30f8hlW9mAykgoVwP5EbgH6wFzwa6Wta 3V8NuG09/KwH5FffAQ3bEhgN5HnfNvqJ7Ljk3CVWIsAID+hbf0gsFAoMmM2EO5Zminr5 ynconGSKzrMs0Xxn2q9wfQnuqmBjZaRayOr8r0H7cG2yeWshOWyD8XLhLGeW+/7J4nch DRmpqQ9dhxX/krgDr0WgSiTy4d4vz/gazIhpDKIqT1KVrofz4+/NNLlu8PFcUCs7aZ9C qJPrWt499HfGfewzQ0ZNVUlCq3bs+DDiMMNSZWb63zqBndQlqrLVRb8NhaLtBQhWh4a/ QvWQ== X-Gm-Message-State: AN3rC/6mYYX2souDG6MssNZWpZLj6ozi+jvukVYIDfkwTQ5WdXDodA3r F4N5UxMyv4ojdULUI7NpModwpDN3qg== X-Received: by 10.157.48.120 with SMTP id w53mr10632243otd.55.1492986485441; Sun, 23 Apr 2017 15:28:05 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.9.178 with HTTP; Sun, 23 Apr 2017 15:28:04 -0700 (PDT) In-Reply-To: References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <87efxy59wx.fsf@users.sourceforge.net> <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> <29d4a5ae-0ca0-3a86-6b9a-ab616803f39e@gmail.com> <4741bddf-9765-0d94-d0cd-b94e3e4914e1@yandex.ru> <8530cd03-0158-f198-9b14-ade983e1c7f4@gmail.com> <022c0e0a-e039-24ef-66ff-82bcedbacd93@yandex.ru> <505388da-e642-8c98-35c0-261d09ff13e1@yandex.ru> <1a23269d-1ead-1771-1afd-e2c9c5840cb4@gmail.com> <30d8b181-d869-de24-9c86-cc1dc6ec461b@gmail.com> <6ea0d89d-1a24-30fe-dd9a-26a0157a4eae@yandex.ru> <01922284-4265-6510-feee-dcc7301787ad@gmail.com> From: Noam Postavsky Date: Sun, 23 Apr 2017 18:28:04 -0400 X-Google-Sender-Auth: jkkCn7X3ISGfcB-tkVz6xzTeS0M Message-ID: Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -2.1 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) > Subject: [PATCH] update vc-git > > --- Could you add a meaningful commit message please? See CONTRIBUTE (under "Commit messages") for details of Emacs' standard format. I think the patch is basically okay now, just a few minor nitpicks below. > +(defun vc-git--git-status-to-vc-state (code-list) > + "Convert a list CODE-LIST of two-letter git status strings to a vc status. This line is too long, I think it should be fine to shorten to just "Convert CODE-LIST to a vc status". You explain the format of CODE-LIST in the next paragraph anyway. > +Each element of CODE-LIST comes from the first two characters of > +a line returned by 'git status' and should be passed in the order given by 'git status'. This paragraph looks unfilled, hit M-q on it. > + ;; I have only seen this with a file that is only present in the > + ;; index. Let us call this `removed' Missing period. > + (setq code-list > + (mapcar (lambda (s) > + (substring s 0 2)) > + (delete "" (split-string status "\0")))) If you pass a non-nil OMIT-NULLS parameter to split-string, the (delete ""...) should become unnecessary. > + (vc-git--git-status-to-vc-state code-list)))) I would suggest dropping the temporary code-list variable here, and just do (vc-git--git-status-to-vc-state (mapcar (lambda (s) (substring s 0 2)) (split-string status "\0" t))) From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 23 Apr 2017 22:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Noam Postavsky Cc: Jonathan Ganc , 26066@debbugs.gnu.org, Dmitry Gutov Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.14929875272085 (code B ref 26066); Sun, 23 Apr 2017 22:46:01 +0000 Received: (at 26066) by debbugs.gnu.org; 23 Apr 2017 22:45:27 +0000 Received: from localhost ([127.0.0.1]:36894 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d2QFz-0000XX-IF for submit@debbugs.gnu.org; Sun, 23 Apr 2017 18:45:27 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:52483) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d2QFx-0000X9-Gq for 26066@debbugs.gnu.org; Sun, 23 Apr 2017 18:45:26 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0DXHQA+Lf1Y//TvSC1cHAEBBAEBCgEBg1SFBoVZhX2RHAGXSRyGAgQCAoQLRRMBAgEBAQEBAQFrKIUWBlYjEAsOJhIUGA0kii+uCosTAQEBAQEFAiaIMIMZijwBBJ1BlG4BiHyGcpQZNyCBBiYdCC2HSCSJawEBAQ X-IPAS-Result: A0DXHQA+Lf1Y//TvSC1cHAEBBAEBCgEBg1SFBoVZhX2RHAGXSRyGAgQCAoQLRRMBAgEBAQEBAQFrKIUWBlYjEAsOJhIUGA0kii+uCosTAQEBAQEFAiaIMIMZijwBBJ1BlG4BiHyGcpQZNyCBBiYdCC2HSCSJawEBAQ X-IronPort-AV: E=Sophos;i="5.37,241,1488862800"; d="scan'208";a="309110755" Received: from 45-72-239-244.cpe.teksavvy.com (HELO ceviche.home) ([45.72.239.244]) by smtp.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 23 Apr 2017 18:45:19 -0400 Received: by ceviche.home (Postfix, from userid 20848) id E2B10662F7; Sun, 23 Apr 2017 18:45:18 -0400 (EDT) From: Stefan Monnier Message-ID: References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <87efxy59wx.fsf@users.sourceforge.net> <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> <29d4a5ae-0ca0-3a86-6b9a-ab616803f39e@gmail.com> <4741bddf-9765-0d94-d0cd-b94e3e4914e1@yandex.ru> <8530cd03-0158-f198-9b14-ade983e1c7f4@gmail.com> <022c0e0a-e039-24ef-66ff-82bcedbacd93@yandex.ru> <505388da-e642-8c98-35c0-261d09ff13e1@yandex.ru> <1a23269d-1ead-1771-1afd-e2c9c5840cb4@gmail.com> <30d8b181-d869-de24-9c86-cc1dc6ec461b@gmail.com> <6ea0d89d-1a24-30fe-dd9a-26a0157a4eae@yandex.ru> <01922284-4265-6510-feee-dcc7301787ad@gmail.com> Date: Sun, 23 Apr 2017 18:45:18 -0400 In-Reply-To: (Noam Postavsky's message of "Sun, 23 Apr 2017 18:28:04 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) >> + (delete "" (split-string status "\0")))) > If you pass a non-nil OMIT-NULLS parameter to split-string, the > (delete ""...) should become unnecessary. Or use "\0+". Stefan From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Resent-From: Jonathan Ganc Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Apr 2017 00:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Noam Postavsky Cc: 26066@debbugs.gnu.org, Stefan Monnier , Dmitry Gutov Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.149299504922355 (code B ref 26066); Mon, 24 Apr 2017 00:51:02 +0000 Received: (at 26066) by debbugs.gnu.org; 24 Apr 2017 00:50:49 +0000 Received: from localhost ([127.0.0.1]:36947 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d2SDJ-0005oV-Cp for submit@debbugs.gnu.org; Sun, 23 Apr 2017 20:50:49 -0400 Received: from mail-qt0-f193.google.com ([209.85.216.193]:36068) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d2SDH-0005o5-9l for 26066@debbugs.gnu.org; Sun, 23 Apr 2017 20:50:47 -0400 Received: by mail-qt0-f193.google.com with SMTP id t52so18485793qtb.3 for <26066@debbugs.gnu.org>; Sun, 23 Apr 2017 17:50:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to; bh=MUGWZEyZo3sYXKm3JYsOMTc3nSv/J37hwCtHzRKDizo=; b=AwBAInjIvT48/exqeEkDKCuGBPdTgXJetGQrBjZ+sBu+hYx/kQ52LyjfA5ObkgOfgV W5OVL1fi3Im8J39ocH1Tbxh2qteU4vJUAsEQL0IDRWD42aZ67ppVikMfHdXWxhL3MWXb YJshHl9QAzHmJWbZVBTzxmncjw/0VMyONz2OJhD9xwLWJ66oNTGjJW5CLioOHElaG9b/ dBV93us5nU8KJSRnM5yFyoGYjCZbc0GWMaoao3hY8NbkF575aX7YwsF/zm4OUv7NUOZ7 eeJl75UnNrZF1rO4HVNyUoBLBLRe3hhFtHeTA1z8Z4WWBOB83OcqTrOtYaxX4TMU4jLc yEVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to; bh=MUGWZEyZo3sYXKm3JYsOMTc3nSv/J37hwCtHzRKDizo=; b=DPnPdKwm+1ZtNbdm7DDo52dd4ZPC7LkYAw2ElSL2BMqbQmJE6YzcSzKXtPqKvzaIkn 1EKnaHYpOwQkTRw3iK9n3mlqV7d/Ivg0JpggFNQNrpDax56bK/kV8At8QsEe0uHwBuok sA4BFGM+U67UoU2XjEdvVoBv6cKu5XV/QzZ4V0gxTHZ6T7b1d/ilH/8gF/VeS2lU5s3f rJudk76bSPrSZc2lYqNFjP7aqk1N/sh07N3I5ieoiA18cLS2VBCUOcgM2vxEfDvvIqON 2kgu/QxwHGsESFxaY2+JsTyg8IDzD9+NKqNic1MgtNRON0svtAETPETxis5+vf3wjBbV ockA== X-Gm-Message-State: AN3rC/5MTR3drbblERpA9OVIih+1T8SCKQyiGW90+6ASByDuGmAZ4Mg9 pyCds+nDwsym/g== X-Received: by 10.200.44.130 with SMTP id 2mr24795748qtw.59.1492995041420; Sun, 23 Apr 2017 17:50:41 -0700 (PDT) Received: from [192.168.1.198] (static-98-118-34-152.bstnma.fios.verizon.net. [98.118.34.152]) by smtp.gmail.com with ESMTPSA id r46sm11797361qtc.1.2017.04.23.17.50.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 23 Apr 2017 17:50:40 -0700 (PDT) References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <87efxy59wx.fsf@users.sourceforge.net> <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> <29d4a5ae-0ca0-3a86-6b9a-ab616803f39e@gmail.com> <4741bddf-9765-0d94-d0cd-b94e3e4914e1@yandex.ru> <8530cd03-0158-f198-9b14-ade983e1c7f4@gmail.com> <022c0e0a-e039-24ef-66ff-82bcedbacd93@yandex.ru> <505388da-e642-8c98-35c0-261d09ff13e1@yandex.ru> <1a23269d-1ead-1771-1afd-e2c9c5840cb4@gmail.com> <30d8b181-d869-de24-9c86-cc1dc6ec461b@gmail.com> <6ea0d89d-1a24-30fe-dd9a-26a0157a4eae@yandex.ru> <01922284-4265-6510-feee-dcc7301787ad@gmail.com> From: Jonathan Ganc Message-ID: <7346fb37-f0b2-77dc-c227-cacfbd372775@gmail.com> Date: Sun, 23 Apr 2017 20:50:38 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------7303FD8667010B222A562449" X-Spam-Score: 0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) This is a multi-part message in MIME format. --------------7303FD8667010B222A562449 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Thanks for the feedback! Updated with the suggested changes. On 04/23/2017 06:28 PM, Noam Postavsky wrote: >> Subject: [PATCH] update vc-git >> >> --- > Could you add a meaningful commit message please? See CONTRIBUTE (under > "Commit messages") for details of Emacs' standard format. > > I think the patch is basically okay now, just a few minor nitpicks below. > >> +(defun vc-git--git-status-to-vc-state (code-list) >> + "Convert a list CODE-LIST of two-letter git status strings to a vc status. > This line is too long, I think it should be fine to shorten to just > "Convert CODE-LIST to a vc status". You explain the format of > CODE-LIST in the next paragraph anyway. > >> +Each element of CODE-LIST comes from the first two characters of >> +a line returned by 'git status' and should be passed in the order given by 'git status'. > This paragraph looks unfilled, hit M-q on it. > >> + ;; I have only seen this with a file that is only present in the >> + ;; index. Let us call this `removed' > Missing period. > >> + (setq code-list >> + (mapcar (lambda (s) >> + (substring s 0 2)) >> + (delete "" (split-string status "\0")))) > If you pass a non-nil OMIT-NULLS parameter to split-string, the > (delete ""...) should become unnecessary. > >> + (vc-git--git-status-to-vc-state code-list)))) > I would suggest dropping the temporary code-list variable here, and > just do > > (vc-git--git-status-to-vc-state > (mapcar (lambda (s) (substring s 0 2)) > (split-string status "\0" t))) --------------7303FD8667010B222A562449 Content-Type: text/x-patch; name="0001-Update-vc-git-state-to-use-git-status.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Update-vc-git-state-to-use-git-status.patch" >From 5c123593c110323edfe357c26ee136de31c14ab8 Mon Sep 17 00:00:00 2001 From: Jonathan Ganc Date: Mon, 10 Apr 2017 00:38:52 -0400 Subject: [PATCH] Update vc-git-state to use 'git status' * lisp/vc/vc-git.el (vc-git-state, vc-git--git-status-to-vc-state): Update 'vc-git-state' to use 'git status', so that 'vc-git-state' can now return 'ignored', 'conflict', or 'unregistered' if appropriate. Related to bug#26066. --- lisp/vc/vc-git.el | 78 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 52 insertions(+), 26 deletions(-) diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 1a3f1bf..9fb35bd 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -231,34 +231,60 @@ (defun vc-git--state-code (code) (?U 'edited) ;; FIXME (?T 'edited))) ;; FIXME +(defun vc-git--git-status-to-vc-state (code-list) + "Convert CODE-LIST to a vc status. + +Each element of CODE-LIST comes from the first two characters of +a line returned by 'git status' and should be passed in the order +given by 'git status'. + +\(It is necessary to allow CODE-LIST to be a list because +sometimes git status returns multiple lines, e.g. for a file that +is removed from the index but is present in the HEAD and working +tree.) " + (pcase code-list + ('nil 'up-to-date) + (`(,code) + (pcase code + ("!!" 'ignored) + ("??" 'unregistered) + ;; I have only seen this with a file that is only present in the + ;; index. Let us call this `removed'. + ("AD" 'removed) + (_ (cond + ((string-match-p "^[ RD]+$" code) 'removed) + ((string-match-p "^[ M]+$" code) 'edited) + ((string-match-p "^[ A]+$" code) 'added) + ((string-match-p "^[ U]+$" code) 'conflict) + (t 'edited))))) + ;; I know of two times when git state returns more than one element, + ;; in both cases returning '("D " "??")': + ;; 1. when a file is removed from the index but present in the + ;; HEAD and working tree + ;; 2. when a file A is renamed to B in the index and then back to A + ;; in the working tree + ;; In both these instances, `unregistered' is a reasonable response. + (`("D " "??") 'unregistered) + ;; In other cases, let us return `edited'. + (_ 'edited))) + (defun vc-git-state (file) "Git-specific version of `vc-state'." - ;; FIXME: This can't set 'ignored or 'conflict yet - ;; The 'ignored state could be detected with `git ls-files -i -o - ;; --exclude-standard` It also can't set 'needs-update or - ;; 'needs-merge. The rough equivalent would be that upstream branch - ;; for current branch is in fast-forward state i.e. current branch - ;; is direct ancestor of corresponding upstream branch, and the file - ;; was modified upstream. But we can't check that without a network - ;; operation. - ;; This assumes that status is known to be not `unregistered' because - ;; we've been successfully dispatched here from `vc-state', that - ;; means `vc-git-registered' returned t earlier once. Bug#11757 - (let ((diff (vc-git--run-command-string - file "diff-index" "-p" "--raw" "-z" "HEAD" "--"))) - (if (and diff - (string-match ":[0-7]\\{6\\} [0-7]\\{6\\} [0-9a-f]\\{40\\} [0-9a-f]\\{40\\} \\([ADMUT]\\)\0[^\0]+\0\\(.*\n.\\)?" - diff)) - (let ((diff-letter (match-string 1 diff))) - (if (not (match-beginning 2)) - ;; Empty diff: file contents is the same as the HEAD - ;; revision, but timestamps are different (eg, file - ;; was "touch"ed). Update timestamp in index: - (prog1 'up-to-date - (vc-git--call nil "add" "--refresh" "--" - (file-relative-name file))) - (vc-git--state-code diff-letter))) - (if (vc-git--empty-db-p) 'added 'up-to-date)))) + (let ((status + (vc-git--run-command-string file "status" "--porcelain" "-z" + "--untracked-files" "--ignored" "--"))) + (if (null status) + ;; If status is nil, there was an error running git, likely because + ;; the file is not in a git repo. + 'unregistered + ;; If this code is adapted to parse 'git status' for a directory, + ;; note that a renamed file takes up two null values and needs to be + ;; treated slightly more carefully. + (vc-git--git-status-to-vc-state + (mapcar (lambda (s) + (substring s 0 2)) + (split-string status "\0" t)))))) + (defun vc-git-working-revision (_file) "Git-specific version of `vc-working-revision'." -- 2.9.3 --------------7303FD8667010B222A562449-- From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 23 21:15:19 2017 Received: (at control) by debbugs.gnu.org; 24 Apr 2017 01:15:19 +0000 Received: from localhost ([127.0.0.1]:36964 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d2Sb1-0006wZ-Go for submit@debbugs.gnu.org; Sun, 23 Apr 2017 21:15:19 -0400 Received: from mail-it0-f45.google.com ([209.85.214.45]:33482) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d2Saz-0006wA-KR for control@debbugs.gnu.org; Sun, 23 Apr 2017 21:15:17 -0400 Received: by mail-it0-f45.google.com with SMTP id 70so9589573ita.0 for ; Sun, 23 Apr 2017 18:15:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:mime-version; bh=EG+2HpfsRA6saiuV/8Qv9GH+h9mbaKePDVo1RfaXwnU=; b=hC+QyhMJ/KXMh7a6kHKrkhR7EBCrPiX+keNKOp1PKLSHD8Wh1EiFWjM+9TyJ3dPmKA Z4rBUYGG3dGqKjakbxcV5YouSZoNzvpvDCIiA6Oxq6dbBl3Ic2Gi7SI4G6CIemjEAVal Mpjs0YDkOfqIaWJiKh929CauNgRChT20j9iosaEK80cFtEsFxZynnPJQtFNneyIbXbf3 V10OMJl0BqG64JDrtSb2YsAF0G2CyOm7mkUjogBxWDwCMKt7z4fpTOLJsj4A93LkWLVu e6pUpKi6lF5qr72uWbzOf3dJPD6z/XMF6wooEWke9YzKvGUgg/4+xBYkM+CH2Hvl8cFm HGoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :mime-version; bh=EG+2HpfsRA6saiuV/8Qv9GH+h9mbaKePDVo1RfaXwnU=; b=QJ9wp6Ep7w82FnXc/UqYMmEp+V5lkiszrXDeytOYfLmW+SQBqJH5Il8/+3S2d+Y3ZY v7hIgRwUIJ6ukiJOPoBvggF213XWQRxoRL5fQpx5FzP9pOlLhE9BZGz7RyPgX195xnjF YhSdiXqJ8zF+WahmfFcbTHAb7/hD/RnDpsP+qZL/UF9uhrEV8jQiuDErCLz2CJdAkeOf S7SAMrm5DetdMHGo4RezFvuU/ZUqJdswD4SyUNBwu1hERjX8/IzB/KtFyc+TD4+AJMSE qhFKyPWrVgImkk81CFlw3jwLhF+akZQBupId7ope7AqRUFyKOy/wLbbawRMWcwMMWacR GgwA== X-Gm-Message-State: AN3rC/4zzUS3cx7Itg/d6NegR+D6FyfYiP3KMIEroWXG4pes8kzmVIbL DbrYaDfQbLg0vgEk X-Received: by 10.36.51.18 with SMTP id k18mr10821737itk.41.1492996511929; Sun, 23 Apr 2017 18:15:11 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id 204sm3718577itz.29.2017.04.23.18.15.10 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 23 Apr 2017 18:15:10 -0700 (PDT) From: npostavs@users.sourceforge.net To: control@debbugs.gnu.org Subject: control message for bug #26066 Date: Sun, 23 Apr 2017 21:16:40 -0400 Message-ID: <8760hupptz.fsf@users.sourceforge.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) tags 26066 patch quit From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Resent-From: Andreas Schwab Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Apr 2017 09:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Jonathan Ganc Cc: 26066@debbugs.gnu.org, Dmitry Gutov , Stefan Monnier , Noam Postavsky Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.149302566516106 (code B ref 26066); Mon, 24 Apr 2017 09:22:01 +0000 Received: (at 26066) by debbugs.gnu.org; 24 Apr 2017 09:21:05 +0000 Received: from localhost ([127.0.0.1]:37092 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d2aB7-0004Bh-C0 for submit@debbugs.gnu.org; Mon, 24 Apr 2017 05:21:05 -0400 Received: from mail-out.m-online.net ([212.18.0.9]:52251) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d2aB5-0004BI-Fx for 26066@debbugs.gnu.org; Mon, 24 Apr 2017 05:21:04 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 3wBLRv62Pcz1qqkV; Mon, 24 Apr 2017 11:20:59 +0200 (CEST) Received: from localhost (dynscan01.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 3wBLRv3kQCz3jgY2; Mon, 24 Apr 2017 11:20:59 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan01.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id cVx5o16Qs9RW; Mon, 24 Apr 2017 11:20:58 +0200 (CEST) X-Auth-Info: F7H3AtClu9XBpqgURNaa2UgeFfGcU5jw+Vo5HsGQ/nwLg/I+YSVatN6YzX8uh/OL Received: from igel.home (ppp-88-217-7-231.dynamic.mnet-online.de [88.217.7.231]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Mon, 24 Apr 2017 11:20:58 +0200 (CEST) Received: by igel.home (Postfix, from userid 1000) id D020B2C428F; Mon, 24 Apr 2017 11:20:57 +0200 (CEST) From: Andreas Schwab References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <87efxy59wx.fsf@users.sourceforge.net> <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> <29d4a5ae-0ca0-3a86-6b9a-ab616803f39e@gmail.com> <4741bddf-9765-0d94-d0cd-b94e3e4914e1@yandex.ru> <8530cd03-0158-f198-9b14-ade983e1c7f4@gmail.com> <022c0e0a-e039-24ef-66ff-82bcedbacd93@yandex.ru> <505388da-e642-8c98-35c0-261d09ff13e1@yandex.ru> <1a23269d-1ead-1771-1afd-e2c9c5840cb4@gmail.com> <30d8b181-d869-de24-9c86-cc1dc6ec461b@gmail.com> <6ea0d89d-1a24-30fe-dd9a-26a0157a4eae@yandex.ru> <01922284-4265-6510-feee-dcc7301787ad@gmail.com> <7346fb37-f0b2-77dc-c227-cacfbd372775@gmail.com> X-Yow: I just had my entire INTESTINAL TRACT coated with TEFLON! Date: Mon, 24 Apr 2017 11:20:57 +0200 In-Reply-To: <7346fb37-f0b2-77dc-c227-cacfbd372775@gmail.com> (Jonathan Ganc's message of "Sun, 23 Apr 2017 20:50:38 -0400") Message-ID: <874lxef9fq.fsf@linux-m68k.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Apr 23 2017, Jonathan Ganc wrote: > +(defun vc-git--git-status-to-vc-state (code-list) > + "Convert CODE-LIST to a vc status. > + > +Each element of CODE-LIST comes from the first two characters of > +a line returned by 'git status' and should be passed in the order > +given by 'git status'. > + > +\(It is necessary to allow CODE-LIST to be a list because > +sometimes git status returns multiple lines, e.g. for a file that > +is removed from the index but is present in the HEAD and working > +tree.) " I think the last paragraph could just be a code comment, given that you even put it in parens to de-emphasize it. Also, extra space at the end. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Resent-From: Jonathan Ganc Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Apr 2017 15:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Andreas Schwab Cc: 26066@debbugs.gnu.org, Dmitry Gutov , Stefan Monnier , Noam Postavsky Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.14931347284885 (code B ref 26066); Tue, 25 Apr 2017 15:39:02 +0000 Received: (at 26066) by debbugs.gnu.org; 25 Apr 2017 15:38:48 +0000 Received: from localhost ([127.0.0.1]:39943 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d32YC-0001Gj-EN for submit@debbugs.gnu.org; Tue, 25 Apr 2017 11:38:48 -0400 Received: from mail-qk0-f181.google.com ([209.85.220.181]:32861) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d32YA-0001GV-Hz for 26066@debbugs.gnu.org; Tue, 25 Apr 2017 11:38:46 -0400 Received: by mail-qk0-f181.google.com with SMTP id h123so62562596qke.0 for <26066@debbugs.gnu.org>; Tue, 25 Apr 2017 08:38:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to; bh=BwASEmj97Un7+AqzpmBoOzVa1TkQD536ikc3jgAV+0c=; b=i5IY2F57aMI4txFCiB1jW5VNWrhbjjiwoyaZhLGgPMmLpDzQ9CfZOlsykOYucu2clg pS9QehmbCcCFaE/Z7pjnBs63AS7WcaINERq9t//QkVYmhP5Awv+VGBmIfAOqn5buok2t wc/k347G4LJKUYFEdUmTIW9Aq6I5gE6vKj/Cy3Qm/Hse3EbPmW/m3QMm600+J0/i40aY rxJiOrqCc33075URFw4qQx9uFMOTYil/S3OvdGyh/oe9jU0qV7Tm3kBNRBrMXHGCWaFa BJeWnF/QOhPqs1XpzWK/6HBBlCVFoWlx7OF/OilfuYYj5r6bjAYNtANUAvFeg4CJ0P2G dv6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to; bh=BwASEmj97Un7+AqzpmBoOzVa1TkQD536ikc3jgAV+0c=; b=ZhV109ji79Xov32sdufEtSfKS+XysAQ8oRw/FuzNZv5rjQJNH69l4iwVf78waHoE/A fW7Ih+QoS/nevlV7qvN/F8QMrSBTxSZPVzMEogqnKG2Mh2M/EgieE0Ia+vgf/tAM8YTm gZV0ZfJl9fPZawAwi+S5yOIx3D+rD0mn9P4XZFiz1lJ8rtNnbBtBDNnraoGCaAmL9yVf I14Uzw/jHvf0blPJr2T9Z6W2YO6T7I84iZ326FzPNVa/gEbbwXB1uMg9mJmzQxrBLqJA UrdGtxh/9oinGwlMF2/MN5uNtD/RrgPRzlzkC5/RLo2vKOZhL1pMQfh/lpQ0zdgrYELb Rqgw== X-Gm-Message-State: AN3rC/53x2KZsviwX+Lj4awFs6xK+fZEzpRuBI1bggliYqT8AkGQgfHm CZRPdjJ2nxJ4qA== X-Received: by 10.55.148.194 with SMTP id w185mr29085096qkd.58.1493134720925; Tue, 25 Apr 2017 08:38:40 -0700 (PDT) Received: from [10.250.197.77] ([38.122.127.226]) by smtp.gmail.com with ESMTPSA id t45sm13738196qtt.9.2017.04.25.08.38.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Apr 2017 08:38:39 -0700 (PDT) References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <87efxy59wx.fsf@users.sourceforge.net> <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> <29d4a5ae-0ca0-3a86-6b9a-ab616803f39e@gmail.com> <4741bddf-9765-0d94-d0cd-b94e3e4914e1@yandex.ru> <8530cd03-0158-f198-9b14-ade983e1c7f4@gmail.com> <022c0e0a-e039-24ef-66ff-82bcedbacd93@yandex.ru> <505388da-e642-8c98-35c0-261d09ff13e1@yandex.ru> <1a23269d-1ead-1771-1afd-e2c9c5840cb4@gmail.com> <30d8b181-d869-de24-9c86-cc1dc6ec461b@gmail.com> <6ea0d89d-1a24-30fe-dd9a-26a0157a4eae@yandex.ru> <01922284-4265-6510-feee-dcc7301787ad@gmail.com> <7346fb37-f0b2-77dc-c227-cacfbd372775@gmail.com> <874lxef9fq.fsf@linux-m68k.org> From: Jonathan Ganc Message-ID: Date: Tue, 25 Apr 2017 11:38:39 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <874lxef9fq.fsf@linux-m68k.org> Content-Type: multipart/mixed; boundary="------------160953F263EE16EE2334073F" X-Spam-Score: 0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) This is a multi-part message in MIME format. --------------160953F263EE16EE2334073F Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Good point. Changed. On 04/24/2017 05:20 AM, Andreas Schwab wrote: > On Apr 23 2017, Jonathan Ganc wrote: > >> +(defun vc-git--git-status-to-vc-state (code-list) >> + "Convert CODE-LIST to a vc status. >> + >> +Each element of CODE-LIST comes from the first two characters of >> +a line returned by 'git status' and should be passed in the order >> +given by 'git status'. >> + >> +\(It is necessary to allow CODE-LIST to be a list because >> +sometimes git status returns multiple lines, e.g. for a file that >> +is removed from the index but is present in the HEAD and working >> +tree.) " > I think the last paragraph could just be a code comment, given that you > even put it in parens to de-emphasize it. Also, extra space at the end. > > Andreas. > --------------160953F263EE16EE2334073F Content-Type: text/x-patch; name="0001-Update-vc-git-state-to-use-git-status.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Update-vc-git-state-to-use-git-status.patch" >From 6407a6dee770a3981977625c9b0648ca29c4f99c Mon Sep 17 00:00:00 2001 From: Jonathan Ganc Date: Mon, 10 Apr 2017 00:38:52 -0400 Subject: [PATCH] Update vc-git-state to use 'git status' * lisp/vc/vc-git.el (vc-git-state, vc-git--git-status-to-vc-state): Update 'vc-git-state' to use 'git status', so that 'vc-git-state' can now return 'ignored', 'conflict', or 'unregistered' if appropriate. Related to bug#26066. --- lisp/vc/vc-git.el | 76 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 50 insertions(+), 26 deletions(-) diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 1a3f1bf..6604220 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -231,34 +231,58 @@ (defun vc-git--state-code (code) (?U 'edited) ;; FIXME (?T 'edited))) ;; FIXME +(defun vc-git--git-status-to-vc-state (code-list) + "Convert CODE-LIST to a vc status. + +Each element of CODE-LIST comes from the first two characters of +a line returned by 'git status' and should be passed in the order +given by 'git status'." + ;; It is necessary to allow CODE-LIST to be a list because sometimes git + ;; status returns multiple lines, e.g. for a file that is removed from + ;; the index but is present in the HEAD and working tree. + (pcase code-list + ('nil 'up-to-date) + (`(,code) + (pcase code + ("!!" 'ignored) + ("??" 'unregistered) + ;; I have only seen this with a file that is only present in the + ;; index. Let us call this `removed'. + ("AD" 'removed) + (_ (cond + ((string-match-p "^[ RD]+$" code) 'removed) + ((string-match-p "^[ M]+$" code) 'edited) + ((string-match-p "^[ A]+$" code) 'added) + ((string-match-p "^[ U]+$" code) 'conflict) + (t 'edited))))) + ;; I know of two times when git state returns more than one element, + ;; in both cases returning '("D " "??")': + ;; 1. when a file is removed from the index but present in the + ;; HEAD and working tree + ;; 2. when a file A is renamed to B in the index and then back to A + ;; in the working tree + ;; In both these instances, `unregistered' is a reasonable response. + (`("D " "??") 'unregistered) + ;; In other cases, let us return `edited'. + (_ 'edited))) + (defun vc-git-state (file) "Git-specific version of `vc-state'." - ;; FIXME: This can't set 'ignored or 'conflict yet - ;; The 'ignored state could be detected with `git ls-files -i -o - ;; --exclude-standard` It also can't set 'needs-update or - ;; 'needs-merge. The rough equivalent would be that upstream branch - ;; for current branch is in fast-forward state i.e. current branch - ;; is direct ancestor of corresponding upstream branch, and the file - ;; was modified upstream. But we can't check that without a network - ;; operation. - ;; This assumes that status is known to be not `unregistered' because - ;; we've been successfully dispatched here from `vc-state', that - ;; means `vc-git-registered' returned t earlier once. Bug#11757 - (let ((diff (vc-git--run-command-string - file "diff-index" "-p" "--raw" "-z" "HEAD" "--"))) - (if (and diff - (string-match ":[0-7]\\{6\\} [0-7]\\{6\\} [0-9a-f]\\{40\\} [0-9a-f]\\{40\\} \\([ADMUT]\\)\0[^\0]+\0\\(.*\n.\\)?" - diff)) - (let ((diff-letter (match-string 1 diff))) - (if (not (match-beginning 2)) - ;; Empty diff: file contents is the same as the HEAD - ;; revision, but timestamps are different (eg, file - ;; was "touch"ed). Update timestamp in index: - (prog1 'up-to-date - (vc-git--call nil "add" "--refresh" "--" - (file-relative-name file))) - (vc-git--state-code diff-letter))) - (if (vc-git--empty-db-p) 'added 'up-to-date)))) + (let ((status + (vc-git--run-command-string file "status" "--porcelain" "-z" + "--untracked-files" "--ignored" "--"))) + (if (null status) + ;; If status is nil, there was an error running git, likely because + ;; the file is not in a git repo. + 'unregistered + ;; If this code is adapted to parse 'git status' for a directory, + ;; note that a renamed file takes up two null values and needs to be + ;; treated slightly more carefully. + (vc-git--git-status-to-vc-state + (mapcar (lambda (s) + (substring s 0 2)) + (split-string status "\0" t)))))) + (defun vc-git-working-revision (_file) "Git-specific version of `vc-working-revision'." -- 2.9.3 --------------160953F263EE16EE2334073F-- From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Apr 2017 23:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Jonathan Ganc , Andreas Schwab Cc: 26066@debbugs.gnu.org, Stefan Monnier , Noam Postavsky Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.149316417513095 (code B ref 26066); Tue, 25 Apr 2017 23:50:02 +0000 Received: (at 26066) by debbugs.gnu.org; 25 Apr 2017 23:49:35 +0000 Received: from localhost ([127.0.0.1]:40263 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d3AD9-0003P9-9E for submit@debbugs.gnu.org; Tue, 25 Apr 2017 19:49:35 -0400 Received: from mail-wr0-f182.google.com ([209.85.128.182]:34090) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d3AD5-0003Ot-OQ for 26066@debbugs.gnu.org; Tue, 25 Apr 2017 19:49:32 -0400 Received: by mail-wr0-f182.google.com with SMTP id l9so14611166wre.1 for <26066@debbugs.gnu.org>; Tue, 25 Apr 2017 16:49:31 -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=AU1y9ZVUc8is4YhsKpzEbb+eMf222sZXUx2A02QDeB0=; b=fdr/2PTrJwa9H3iwyppyaiqrC3wk15WKQxvHtQaFzKDIPnOAtPLi1qSSfykAy2Untv Ec9tb7jEtaGSke+Hfp7jfHhdE132RN9umfGfk7Bdi8xWbmaa1s469JutaY9YiK2q+4JG 8NX/lq4IVZ68qp5j5SFwshTotHMp0EJTUFEi8G8dfMLypAwe/Bly+FklJ9eq69hI/3G5 TcLtzOeJHrwXE3nT9TP3T6X76CK20c5D+/IYWa2yb9Rr27gP4xP9Tx5vlE7C/cP+hvAK uToptmBjaCkHAvoJENbubswh40CG/wxr/f7Y9Vk8vQWnZ2JdXPP8mMjPs4wgIey2iqOX 3UCA== 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=AU1y9ZVUc8is4YhsKpzEbb+eMf222sZXUx2A02QDeB0=; b=NkyCc9yjCiYhCrBWXsgHqoIisWuFkooSeeFvW9ZpIm3ehhUBx+lnhABveElH1V3ucm mBv7dVwl/odxSpohzfGc3Vd9MlZCxdTbWe4qBFt0+ACMOFpZOlgUwANKR72wHi7ilM6y S0dalii8N1oeWlGlOE+ntFCA9rZkRXcBzbMdFisxzCq61X/fr8sSbeftdHwtp4allBDk duABRTCgxSDg88iIdmxZF50nBJQmsDUG4I75XB/aCw0B4z41iK7y/KOl7kx1BDRN7g27 LEbEY2A6FOCVNUPR9eTTQvu+UfTwen8jyCeSIrPPueWM/YjoSuXd1xDDZOOOLF4Hwrqm whrg== X-Gm-Message-State: AN3rC/71yp4ZV+Vsh4ihGAk+WKG+/llF3yfx+fm0Le5sZFK2B9jOuzbX PsfaJjvdyifxSA== X-Received: by 10.223.131.130 with SMTP id 2mr1396345wre.104.1493164166029; Tue, 25 Apr 2017 16:49:26 -0700 (PDT) Received: from [192.168.1.3] ([185.105.173.156]) by smtp.googlemail.com with ESMTPSA id s137sm4325626wme.31.2017.04.25.16.49.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Apr 2017 16:49:24 -0700 (PDT) References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <87efxy59wx.fsf@users.sourceforge.net> <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> <29d4a5ae-0ca0-3a86-6b9a-ab616803f39e@gmail.com> <4741bddf-9765-0d94-d0cd-b94e3e4914e1@yandex.ru> <8530cd03-0158-f198-9b14-ade983e1c7f4@gmail.com> <022c0e0a-e039-24ef-66ff-82bcedbacd93@yandex.ru> <505388da-e642-8c98-35c0-261d09ff13e1@yandex.ru> <1a23269d-1ead-1771-1afd-e2c9c5840cb4@gmail.com> <30d8b181-d869-de24-9c86-cc1dc6ec461b@gmail.com> <6ea0d89d-1a24-30fe-dd9a-26a0157a4eae@yandex.ru> <01922284-4265-6510-feee-dcc7301787ad@gmail.com> <7346fb37-f0b2-77dc-c227-cacfbd372775@gmail.com> <874lxef9fq.fsf@linux-m68k.org> From: Dmitry Gutov Message-ID: Date: Wed, 26 Apr 2017 02:49:23 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:53.0) Gecko/20100101 Thunderbird/53.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) On 25.04.2017 18:38, Jonathan Ganc wrote: > Good point. Changed. Thank you very much, Jonathan, and thanks to the other reviewers! I'll install the patch shortly. From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Resent-From: Jonathan Ganc Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Apr 2017 03:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Dmitry Gutov , Andreas Schwab Cc: 26066@debbugs.gnu.org, Stefan Monnier , Noam Postavsky Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.149317670531832 (code B ref 26066); Wed, 26 Apr 2017 03:19:02 +0000 Received: (at 26066) by debbugs.gnu.org; 26 Apr 2017 03:18:25 +0000 Received: from localhost ([127.0.0.1]:40364 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d3DTE-0008HM-VY for submit@debbugs.gnu.org; Tue, 25 Apr 2017 23:18:25 -0400 Received: from mail-qt0-f177.google.com ([209.85.216.177]:34531) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d3DTC-0008H7-TY for 26066@debbugs.gnu.org; Tue, 25 Apr 2017 23:18:23 -0400 Received: by mail-qt0-f177.google.com with SMTP id c45so156171705qtb.1 for <26066@debbugs.gnu.org>; Tue, 25 Apr 2017 20:18:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=bn73KzyHwDwQ7rpbPYi5tQ+kAt98wNfcXn7XU5S+F/M=; b=Vc0ja1iWop3kByUxadIF6N0gu+c8cLObkniVR9tvmUQ7usOAS/SEsS9hD7tiOX0xFc 2NVQEfWPBwT7VxhFQce32GtLXyXLSJZJiY1ZpoEFjZzuhgSUW7dGH514lXkwQ9THM4x6 9rb/Lpc59P9YLfcFrtEXFb5cxi9XEICZFxuIF/F8CVHsHgFvBA5rlYZjW+++opfbO3Cb 7ZrbzQ1hpLXY9OM9fAfnItIx5Lv+sP/8OHLYCMLV6MU3WyQMia53hyqUJQb+yAdBjVvT aRBz2YXldZkgf8qvGrxeEh0v7o4ZDptfDsv1XOfEtjGG0mM1aMenB/uVRPFsEWCXq8On q+2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=bn73KzyHwDwQ7rpbPYi5tQ+kAt98wNfcXn7XU5S+F/M=; b=tkSkSQYXOt4CtAsD/ce/ooz3FGR16kTlJyf47CFW/5RapE27GK5U0bUK2YJsK1NwKV ngZFZSfIZRKyOc0/J5dcB+qYpk7cDeAvHa6wz21ScCoLMBcfmLigqVQpDKMchyNWVxVq 8n7vUcDg2CTJCYi8QJHx7HYdL5obIHcNItqxklyZosOknOYqr1BGYqXl98/3IpHZi54C TX4Ds6Feo4oGSRLcztR5Jb30//XOhN0xqyGOMbKk5dc7495yu4Euo9dnaQnPsMDtP69L UFmNlY4s91bB4GDGJMDpqldrkyVFowZH6DzUp1j9zgWqC9RkS24AUF3CvrgUPI4V9m+K IWkQ== X-Gm-Message-State: AN3rC/4NQMsp4m3OuViqrOa/fXnEt2Q1vy/oop1ImbIc8Por1+chbeAD 5gISERNPq7bnXw== X-Received: by 10.200.49.169 with SMTP id h38mr36986216qte.243.1493176697347; Tue, 25 Apr 2017 20:18:17 -0700 (PDT) Received: from [192.168.1.200] (static-98-118-34-152.bstnma.fios.verizon.net. [98.118.34.152]) by smtp.gmail.com with ESMTPSA id f203sm16538507qka.11.2017.04.25.20.18.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Apr 2017 20:18:16 -0700 (PDT) References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <87efxy59wx.fsf@users.sourceforge.net> <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> <29d4a5ae-0ca0-3a86-6b9a-ab616803f39e@gmail.com> <4741bddf-9765-0d94-d0cd-b94e3e4914e1@yandex.ru> <8530cd03-0158-f198-9b14-ade983e1c7f4@gmail.com> <022c0e0a-e039-24ef-66ff-82bcedbacd93@yandex.ru> <505388da-e642-8c98-35c0-261d09ff13e1@yandex.ru> <1a23269d-1ead-1771-1afd-e2c9c5840cb4@gmail.com> <30d8b181-d869-de24-9c86-cc1dc6ec461b@gmail.com> <6ea0d89d-1a24-30fe-dd9a-26a0157a4eae@yandex.ru> <01922284-4265-6510-feee-dcc7301787ad@gmail.com> <7346fb37-f0b2-77dc-c227-cacfbd372775@gmail.com> <874lxef9fq.fsf@linux-m68k.org> From: Jonathan Ganc Message-ID: Date: Tue, 25 Apr 2017 23:18:15 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) Thanks Dmitry! And to all the reviewers, I very much appreciated the feedback! On 04/25/2017 07:49 PM, Dmitry Gutov wrote: > On 25.04.2017 18:38, Jonathan Ganc wrote: >> Good point. Changed. > > Thank you very much, Jonathan, and thanks to the other reviewers! > > I'll install the patch shortly. From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 May 2017 01:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Jonathan Ganc , Andreas Schwab Cc: 26066@debbugs.gnu.org, Stefan Monnier , Noam Postavsky Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.14936030044309 (code B ref 26066); Mon, 01 May 2017 01:44:01 +0000 Received: (at 26066) by debbugs.gnu.org; 1 May 2017 01:43:24 +0000 Received: from localhost ([127.0.0.1]:48321 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d50N1-00017R-SQ for submit@debbugs.gnu.org; Sun, 30 Apr 2017 21:43:24 -0400 Received: from mail-wr0-f175.google.com ([209.85.128.175]:35351) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d50N1-00017F-BT for 26066@debbugs.gnu.org; Sun, 30 Apr 2017 21:43:23 -0400 Received: by mail-wr0-f175.google.com with SMTP id z52so58487424wrc.2 for <26066@debbugs.gnu.org>; Sun, 30 Apr 2017 18:43:23 -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=/bL3hInnbNO51HHwVJn0Fj41lvPiT3T27KVE3JAkol8=; b=f2sQWQBMkF1osV7TdcmuM6/ocD5Gi6ZeSWInvzl88c6QeDtaAfQaap9v5mfLe1ZuWn Pdasjgvga1xVh696X60mT5gAhWeuIOOzlz+UCdEzxhCX/Nm6HOsWTkHO7xbnMV6ch7SS 1kCF/CdO7mjJiN/64l2UfRlbYRjr75/wSkpzHbmDeQ9Cf2mlBK4OycpqCRHd8lmRnE/b kgaWqo91YWIKfxZmyzAw1FdT1b1w7cwIzAT8mJrb196l7XLQcFHFp7UN58In803FvS6r lJVOOYUqvrZeyRFUiNhem32b/L/71fJ8+qLwnR+3Uf4bqMC1ApLvsp4lX+YAUpMiPdp9 yhpA== 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=/bL3hInnbNO51HHwVJn0Fj41lvPiT3T27KVE3JAkol8=; b=IhDRuPYn2olg82U9NHBJhReiMp3cqUzkoThBWGG/t8A7LTfplJAH/DHhd9NrVmxevC IsDdVUeBrZKVwCu3TDCdoONGex1ZrqlsJia1t19l1px+dBWJOsYthBru3HklNz8pC08e ilXIy/VZEK6Ou//JjQs4GBWtz4WFZfquEIEWoqLgD9IVJbubvBAdouBtFGM8CqpOWMAM 50Pm73S8uxPzoeue7HOpPZDl7Z6v8KqyIVULzW1wHpKlnOQFu8ROetgzBHwM3kLQt/UP fBZjYFGAEKBz4n56s7TC18hq/RhAGbwY26O/EqnOCkXnCjHwy2gQniw+OUvkHzk5dx2K F9FA== X-Gm-Message-State: AN3rC/45edWeFsj2xtJQblxQaukytdpnLDOBkfBcH+oGQYEYjhQ0UUaK JZGb1Yob6r0zRw== X-Received: by 10.223.171.68 with SMTP id r4mr14605062wrc.67.1493602997641; Sun, 30 Apr 2017 18:43:17 -0700 (PDT) Received: from [192.168.1.3] ([185.105.173.156]) by smtp.googlemail.com with ESMTPSA id d17sm13146036wmi.21.2017.04.30.18.43.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Apr 2017 18:43:17 -0700 (PDT) References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <87efxy59wx.fsf@users.sourceforge.net> <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> <29d4a5ae-0ca0-3a86-6b9a-ab616803f39e@gmail.com> <4741bddf-9765-0d94-d0cd-b94e3e4914e1@yandex.ru> <8530cd03-0158-f198-9b14-ade983e1c7f4@gmail.com> <022c0e0a-e039-24ef-66ff-82bcedbacd93@yandex.ru> <505388da-e642-8c98-35c0-261d09ff13e1@yandex.ru> <1a23269d-1ead-1771-1afd-e2c9c5840cb4@gmail.com> <30d8b181-d869-de24-9c86-cc1dc6ec461b@gmail.com> <6ea0d89d-1a24-30fe-dd9a-26a0157a4eae@yandex.ru> <01922284-4265-6510-feee-dcc7301787ad@gmail.com> <7346fb37-f0b2-77dc-c227-cacfbd372775@gmail.com> <874lxef9fq.fsf@linux-m68k.org> From: Dmitry Gutov Message-ID: Date: Mon, 1 May 2017 04:43:15 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:53.0) Gecko/20100101 Thunderbird/53.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) On 26.04.2017 6:18, Jonathan Ganc wrote: > Thanks Dmitry! And to all the reviewers, I very much appreciated the > feedback! Patch installed, with some minor copy edits. Keeping the bug report open because it's actually about the default-directory binding. From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 May 2017 01:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Jonathan Ganc , npostavs@users.sourceforge.net, 26066@debbugs.gnu.org, Stefan Monnier Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.14936038635499 (code B ref 26066); Mon, 01 May 2017 01:58:02 +0000 Received: (at 26066) by debbugs.gnu.org; 1 May 2017 01:57:43 +0000 Received: from localhost ([127.0.0.1]:48326 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d50at-0001Qd-4o for submit@debbugs.gnu.org; Sun, 30 Apr 2017 21:57:43 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:35615) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d50ar-0001QQ-A8 for 26066@debbugs.gnu.org; Sun, 30 Apr 2017 21:57:41 -0400 Received: by mail-wr0-f196.google.com with SMTP id g12so12745094wrg.2 for <26066@debbugs.gnu.org>; Sun, 30 Apr 2017 18:57:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Szf+N6KDVAK7RNO8w0r2Iosk1f92/jc+2Z6gcyvnQk8=; b=gwtCvCbVK8S2zl2ME4/r7FBBixjIqdlcavWboLsF0T0fBpWDgDuYez1CDRtBlzwHkB cRb3wy2jZlG7v2bpmei/ByR/T4HjJmeO2ePl/DFXTclcrsIPHWul13CxWIVFprlGMhiH SW86gqxSF1a/TthJzVEjnkbkm+vzGDEzPHAUZ+HVjTvDduxgPpPA7kruFMmZELKtvitQ GdrmUvU/drIJGxTs1dw9OkIhzgOd6Jls8GPM215t1OG65CJYpDjxA3V2Uv16l2/fYqwY JONuI9raSkdfrqmCD8tLYCVOov2AAWGuxtkMqhw3/o+5gb/IZNN6zDP9jkQinmsnCjER FCFQ== 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:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Szf+N6KDVAK7RNO8w0r2Iosk1f92/jc+2Z6gcyvnQk8=; b=DJMac39gro93T+Yj2brCbKndQkTaaA+WeDuPkNGa2vjJT/hNxg1+0T2BXQvUJaZBIX 8qsqwKjgaLkmd/uMk8IQRPagRaqUOMP9XumUHD5cAHIWXYA592ELs6eLo0O5jB9m9KGK z62AR0QpLBCwLKqwrnApUoS5IQIaxhJm7gCTwT6gpDEQ+ZHej+0cYiOQEbpOLDDQotty BiuTfCl14Q9EO71bH1395xf2b1K38JnlHToBZ1IENfmiZTbjoAo7Y/hcQuC3xAvRUMaK ocPmJDVjZo3dDwo1e8yG6z1wevk8+9uAo156DdnzANWaAHAPkd3Rfc2k/bK1u10hY5uh 7Urw== X-Gm-Message-State: AN3rC/5nEAJP1uCVSPT7R246fGE3hMGBcBdQnzW74OquA18QGL62sgeX SEfj8Ekc0aX7/A== X-Received: by 10.223.139.146 with SMTP id o18mr8594722wra.146.1493603855636; Sun, 30 Apr 2017 18:57:35 -0700 (PDT) Received: from [192.168.1.3] ([185.105.173.156]) by smtp.googlemail.com with ESMTPSA id 39sm14045331wru.50.2017.04.30.18.57.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Apr 2017 18:57:35 -0700 (PDT) References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <87efxy59wx.fsf@users.sourceforge.net> <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> <29d4a5ae-0ca0-3a86-6b9a-ab616803f39e@gmail.com> <4741bddf-9765-0d94-d0cd-b94e3e4914e1@yandex.ru> <8530cd03-0158-f198-9b14-ade983e1c7f4@gmail.com> <022c0e0a-e039-24ef-66ff-82bcedbacd93@yandex.ru> <505388da-e642-8c98-35c0-261d09ff13e1@yandex.ru> <1a23269d-1ead-1771-1afd-e2c9c5840cb4@gmail.com> <30d8b181-d869-de24-9c86-cc1dc6ec461b@gmail.com> <6ea0d89d-1a24-30fe-dd9a-26a0157a4eae@yandex.ru> <01922284-4265-6510-feee-dcc7301787ad@gmail.com> From: Dmitry Gutov Message-ID: Date: Mon, 1 May 2017 04:57:33 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:53.0) Gecko/20100101 Thunderbird/53.0 MIME-Version: 1.0 In-Reply-To: <01922284-4265-6510-feee-dcc7301787ad@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -2.1 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) On 14.04.2017 3:42, Jonathan Ganc wrote: > First, I'm sorry for this delayed response. I've had a busy few days > (and I needed to think about the issue)! I'm sorry about the delay as well. > I'm fine with decoupling the question about default-directory from the > patch for git status. I have attached a patch that does not bind > default-directory. (And I now have turned in the assignment paperwork to > the FSF!). Thanks! That part is applied now. >> If vc-git supports calling vc-git-state from outside of the >> repository, but not some other commands, or if vc-git-state does but >> some other backends' vc-xx-state does not, this will increase >> inconsistency and make it harder for the programmers to write >> VCS-agnostic code, which is one of the main goals of VC. > > But being vcs-agnostic is more for people who use vc-state or > vc-state-refresh, rather than people actually writing the vc-specific > functions, no? The vc-specific functions are supposed to conform to the common interface. To be as indistinguishable as feasible. > If this bug is unchanged, people using vc-state have to > ask themselves: "if the backend is git, I have to bind default-directory > but if it's not, I don't." That is inconsistent with vc agnosticism. If that was only the Git backend's problem, I might have agreed. However, not all other backends bind default-directory. Bzr doesn't, as one example. Hg and SVN seem to do that, though. If you have a chance to experiment with some other popular ones, please do. But what about the problems like "I don't have to bind default-directory when calling vc-state, but I still have to do that when calling other backend commands"? > That's a valid question and a valid point. But I actually think that > adding the binding in vc-git-state furthers the goal of systematically > answering them. Since we'll have to hunt down every other command that needs it (or, worse, wait for bug reports and thus spread that effort across several Emacs releases), I'm not so sure it would be a great step. > I doubt we'll be able to find, at one time, people with > knowledge of more than 4 or 5 of the vc's (e.g. I know only git) who > have the time to address this issue. I think we only have 4-5 backends which correspond to reasonably popular version control systems. The rest can simply follow their example. > What we can do instead, though, is > to encourage people to properly write the backend specific functions. How? > The fact that I can't argue in general that an arbitrary vc > system needs default-directory set suggests to me that one should leave > it to the vc system to decide. For example, I could imagine a backend > that wants the current directory to be the root directory of the > repository, rather than the directory containing the file. Such backend (I'm not aware of any, though) could still rebind default-directory inside its function. From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Resent-From: Jonathan Ganc Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 May 2017 19:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Dmitry Gutov , npostavs@users.sourceforge.net, 26066@debbugs.gnu.org, Stefan Monnier Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.14936665695272 (code B ref 26066); Mon, 01 May 2017 19:23:02 +0000 Received: (at 26066) by debbugs.gnu.org; 1 May 2017 19:22:49 +0000 Received: from localhost ([127.0.0.1]:49950 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5GuH-0001My-2X for submit@debbugs.gnu.org; Mon, 01 May 2017 15:22:49 -0400 Received: from mail-qk0-f195.google.com ([209.85.220.195]:36112) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5GuE-0001Mk-R9 for 26066@debbugs.gnu.org; Mon, 01 May 2017 15:22:47 -0400 Received: by mail-qk0-f195.google.com with SMTP id o4so6912qkb.3 for <26066@debbugs.gnu.org>; Mon, 01 May 2017 12:22:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=NSwQwAysXBXBC+Nepo15jxj8d7S+m2YYvPilHU0DEvk=; b=juDf5sEvvU7kOXu638ctkf1AhUb0vwpGw+80Vjmf4JsjubKKRtRq+2J3kvKmmg2od6 VPWVA8DwxGjznY1187DR3dBHOzowVwX9i+9iKv6jDh1iNL6LTgbGmisxUBBll2L8W7uH 5ICly3npN7lvt2bxYWYqPVXFJRg5Y/JPrJCdcbiPg1i70c87kfMJywtpryn5YhIbr/hW xYTass7hwLIJnwBkqMAu9LFLZ567rOLm8zap1sUHm8f+UsB4+2HudBwJSLy99XMoFTDq mvN5AKK/Ck97o1zX1tZnFJP6xmpUqq6YGZBgHJsJONqpW0POFqR1VUOPSIBzfsWYllre hE9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=NSwQwAysXBXBC+Nepo15jxj8d7S+m2YYvPilHU0DEvk=; b=cplTYrD6Ke4dtbGqqrkjPnldJsFbaxw/cg8TEgllNyeN3CWaw+oFtwgYUmzYm6gIAM HJ0/oZZsxVEn5lSj1O58BMDdWd5GKHMJn8ehCZXrklhlzWHytItoebB0cfMCrq4gIFgc JjG9L+Yf76eEMPxYQkJruVckYbdZ6muDFQW2qD11DnDAuPMGSgKgPS6cpfQDsqvfazww 1nJmZBRf+3/65J5FctWD+sTp3HWvCCHQemXJ8lyO+zHErgj/M8bTQcpox7fLUgzK+suR wauocUdtQ/NPCWxUr+pRxwDkD5mFY35n06slpfPAzWdvGWYpJN3BIeaez9POGGj8RUlF zzgQ== X-Gm-Message-State: AN3rC/5dZ+yHFCFg30W00Mrn4hlfGkAFuxpNUI8E1v1ndxJLElOhX2GV WRy5rN49x9ciEA== X-Received: by 10.55.46.198 with SMTP id u189mr21889303qkh.20.1493666561344; Mon, 01 May 2017 12:22:41 -0700 (PDT) Received: from [10.1.10.171] (c-65-96-175-120.hsd1.ma.comcast.net. [65.96.175.120]) by smtp.gmail.com with ESMTPSA id z63sm11163862qkc.6.2017.05.01.12.22.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 May 2017 12:22:40 -0700 (PDT) References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <87efxy59wx.fsf@users.sourceforge.net> <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> <29d4a5ae-0ca0-3a86-6b9a-ab616803f39e@gmail.com> <4741bddf-9765-0d94-d0cd-b94e3e4914e1@yandex.ru> <8530cd03-0158-f198-9b14-ade983e1c7f4@gmail.com> <022c0e0a-e039-24ef-66ff-82bcedbacd93@yandex.ru> <505388da-e642-8c98-35c0-261d09ff13e1@yandex.ru> <1a23269d-1ead-1771-1afd-e2c9c5840cb4@gmail.com> <30d8b181-d869-de24-9c86-cc1dc6ec461b@gmail.com> <6ea0d89d-1a24-30fe-dd9a-26a0157a4eae@yandex.ru> <01922284-4265-6510-feee-dcc7301787ad@gmail.com> From: Jonathan Ganc Message-ID: <13d425a5-0c6d-385a-4df6-41e168c6eb89@gmail.com> Date: Mon, 1 May 2017 15:22:39 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) On 04/30/2017 09:57 PM, Dmitry Gutov wrote: > > I'm sorry about the delay as well. > No worries. > >> If this bug is unchanged, people using vc-state have to ask >> themselves: "if the backend is git, I have to bind default-directory >> but if it's not, I don't." That is inconsistent with vc agnosticism. > > However, not all other backends bind default-directory. Bzr doesn't, > as one example. Hg and SVN seem to do that, though. If you have a > chance to experiment with some other popular ones, please do. > But it's not clear to me that bzr needs to bind it. In other words, git needs to bind it get a working answer and perhaps bzr doesn't. Unfortunately, I only know git. If I get a chance I'll look at some others but I've never used them. Community message: If anyone else who uses other VC systems is reading this, it'd great to know if vc-state gives the correct answer if default-directory is bound to a random directory! > But what about the problems like "I don't have to bind > default-directory when calling vc-state, but I still have to do that > when calling other backend commands"? > This is just about clarification: are you thinking that one possible solution is not to have any of the vc code bind default-directory, i.e. that the caller might always be responsible for that? From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 May 2017 19:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Jonathan Ganc Cc: npostavs@users.sourceforge.net, 26066@debbugs.gnu.org, monnier@IRO.UMontreal.CA, dgutov@yandex.ru Reply-To: Eli Zaretskii Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.14936677687139 (code B ref 26066); Mon, 01 May 2017 19:43:02 +0000 Received: (at 26066) by debbugs.gnu.org; 1 May 2017 19:42:48 +0000 Received: from localhost ([127.0.0.1]:49977 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5HDb-0001r5-Rt for submit@debbugs.gnu.org; Mon, 01 May 2017 15:42:48 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51883) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5HDZ-0001qq-TW for 26066@debbugs.gnu.org; Mon, 01 May 2017 15:42:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d5HDT-0000Qt-T1 for 26066@debbugs.gnu.org; Mon, 01 May 2017 15:42:40 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:45999) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d5HDO-0000PE-DL; Mon, 01 May 2017 15:42:34 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4880 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1d5HDN-0007VT-Jz; Mon, 01 May 2017 15:42:34 -0400 Date: Mon, 01 May 2017 22:42:25 +0300 Message-Id: <83r308icta.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <13d425a5-0c6d-385a-4df6-41e168c6eb89@gmail.com> (message from Jonathan Ganc on Mon, 1 May 2017 15:22:39 -0400) References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <87efxy59wx.fsf@users.sourceforge.net> <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> <29d4a5ae-0ca0-3a86-6b9a-ab616803f39e@gmail.com> <4741bddf-9765-0d94-d0cd-b94e3e4914e1@yandex.ru> <8530cd03-0158-f198-9b14-ade983e1c7f4@gmail.com> <022c0e0a-e039-24ef-66ff-82bcedbacd93@yandex.ru> <505388da-e642-8c98-35c0-261d09ff13e1@yandex.ru> <1a23269d-1ead-1771-1afd-e2c9c5840cb4@gmail.com> <30d8b181-d869-de24-9c86-cc1dc6ec461b@gmail.com> <6ea0d89d-1a24-30fe-dd9a-26a0157a4eae@yandex.ru> <01922284-4265-6510-feee-dcc7301787ad@gmail.com> <13d425a5-0c6d-385a-4df6-41e168c6eb89@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Jonathan Ganc > Date: Mon, 1 May 2017 15:22:39 -0400 > > Community message: If anyone else who uses other VC systems is reading > this, it'd great to know if vc-state gives the correct answer if > default-directory is bound to a random directory! I tried that with bzr, and vc-state produces a wrong result if default-directory is not set to the correct value. From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 May 2017 22:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Jonathan Ganc , npostavs@users.sourceforge.net, 26066@debbugs.gnu.org, Stefan Monnier Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.149367683220411 (code B ref 26066); Mon, 01 May 2017 22:14:02 +0000 Received: (at 26066) by debbugs.gnu.org; 1 May 2017 22:13:52 +0000 Received: from localhost ([127.0.0.1]:50052 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5JZo-0005J9-Lw for submit@debbugs.gnu.org; Mon, 01 May 2017 18:13:52 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:36299) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5JZl-0005Iu-Rq for 26066@debbugs.gnu.org; Mon, 01 May 2017 18:13:50 -0400 Received: by mail-wm0-f67.google.com with SMTP id u65so460508wmu.3 for <26066@debbugs.gnu.org>; Mon, 01 May 2017 15:13:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=GlUSLul0bEsxEPVgDS9oN5pF7SjhgvXkuyCVWMbqss8=; b=BLeUq4IsN/CxAzAa08fchlqZunUmJgc2dIIkkEDiIcZbBLFnR7dzk/5Qj8wzLCht+b klRceoJHEoeukcLverc+y9N2kTYW6S2ZSe03fmqEIXg3p/g8Bf2PT+G8xNz78JVBAW4e aa6ZQMbUayBlYHBnwxKK5QzUDOxTGYPTw/i1086taYnnab5WW9bgyaxXdWucb8OOrWkz qsSzZvdqgJh7UdsWe47f9Ov+gYiIo3VPoga4BOvoAgUfCzWOVRELnKUVMuCDBW7Xv8jP YTX69QmO3YxId7Hw1trtBxthZfaq1vpADQzE9M6Of1xdjPwHu3dsxVjT8qn9TjHHkiQH 8Gmg== 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:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=GlUSLul0bEsxEPVgDS9oN5pF7SjhgvXkuyCVWMbqss8=; b=dtXnf0sCx0cGp2DIekbBFRVhlUAwoOZtEdkL3noQAz4nTbsAmdvC5xYwBuPVxGOeZ9 zCOyWBQZYHg3nHYqhFes6Y/5TM28O0s0cq9v94wMfrRvTskvOTdBIoC9Ne/wfgsusIgJ fMpn9ys2KAIniYDwrw7qt4GgnZmjAzMB5b2u+j5HvpGosZDtVf+3ht3Qm9TEABYA3gUS L5XlGiW63wt2bkF1v245qlvrWNknC4j7O7zItByc+XOhXCdKNqKs2uQKz08aQPBNTtVp TetOxKchN9PY4mi3hFP5wQadOTPUJAlKt30cpz80xjRDLk9iAI4pVYIj3DSDqBrXWDpY XoiQ== X-Gm-Message-State: AN3rC/6ZdmdobTKvPOdLG4Fo6/Uje9dBJAN5IgpuIAJ74T4EUHxCGRUl lBcRKagj74vARQ== X-Received: by 10.28.46.143 with SMTP id u137mr185780wmu.56.1493676824150; Mon, 01 May 2017 15:13:44 -0700 (PDT) Received: from [192.168.1.3] ([185.105.173.156]) by smtp.googlemail.com with ESMTPSA id t124sm239364wma.10.2017.05.01.15.13.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 May 2017 15:13:43 -0700 (PDT) References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <87efxy59wx.fsf@users.sourceforge.net> <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> <29d4a5ae-0ca0-3a86-6b9a-ab616803f39e@gmail.com> <4741bddf-9765-0d94-d0cd-b94e3e4914e1@yandex.ru> <8530cd03-0158-f198-9b14-ade983e1c7f4@gmail.com> <022c0e0a-e039-24ef-66ff-82bcedbacd93@yandex.ru> <505388da-e642-8c98-35c0-261d09ff13e1@yandex.ru> <1a23269d-1ead-1771-1afd-e2c9c5840cb4@gmail.com> <30d8b181-d869-de24-9c86-cc1dc6ec461b@gmail.com> <6ea0d89d-1a24-30fe-dd9a-26a0157a4eae@yandex.ru> <01922284-4265-6510-feee-dcc7301787ad@gmail.com> <13d425a5-0c6d-385a-4df6-41e168c6eb89@gmail.com> From: Dmitry Gutov Message-ID: Date: Tue, 2 May 2017 01:13:40 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:53.0) Gecko/20100101 Thunderbird/53.0 MIME-Version: 1.0 In-Reply-To: <13d425a5-0c6d-385a-4df6-41e168c6eb89@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) On 01.05.2017 22:22, Jonathan Ganc wrote: >> But what about the problems like "I don't have to bind >> default-directory when calling vc-state, but I still have to do that >> when calling other backend commands"? >> > This is just about clarification: are you thinking that one possible > solution is not to have any of the vc code bind default-directory, i.e. > that the caller might always be responsible for that? Suppose so. I do not particularly like any of the obvious options. Making the caller bind default-directory is not ideal, but sprinkling default-directory bindings over all VC command implementations doesn't sound great. The former seems less error-prone in the end, though. And in that approach, the caller package might find just one place they have to put the default-directory binding at, so that it works for multiple calls. From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Jun 2019 23:02:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Dmitry Gutov Cc: Jonathan Ganc , 26066@debbugs.gnu.org, Andreas Schwab , Stefan Monnier , Noam Postavsky Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.156141729710636 (code B ref 26066); Mon, 24 Jun 2019 23:02:04 +0000 Received: (at 26066) by debbugs.gnu.org; 24 Jun 2019 23:01:37 +0000 Received: from localhost ([127.0.0.1]:58298 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfXxw-0002lG-RY for submit@debbugs.gnu.org; Mon, 24 Jun 2019 19:01:37 -0400 Received: from quimby.gnus.org ([80.91.231.51]:38010) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfXxv-0002jf-Js for 26066@debbugs.gnu.org; Mon, 24 Jun 2019 19:01:36 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hfXxn-0000PK-KC; Tue, 25 Jun 2019 01:01:29 +0200 From: Lars Ingebrigtsen References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <87efxy59wx.fsf@users.sourceforge.net> <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> <29d4a5ae-0ca0-3a86-6b9a-ab616803f39e@gmail.com> <4741bddf-9765-0d94-d0cd-b94e3e4914e1@yandex.ru> <8530cd03-0158-f198-9b14-ade983e1c7f4@gmail.com> <022c0e0a-e039-24ef-66ff-82bcedbacd93@yandex.ru> <505388da-e642-8c98-35c0-261d09ff13e1@yandex.ru> <1a23269d-1ead-1771-1afd-e2c9c5840cb4@gmail.com> <30d8b181-d869-de24-9c86-cc1dc6ec461b@gmail.com> <6ea0d89d-1a24-30fe-dd9a-26a0157a4eae@yandex.ru> <01922284-4265-6510-feee-dcc7301787ad@gmail.com> <7346fb37-f0b2-77dc-c227-cacfbd372775@gmail.com> <874lxef9fq.fsf@linux-m68k.org> Date: Tue, 25 Jun 2019 01:01:27 +0200 In-Reply-To: (Dmitry Gutov's message of "Mon, 1 May 2017 04:43:15 +0300") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Dmitry Gutov writes: > On 26.04.2017 6:18, Jonathan Ganc wrote: >> Thanks Dmitry! And to all the reviewers, I very much appreciated the >> feedback! > > Patch installed, with some minor copy edits. Keeping the bug report [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Dmitry Gutov writes: > On 26.04.2017 6:18, Jonathan Ganc wrote: >> Thanks Dmitry! And to all the reviewers, I very much appreciated the >> feedback! > > Patch installed, with some minor copy edits. Keeping the bug report > open because it's actually about the default-directory binding. The original problem here was fixed and the patch applied -- is the default-directory binding still being considered? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Sun Aug 17 10:22:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 Aug 2020 15:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Dmitry Gutov Cc: Jonathan Ganc , 26066@debbugs.gnu.org, Andreas Schwab , Stefan Monnier , Noam Postavsky Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.159707195812328 (code B ref 26066); Mon, 10 Aug 2020 15:06:01 +0000 Received: (at 26066) by debbugs.gnu.org; 10 Aug 2020 15:05:58 +0000 Received: from localhost ([127.0.0.1]:37193 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k59N8-0003Cm-1l for submit@debbugs.gnu.org; Mon, 10 Aug 2020 11:05:58 -0400 Received: from quimby.gnus.org ([95.216.78.240]:49392) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k59N5-0003CF-P3 for 26066@debbugs.gnu.org; Mon, 10 Aug 2020 11:05:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=nWFvO/EsSTccfS17GvQttYfxO1Ef+NYwdDZR3JuaYdI=; b=XqEVcukyLeiYP+LzGWx9Ad/tyz QK0yY9s9eZ68SclCOGRTmfCYxu9vVYH7I56NtMoe+7ojYGoRiLQ2/+qnQE4jhnF3bSmfpZKuykE2N fAKWDoeFDIFisWEJRx8CcP7CbSwIGWDK/aywU3K8MuC3wYNYMtRPF3nbKgUgOpofW+6M=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k59Mm-0006C0-L0; Mon, 10 Aug 2020 17:05:40 +0200 From: Lars Ingebrigtsen References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> <29d4a5ae-0ca0-3a86-6b9a-ab616803f39e@gmail.com> <4741bddf-9765-0d94-d0cd-b94e3e4914e1@yandex.ru> <8530cd03-0158-f198-9b14-ade983e1c7f4@gmail.com> <022c0e0a-e039-24ef-66ff-82bcedbacd93@yandex.ru> <505388da-e642-8c98-35c0-261d09ff13e1@yandex.ru> <1a23269d-1ead-1771-1afd-e2c9c5840cb4@gmail.com> <30d8b181-d869-de24-9c86-cc1dc6ec461b@gmail.com> <6ea0d89d-1a24-30fe-dd9a-26a0157a4eae@yandex.ru> <01922284-4265-6510-feee-dcc7301787ad@gmail.com> <7346fb37-f0b2-77dc-c227-cacfbd372775@gmail.com> <874lxef9fq.fsf@linux-m68k.org> Date: Mon, 10 Aug 2020 17:05:34 +0200 In-Reply-To: (Lars Ingebrigtsen's message of "Tue, 25 Jun 2019 01:01:27 +0200") Message-ID: <87eeoezgld.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Lars Ingebrigtsen writes: > Dmitry Gutov writes: > >> On 26.04.2017 6:18, Jonathan Ganc wrote: >>> Thanks Dmitry! And to all the reviewers, I very much appreciated the >>> feedback! >> >> Patch installed, wi [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Lars Ingebrigtsen writes: > Dmitry Gutov writes: > >> On 26.04.2017 6:18, Jonathan Ganc wrote: >>> Thanks Dmitry! And to all the reviewers, I very much appreciated the >>> feedback! >> >> Patch installed, with some minor copy edits. Keeping the bug report >> open because it's actually about the default-directory binding. > > The original problem here was fixed and the patch applied -- is the > default-directory binding still being considered? I asked this a year ago, and there was no response, so I'm guessing not, and I'm closing the bug report. Please reopen (or refile a new report, since this is rather long and involved) if this is still an issue. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 10 11:05:54 2020 Received: (at control) by debbugs.gnu.org; 10 Aug 2020 15:05:54 +0000 Received: from localhost ([127.0.0.1]:37190 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k59N3-0003CO-QQ for submit@debbugs.gnu.org; Mon, 10 Aug 2020 11:05:54 -0400 Received: from quimby.gnus.org ([95.216.78.240]:49388) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k59N1-0003C9-VO for control@debbugs.gnu.org; Mon, 10 Aug 2020 11:05:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=LQ4qYo/k45yFjAmXS/JEgNh4FMWENMKUxCKMXxxBRbg=; b=MDX3fuuGbTRdO7xJtHOpxIUWqW cYWxVDpws6FySG/rwnZXe2Vi5ilpmZggK5NrwN7f42GjGHhzJk+tkhBnGomjQHpuHPRmZK8SaViXB mESTgUWR4KZsQzFRZtpNg/WDsOecGc3ubowv4zryr7D8GC7VPDMxOQZllG213zxEj/hE=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k59Mu-0006C7-7Z for control@debbugs.gnu.org; Mon, 10 Aug 2020 17:05:46 +0200 Date: Mon, 10 Aug 2020 17:05:42 +0200 Message-Id: <87d03yzgl5.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #26066 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 26066 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) close 26066 quit