GNU bug report logs - #38615
27.0.50; vc-git: Wrong status in vc-dir after registering directory

Previous Next

Package: emacs;

Reported by: Andrii Kolomoiets <andreyk.mad <at> gmail.com>

Date: Sat, 14 Dec 2019 21:51:02 UTC

Severity: normal

Found in version 27.0.50

Done: Dmitry Gutov <dgutov <at> yandex.ru>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 38615 in the body.
You can then email your comments to 38615 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#38615; Package emacs. (Sat, 14 Dec 2019 21:51:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Andrii Kolomoiets <andreyk.mad <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 14 Dec 2019 21:51:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Andrii Kolomoiets <andreyk.mad <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.50; vc-git: Wrong status in vc-dir after registering directory
Date: Sat, 14 Dec 2019 14:41:11 +0200
0. mkdir test && cd test
   git init
   touch file
   git add file
   git commit -m "initial"
   mkdir dir
   touch dir/file1
1. emacs -Q
2. C-x v d
   "dir/" is listed with "unregistered" status.
3. v
   "dir/" has "added" status.
4. g
   "dir/file1" is listed with "up-to-date" status.  Shouldn't it have
   "added" status?
5. g
   Now "dir/file1" properly has "added" status.

Also:
- After step 3 point is moved to word "dir" on second line.
- Press "n" before step 3 to move point to "dir/". After step 3 "dir/"
  status is not updated and remains "unregistered".




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38615; Package emacs. (Mon, 16 Dec 2019 01:26:01 GMT) Full text and rfc822 format available.

Message #8 received at 38615 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Andrii Kolomoiets <andreyk.mad <at> gmail.com>, 38615 <at> debbugs.gnu.org
Subject: Re: bug#38615: 27.0.50; vc-git: Wrong status in vc-dir after
 registering directory
Date: Mon, 16 Dec 2019 03:25:00 +0200
[Message part 1 (text/plain, inline)]
Hi Andrii,

On 14.12.2019 14:41, Andrii Kolomoiets wrote:
> 0. mkdir test && cd test
>     git init
>     touch file
>     git add file
>     git commit -m "initial"
>     mkdir dir
>     touch dir/file1
> 1. emacs -Q
> 2. C-x v d
>     "dir/" is listed with "unregistered" status.
> 3. v
>     "dir/" has "added" status.
> 4. g
>     "dir/file1" is listed with "up-to-date" status.  Shouldn't it have
>     "added" status?
> 5. g
>     Now "dir/file1" properly has "added" status.
> 
> Also:
> - After step 3 point is moved to word "dir" on second line.
> - Press "n" before step 3 to move point to "dir/". After step 3 "dir/"
>    status is not updated and remains "unregistered".

Thanks for the repro. This problem seems to have been with us for a while.

