From: Daniel Shahaf <danielsh@apache.org>
To: zsh-workers@zsh.org
Subject: [PATCH 1/3] vcs_info: Document internal function and variable
Date: Sun, 1 Dec 2019 00:04:46 +0000 [thread overview]
Message-ID: <20191201000448.21880-1-danielsh@apache.org> (raw)
---
Functions/VCS_Info/VCS_INFO_bydir_detect | 12 ++++++++++++
Functions/VCS_Info/vcs_info | 6 ++++++
2 files changed, 18 insertions(+)
diff --git a/Functions/VCS_Info/VCS_INFO_bydir_detect b/Functions/VCS_Info/VCS_INFO_bydir_detect
index b20c05c9c..29b261413 100644
--- a/Functions/VCS_Info/VCS_INFO_bydir_detect
+++ b/Functions/VCS_Info/VCS_INFO_bydir_detect
@@ -2,6 +2,18 @@
## Written by Frank Terbeck <ft@bewatermyfriend.org>
## Distributed under the same BSD-ish license as zsh itself.
+# Helper function for VCS_INFO_detect_*
+#
+# Usage:
+# vcs_comm[detect_need_file]=FILENAMES VCS_INFO_bydir_detect DIRNAME
+# where DIRNAME is a directory name and FILENAMES is a space-separated list
+# of filenames.
+#
+# If any parent directory of the current working directory, other than the root
+# directory, contains a subdirectory named DIRNAME that contains a file whose name
+# is in FILENAMES, set vcs_comm[basedir] to the path of that parent directory and
+# return true. Otherwise, return false.
+
setopt localoptions NO_shwordsplit
local dirname=$1
local basedir="." file
diff --git a/Functions/VCS_Info/vcs_info b/Functions/VCS_Info/vcs_info
index d67ae6bf5..9f48bee75 100644
--- a/Functions/VCS_Info/vcs_info
+++ b/Functions/VCS_Info/vcs_info
@@ -59,6 +59,12 @@ vcs_info () {
local -x LC_MESSAGES
local -i maxexports
local -a msgs
+
+ # vcs_comm is used internally for passing values among VCS_INFO_* functions.
+ # It is not part of the public API.
+ #
+ # hook_com, backend_misc, and user_data are public API; see zshcontrib(1)
+ # and Misc/vcs_info-examples.
local -A vcs_comm hook_com backend_misc user_data
LC_MESSAGES=C
next reply other threads:[~2019-12-01 0:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-01 0:04 Daniel Shahaf [this message]
2019-12-01 0:04 ` [PATCH 2/3] vcs_info cvs: Fix infinite loop when /CVS exists Daniel Shahaf
2019-12-01 0:04 ` [PATCH 3/3] vcs_info svn: Fix infinite loop when /.svn exists Daniel Shahaf
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=20191201000448.21880-1-danielsh@apache.org \
--to=danielsh@apache.org \
--cc=zsh-workers@zsh.org \
/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 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).