zsh-workers
 help / color / mirror / code / Atom feed
* Use HGPLAIN instead of HGRCPATH in VCS_INFO_get_data_hg
@ 2017-10-24 18:14 Alexey Sokolov
  2017-10-24 21:39 ` Frank Terbeck
  0 siblings, 1 reply; 6+ messages in thread
From: Alexey Sokolov @ 2017-10-24 18:14 UTC (permalink / raw)
  To: zsh-workers


[-- Attachment #1.1: Type: text/plain, Size: 1169 bytes --]

    Use HGPLAIN instead of HGRCPATH in VCS_INFO_get_data_hg

    Fixes prompt indicator in case if the repository requires a non-default
    feature. With HGRCPATH, it results in:

    abort: repository requires features unknown to this Mercurial: ...
    (see https://mercurial-scm.org/wiki/MissingRequirement for more
information)

    Which, in turn, results in "default" getting reported regardless of what
    the current state of the repo is.

diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg
b/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg
index d4030125c..cd5ef321d 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg
@@ -55,8 +55,8 @@ if zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}"
get-revision ; then
         zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" \
             "check-for-changes" || hgid_args+=( -r. )

-        local HGRCPATH
-        HGRCPATH="/dev/null" ${vcs_comm[cmd]} ${(z)hgid_args} 2> /dev/null
\
+        local HGPLAIN
+        HGPLAIN=1 ${vcs_comm[cmd]} ${(z)hgid_args} 2> /dev/null \
             | read -r r_csetid r_lrev r_branch
     fi
 fi

[-- Attachment #1.2: Type: text/html, Size: 1503 bytes --]

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4845 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Use HGPLAIN instead of HGRCPATH in VCS_INFO_get_data_hg
  2017-10-24 18:14 Use HGPLAIN instead of HGRCPATH in VCS_INFO_get_data_hg Alexey Sokolov
@ 2017-10-24 21:39 ` Frank Terbeck
  2017-10-24 22:36   ` Alexey Sokolov
  0 siblings, 1 reply; 6+ messages in thread
From: Frank Terbeck @ 2017-10-24 21:39 UTC (permalink / raw)
  To: Alexey Sokolov; +Cc: zsh-workers

Hey Alexey,

Alexey Sokolov wrote:
>     Use HGPLAIN instead of HGRCPATH in VCS_INFO_get_data_hg
>
>     Fixes prompt indicator in case if the repository requires a non-default
>     feature. With HGRCPATH, it results in:
>
>     abort: repository requires features unknown to this Mercurial: ...
>     (see https://mercurial-scm.org/wiki/MissingRequirement for more
> information)
>
>     Which, in turn, results in "default" getting reported regardless of what
>     the current state of the repo is.

Could you maybe resend the patch attached? You MUA seems to have mangled
it a tad. Preferably, commit locally, use "git format-patch -1" and send
the resulting file.

That makes attribution and integration as simple as possible for us.

Thanks for your help as well!


Regards, Frank
-- 
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
                                                  -- RFC 1925


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Use HGPLAIN instead of HGRCPATH in VCS_INFO_get_data_hg
  2017-10-24 21:39 ` Frank Terbeck
@ 2017-10-24 22:36   ` Alexey Sokolov
  2017-10-25  8:37     ` Frank Terbeck
  0 siblings, 1 reply; 6+ messages in thread
From: Alexey Sokolov @ 2017-10-24 22:36 UTC (permalink / raw)
  To: Frank Terbeck; +Cc: zsh-workers