vc-git's dir-status-files code is a bit hard to follow, but here's a 
patch you can try. I'll commit it in the next few days if nothing comes up.
[vc-git-dir-status-files+added.diff (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38615; Package emacs. (Mon, 16 Dec 2019 08:01:02 GMT) Full text and rfc822 format available.

Message #11 received at 38615 <at> debbugs.gnu.org (full text, mbox):

From: Andrii Kolomoiets <andreyk.mad <at> gmail.com>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 38615 <at> debbugs.gnu.org
Subject: Re: bug#38615: 27.0.50; vc-git: Wrong status in vc-dir after
 registering directory
Date: Mon, 16 Dec 2019 10:00:22 +0200
Dmitry Gutov <dgutov <at> yandex.ru> writes:

> On 14.12.2019 14:41, Andrii Kolomoiets wrote:
>> 0. mkdir test && cd test
>>     git init
>>     touch file
>>     git add file
>>     git commit -m "initial"
>>     mkdir dir
>>     touch dir/file1
>> 1. emacs -Q
>> 2. C-x v d
>>     "dir/" is listed with "unregistered" status.
>> 3. v
>>     "dir/" has "added" status.
>> 4. g
>>     "dir/file1" is listed with "up-to-date" status.  Shouldn't it have
>>     "added" status?
>> 5. g
>>     Now "dir/file1" properly has "added" status.
>> Also:
>> - After step 3 point is moved to word "dir" on second line.
>> - Press "n" before step 3 to move point to "dir/". After step 3 "dir/"
>>    status is not updated and remains "unregistered".
>
> Thanks for the repro. This problem seems to have been with us for a while.
>
> vc-git's dir-status-files code is a bit hard to follow, but here's a
> patch you can try. I'll commit it in the next few days if nothing
> comes up.

Thanks, file status is "added" after step 4 now.

Though point is stil moves to the word "dir" on the second line after
step 3.
And directory "dir" status is not updated when:
2. C-x v d
3. n
4. v

Should it be different bug reports for those cases?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38615; Package emacs. (Mon, 16 Dec 2019 13:24:01 GMT) Full text and rfc822 format available.

Message #14 received at 38615 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Andrii Kolomoiets <andreyk.mad <at> gmail.com>
Cc: 38615 <at> debbugs.gnu.org
Subject: Re: bug#38615: 27.0.50; vc-git: Wrong status in vc-dir after
 registering directory
Date: Mon, 16 Dec 2019 15:23:38 +0200
On 16.12.2019 10:00, Andrii Kolomoiets wrote:

> Though point is stil moves to the word "dir" on the second line after
> step 3.
> And directory "dir" status is not updated when:
> 2. C-x v d
> 3. n
> 4. v
> 
> Should it be different bug reports for those cases?

Yes.

These would have to be fixed in vc-dir rather than vc-git, and they 
would require some more investigation about the proper behavior and the 
places to fix.

Regarding the moving of point, personally, I'm not sure which of the 
behaviors is more correct.

The latter is caused basically by:

- Git returning a directory in the file status list.
- Directories not having an actual VCS status in our system.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38615; Package emacs. (Mon, 16 Dec 2019 19:44:02 GMT) Full text and rfc822 format available.

Message #17 received at 38615 <at> debbugs.gnu.org (full text, mbox):

From: Andrii Kolomoiets <andreyk.mad <at> gmail.com>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 38615 <at> debbugs.gnu.org
Subject: Re: bug#38615: 27.0.50; vc-git: Wrong status in vc-dir after
 registering directory
Date: Mon, 16 Dec 2019 21:43:39 +0200
[Message part 1 (text/plain, inline)]
Dmitry Gutov <dgutov <at> yandex.ru> writes:

>> Though point is stil moves to the word "dir" on the second line after
>> step 3.
>> And directory "dir" status is not updated when:
>> 2. C-x v d
>> 3. n
>> 4. v
>> Should it be different bug reports for those cases?
>
> Yes.
>
> These would have to be fixed in vc-dir rather than vc-git, and they
> would require some more investigation about the proper behavior and
> the places to fix.
>
> Regarding the moving of point, personally, I'm not sure which of the
> behaviors is more correct.

It's `vc-dir-move-to-goal-column' called after `vc-register'. I will
make dedicated bug report.

> The latter is caused basically by:
>
> - Git returning a directory in the file status list.
> - Directories not having an actual VCS status in our system.

How about to list files and not directories? This will allow to register
untracked files under untracked directory with single `v'. Please see
attached patch.
[vc-git-ls-files-in-untracked-dir.diff (text/x-patch, attachment)]

Reply sent to Dmitry Gutov <dgutov <at> yandex.ru>:
You have taken responsibility. (Mon, 16 Dec 2019 23:55:02 GMT) Full text and rfc822 format available.

Notification sent to Andrii Kolomoiets <andreyk.mad <at> gmail.com>:
bug acknowledged by developer. (Mon, 16 Dec 2019 23:55:02 GMT) Full text and rfc822 format available.

Message #22 received at 38615-done <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Andrii Kolomoiets <andreyk.mad <at> gmail.com>
Cc: 38615-done <at> debbugs.gnu.org
Subject: Re: bug#38615: 27.0.50; vc-git: Wrong status in vc-dir after
 registering directory
Date: Tue, 17 Dec 2019 01:53:56 +0200
On 16.12.2019 21:43, Andrii Kolomoiets wrote:

>> Regarding the moving of point, personally, I'm not sure which of the
>> behaviors is more correct.
> 
> It's `vc-dir-move-to-goal-column' called after `vc-register'. I will
> make dedicated bug report.

Thanks.

>> The latter is caused basically by:
>>
>> - Git returning a directory in the file status list.
>> - Directories not having an actual VCS status in our system.
> 
> How about to list files and not directories? This will allow to register
> untracked files under untracked directory with single `v'. Please see
> attached patch.

Okay, let's try this, thank you.

I believe the original idea was to avoid overwhelming the user when 
there are a lot of unregistered files (build artefacts and the like), 
but that's what gitignore is for.

Both patches are pushed, closing.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 14 Jan 2020 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 161 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.