1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-05-03 22:27:13 +02:00
Commit Graph

42 Commits

Author SHA1 Message Date
Felipe Contreras 9b9f3adde8 50612: vcs_info: fix typo 2023-05-13 00:44:01 +02:00
Daniel Shahaf c055c6464d unposted: vcs_info: Add Vim modelines
... for consistency with all other vcs_info function files.
2022-01-29 16:01:39 +00:00
Suraj N. Kurapati d634a3d333 49128 (github #76): vcs_info-examples: optimize +vi-git-untracked()
Speed up the prompt on large and/or deep working directories by
stopping grep(1) as soon as it finds a single match, with `-q`.
Also, correct the regexp by adding a ^ anchor and increase its
specificity by accounting for the space in Porcelain Format v1.

Previously, +vi-git-untracked() waited for grep(1) to find all
matches of untracked files, redirecting them away to /dev/null,
before finally concluding that untracked files do indeed exist.

With this patch, I see 4x speedup on a large Git-enabled $HOME:

    $ time (git status --porcelain | wc -l)
    212
    0.01s user 0.02s system 0% cpu 9.021 total

    $ time (git status --porcelain | grep '??' &>/dev/null)
    0.01s user 0.02s system 0% cpu 12.294 total

    $ time (git status --porcelain | grep -q '^?? ' 2>/dev/null)
    0.01s user 0.01s system 0% cpu 3.097 total

Note that `-q` for grep(1) is in POSIX (IEEE Std 1003.1-2017):
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/grep.html

See discussion https://www.zsh.org/mla/workers/2021/msg01354.html
2021-07-06 01:56:07 +00:00
Daniel Shahaf b110d6d5af 48435 (tweaked): vcs_info docs: applied-string/unapplied-string: Correct an omission in the documentation and add an example.
The example code is a reduced version of my function from workers/47519,
with one bug fixed.  (In workers/47519, if $1 doesn't contain spacesĀ -
which is the case under hg mq - then $H and $s will be set to the same
value.)

Tweaked: Extended the contrib.yo hunk with details about mq.
2021-04-20 23:38:04 +00:00
Daniel Shahaf c40a63ab67 48528/0002: vcs_info git docs: ahead/behind commits: Reduce the number of forks 2021-04-20 22:34:34 +00:00
Daniel Shahaf d9ac5916ba 48528/0001: vcs_info git docs: ahead/behind commits: Don't run rev-list when that would fail 2021-04-20 22:34:34 +00:00
Tim Lee 3b631babec 48525: vcs_info git docs: ahead/behind commits: Run fewer external programs 2021-04-13 13:55:48 +00:00
Mikael Magnusson 42b5371d70 unposted: vcs_info-examples: Fix condition 2020-12-05 19:25:57 +01:00
Daniel Shahaf ad47c2d907 unposted (cf. GitHub #11): vcs_info hg: docs: Change an example to not use a hex dump incantation that may replace some bytes' values with asterisks.
Discussion: https://github.com/zsh-users/zsh/pull/11#issuecomment-457970494 et seq

Incidentally, GitHub #11 is also where workers/39786 (commit
zsh-5.2-578-g74aa45910) was first reported.
2020-07-12 13:06:38 +00:00
Jens Schleusener 11dbe4c286 45269: Fix misspellings in completions and elsewhere. 2020-01-09 13:42:02 +00:00
Daniel Shahaf 41e3518589 45115: vcs_info examples: Make the quilt-patch-dir example friendlier.
- Document that no code at all is necessary for Pareto correctness

- Remove a recommendation to rely on implementation details (${rrn});
  instead, rely only on ${context}, which is a documented API.
2019-12-22 03:21:01 +00:00
Daniel Shahaf fec98a13fd 45116: vcs_info examples: Add an example of showing Git environment variables. 2019-12-22 03:21:00 +00:00
Daniel Shahaf 27a64a16fb unposted: vcs_info: Add an example of using $functions to find hooks by name. 2019-12-02 01:54:24 +00:00
Eitan Adler d63ae0acc9 42826: remove link to now-spam website 2018-06-04 00:39:26 +02:00
Daniel Shahaf e007cd9f88 40510: vcs_info: Update the $psvar episode with '%'-unescaping. (Follow-up to 40492.) 2017-02-09 15:24:05 +00:00
Marc Finet 6ec8cfdeaa 33149: vcs_info examples: fix typo 2014-09-14 12:02:34 +02:00
Peter Stephenson cc6e9db29d 33047: use git to simplify massively source distribution file selection 2014-08-23 21:01:58 +01:00
Daniel Shahaf eb4c70d0b7 32528: vcs_info: Add check-for-staged-changes 2014-04-05 10:56:52 +02:00
Frank Terbeck 966bd9bd82 Seth House: 30701: Misc/vcs_info-examples: Added an hg hook example to restore the 40-char hash 2012-09-28 22:09:37 +00:00
Simon Ruderich d5db14e3c9 30366: Misc/vcs_info-examples: Fix outdated quilt examples. 2012-03-23 16:34:38 +00:00
Frank Terbeck 8ce9c1cbe7 Suraj N. Kurapati: vcs_info-examples: Mention different ways to handle remote branch names in `vi-git-remotebranch()'. 2011-10-19 18:14:08 +00:00
Frank Terbeck 0deff4f99a Valentin Haenel: 29431: Hook example for signaling untracked files in git repositories 2011-06-01 21:21:04 +00:00
Frank Terbeck 67e6e030d2 Seth House: 28115: Another git example vcs_info hook. 2010-08-02 21:05:54 +00:00
Frank Terbeck e03c47752b Seth House: 28084, 28083: cleanups and new examples. 2010-07-19 19:21:35 +00:00
Frank Terbeck 88ea63adf2 Simon Ruderich: 27953: vcs_info: changed default formats and actionformats. 2010-05-14 07:58:37 +00:00
Frank Terbeck 9773e56418 Simon Ruderich: 27954: vcs_info: more minor documentation fixes. 2010-05-14 07:55:38 +00:00
Frank Terbeck 0501efc54a Seth House, Simon Ruderich and myself: 27948: various vcs_info changes
Here's a diff-stat:

 Doc/Zsh/contrib.yo                                |  506 ++++++++++++++-------
 Functions/VCS_Info/.distfiles                     |    1 +
 Functions/VCS_Info/Backends/VCS_INFO_detect_hg    |   14 +-
 Functions/VCS_Info/Backends/VCS_INFO_get_data_git |   35 +-
 Functions/VCS_Info/Backends/VCS_INFO_get_data_hg  |  295 +++++++++----
 Functions/VCS_Info/VCS_INFO_formats               |   26 +-
 Functions/VCS_Info/VCS_INFO_hook                  |   10 +-
 Functions/VCS_Info/VCS_INFO_quilt                 |  190 ++++++++
 Functions/VCS_Info/vcs_info                       |   30 +-
 Misc/.distfiles                                   |    1 +
 Misc/vcs_info-examples                            |  496 ++++++++++++++++++++
 11 files changed, 1303 insertions(+), 301 deletions(-)

The major changes are vast improvements for the mercurial (hg) backend
(which was done almost entirely by Seth); improved documentation (mostly
done by Simon and again Seth); quilt support (as an addon and stand
alone, see the manual for details); a number of new hooks and a fair
share of bugfixes.
2010-05-10 10:46:48 +00:00
Peter Stephenson 7389a42d17 24708: Misc/globtests, Src/pattern.c, Test/D02glob.ztst:
fix backtracking problem in (#c) pattern
2008-03-30 22:14:22 +00:00
Peter Stephenson a81e5a609e add (#cN,M) globbing flag 2007-07-27 21:51:32 +00:00
Peter Stephenson 876fa2c44e unposted: force latest version of files from vendor to main branch 2007-07-03 17:06:04 +00:00
Peter Stephenson 09bc7ee2b5 22557: turn on multibyte option by default 2006-07-25 18:10:37 +00:00
Peter Stephenson b115ca307a 20500: Unmetafy patterns where possible and other minor pattern fixes 2004-10-18 11:56:14 +00:00
Peter Stephenson 7d672455bb 19269: 8-bit characters in character classes 2003-12-03 10:54:36 +00:00
Bart Schaefer 9f3d6b63a0 Remove RCS Id strings. 2000-05-16 16:22:14 +00:00
Peter Stephenson d2330ba055 10547: (#s) and (#e) pattern assertions 2000-04-06 18:44:01 +00:00
Peter Stephenson 4852545255 Updated from list as far as 10376 2000-04-01 20:49:47 +00:00
Tanaka Akira ef92e77058 Initial revision 1999-11-09 02:36:42 +00:00
Tanaka Akira d3170c8ee6 Initial revision 1999-10-04 22:57:19 +00:00
Tanaka Akira 8d1b4b1358 Sync up with zsh-3_1_6-pws-1. 1999-08-12 22:59:04 +00:00
Tanaka Akira 59c3d242d5 Initial revision 1999-07-12 17:02:52 +00:00
Tanaka Akira e74702b467 Initial revision 1999-04-15 18:05:38 +00:00
Tanaka Akira c175751b50 Initial revision 1999-04-15 18:05:35 +00:00