[-- Attachment #1.1.1: Type: text/plain, Size: 1139 bytes --]

On 24 October 2017 at 21:39, Frank Terbeck <ft@bewatermyfriend.org> wrote:

> Hey Alexey,
>
> Alexey Sokolov wrote:
> >     Use HGPLAIN instead of HGRCPATH in VCS_INFO_get_data_hg
> >
> >     Fixes prompt indicator in case if the repository requires a
> non-default
> >     feature. With HGRCPATH, it results in:
> >
> >     abort: repository requires features unknown to this Mercurial: ...
> >     (see https://mercurial-scm.org/wiki/MissingRequirement for more
> > information)
> >
> >     Which, in turn, results in "default" getting reported regardless of
> what
> >     the current state of the repo is.
>
> Could you maybe resend the patch attached? You MUA seems to have mangled
> it a tad. Preferably, commit locally, use "git format-patch -1" and send
> the resulting file.
>
> That makes attribution and integration as simple as possible for us.
>
> Thanks for your help as well!
>
>
Hi Frank,
No problem. I copypasted it this way because of the following in
http://zsh.sourceforge.net/Arc/git.html: "We prefer patches to be included
inline in the body of the message because it makes it easier to comment on
particular lines."

[-- Attachment #1.1.2: Type: text/html, Size: 1843 bytes --]

[-- Attachment #1.2: 0001-Use-HGPLAIN-instead-of-HGRCPATH-in-VCS_INFO_get_data.patch --]
[-- Type: application/octet-stream, Size: 1459 bytes --]

From 33eecfd91a89fe477df80fb55b3248ed38e77f32 Mon Sep 17 00:00:00 2001
From: Alexey Sokolov <sokolov@google.com>
Date: Tue, 24 Oct 2017 18:08:50 +0100
Subject: [PATCH] Use HGPLAIN instead of HGRCPATH in VCS_INFO_get_data_hg

Fixes prompt indicator in case if the repository requires a non-default
feature. With HGRCPATH, it results in:

abort: repository requires features unknown to this Mercurial: ...
(see https://mercurial-scm.org/wiki/MissingRequirement for more information)

Which, in turn, results in "default" getting reported regardless of what
is the current state of the repo.
---
 Functions/VCS_Info/Backends/VCS_INFO_get_data_hg | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg b/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg
index d4030125c..cd5ef321d 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg
@@ -55,8 +55,8 @@ if zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" get-revision ; then
         zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" \
             "check-for-changes" || hgid_args+=( -r. )
 
-        local HGRCPATH
-        HGRCPATH="/dev/null" ${vcs_comm[cmd]} ${(z)hgid_args} 2> /dev/null \
+        local HGPLAIN
+        HGPLAIN=1 ${vcs_comm[cmd]} ${(z)hgid_args} 2> /dev/null \
             | read -r r_csetid r_lrev r_branch
     fi
 fi
-- 
2.15.0.rc0.271.g36b669edcc-goog


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4845 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Use HGPLAIN instead of HGRCPATH in VCS_INFO_get_data_hg
  2017-10-24 22:36   ` Alexey Sokolov
@ 2017-10-25  8:37     ` Frank Terbeck
  2017-10-25  8:47       ` Peter Stephenson
  2017-10-25  8:58       ` Alexey Sokolov
  0 siblings, 2 replies; 6+ messages in thread
From: Frank Terbeck @ 2017-10-25  8:37 UTC (permalink / raw)
  To: Alexey Sokolov; +Cc: zsh-workers

Hi!

Alexey Sokolov wrote:
> No problem. I copypasted it this way because of the following in
> http://zsh.sourceforge.net/Arc/git.html: "We prefer patches to be included
> inline in the body of the message because it makes it easier to comment on
> particular lines."

Yup, technically that's true, unless the mailer mangles the diff. Of
course, there's always "git send-email" to avoid that, if the system
it's running on is configured to support it.

I've applied and pushed your patch. Thanks again!


Regards, Frank
-- 
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
                                                  -- RFC 1925


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Use HGPLAIN instead of HGRCPATH in VCS_INFO_get_data_hg
  2017-10-25  8:37     ` Frank Terbeck
@ 2017-10-25  8:47       ` Peter Stephenson
  2017-10-25  8:58       ` Alexey Sokolov
  1 sibling, 0 replies; 6+ messages in thread
From: Peter Stephenson @ 2017-10-25  8:47 UTC (permalink / raw)
  To: zsh-workers

On Wed, 25 Oct 2017 10:37:27 +0200
Frank Terbeck <ft@bewatermyfriend.org> wrote:
> Alexey Sokolov wrote:
> > No problem. I copypasted it this way because of the following in
> > http://zsh.sourceforge.net/Arc/git.html: "We prefer patches to be included
> > inline in the body of the message because it makes it easier to comment on
> > particular lines."
> 
> Yup, technically that's true, unless the mailer mangles the diff. Of
> course, there's always "git send-email" to avoid that, if the system
> it's running on is configured to support it.

Given we get a reasonable number of changes from people who don't
necessarily spend their lives mailing patches (which is great), we might
want to be clearer and say "If you're not used to sending patches and
unsure how well your mailer handles inline text, feel free to provide an
attachment".  However, I don't have a website checkout here.

pws


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Use HGPLAIN instead of HGRCPATH in VCS_INFO_get_data_hg
  2017-10-25  8:37     ` Frank Terbeck
  2017-10-25  8:47       ` Peter Stephenson
@ 2017-10-25  8:58       ` Alexey Sokolov
  1 sibling, 0 replies; 6+ messages in thread
From: Alexey Sokolov @ 2017-10-25  8:58 UTC (permalink / raw)
  To: Frank Terbeck; +Cc: zsh-workers


[-- Attachment #1.1: Type: text/plain, Size: 84 bytes --]

Thanks!

On 25 October 2017 at 09:37, Frank Terbeck <ft@bewatermyfriend.org> wrote:

[-- Attachment #1.2: Type: text/html, Size: 263 bytes --]

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4845 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-10-25  8:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-24 18:14 Use HGPLAIN instead of HGRCPATH in VCS_INFO_get_data_hg Alexey Sokolov
2017-10-24 21:39 ` Frank Terbeck
2017-10-24 22:36   ` Alexey Sokolov
2017-10-25  8:37     ` Frank Terbeck
2017-10-25  8:47       ` Peter Stephenson
2017-10-25  8:58       ` Alexey Sokolov

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).