all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Noam Postavsky <npostavs@users.sourceforge.net>
To: Jonathan Ganc <jonganc@gmail.com>
Cc: 26066@debbugs.gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>,
	Dmitry Gutov <dgutov@yandex.ru>
Subject: bug#26066: 26.0.50; vc-git-status gives wrong result
Date: Sun, 23 Apr 2017 18:28:04 -0400	[thread overview]
Message-ID: <CAM-tV-9ApU6RemdAfrb7AAVhVzYk=k9EntKT=6-wSfCnWo-O8A@mail.gmail.com> (raw)
In-Reply-To: <cf9e7b8e-44c1-43fd-7c49-f31249ea90a5@gmail.com>

> 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)))





  reply	other threads:[~2017-04-23 22:28 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-12  2:42 bug#26066: 26.0.50; vc-git-status gives wrong result Jonathan Ganc
2017-03-14 13:45 ` npostavs
2017-03-16  0:42 ` npostavs
2017-03-16  0:48   ` Dmitry Gutov
2017-03-16  2:40     ` Jonathan Ganc
2017-03-21  9:19       ` Dmitry Gutov
2017-03-21 16:10         ` Jonathan Ganc
2017-03-22 12:11           ` Michael Heerdegen
2017-03-22 16:20           ` Dmitry Gutov
2017-03-23  2:18             ` Jonathan Ganc
2017-03-31  3:16               ` Jonathan Ganc
2017-04-10  2:16                 ` Jonathan Ganc
2017-04-10  2:58                 ` npostavs
2017-04-10  3:26                 ` Dmitry Gutov
2017-04-10  4:41                   ` Jonathan Ganc
2017-04-10  6:05                     ` Eli Zaretskii
2017-04-10  7:35                     ` Thien-Thi Nguyen
2017-04-10 23:46                     ` Dmitry Gutov
2017-04-10  4:43                   ` Jonathan Ganc
2017-04-10 23:26                     ` Dmitry Gutov
2017-04-11  0:07               ` Dmitry Gutov
2017-04-11  3:52                 ` Jonathan Ganc
2017-04-11 13:08                   ` Jonathan Ganc
2017-04-11 23:27                     ` Dmitry Gutov
2017-04-11 23:36                       ` Dmitry Gutov
2017-04-14  0:42                       ` Jonathan Ganc
2017-04-23 18:21                         ` Jonathan Ganc
2017-04-23 22:28                           ` Noam Postavsky [this message]
2017-04-23 22:45                             ` Stefan Monnier
2017-04-24  0:50                             ` Jonathan Ganc
2017-04-24  9:20                               ` Andreas Schwab
2017-04-25 15:38                                 ` Jonathan Ganc
2017-04-25 23:49                                   ` Dmitry Gutov
2017-04-26  3:18                                     ` Jonathan Ganc
2017-05-01  1:43                                       ` Dmitry Gutov
2019-06-24 23:01                                         ` Lars Ingebrigtsen
2020-08-10 15:05                                           ` Lars Ingebrigtsen
2017-05-01  1:57                         ` Dmitry Gutov
2017-05-01 19:22                           ` Jonathan Ganc
2017-05-01 19:42                             ` Eli Zaretskii
2017-05-01 22:13                             ` Dmitry Gutov
2017-03-18  2:38     ` Jonathan Ganc

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAM-tV-9ApU6RemdAfrb7AAVhVzYk=k9EntKT=6-wSfCnWo-O8A@mail.gmail.com' \
    --to=npostavs@users.sourceforge.net \
    --cc=26066@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    --cc=jonganc@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.