1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-02 10:01:11 +02:00
Commit graph

96 commits

Author SHA1 Message Date
Daniel Shahaf
e8943e7007 38609: vcs_info quilt: Factor out a helper function. No functional change. 2016-06-06 08:10:11 +00:00
Daniel Shahaf
a45a9fa104 unposted: Fix typo in comment. 2016-01-15 06:30:06 +00:00
Daniel Shahaf
ce1148db45 37612: vcs_info git: Set $git_patches_unapplied correctly for 'rebase-apply' case.
This manifested, e.g., in 'git am' of a single patch that had a conflict.
2016-01-15 06:29:09 +00:00
Frank Terbeck
dab6e7c231 37451: vcs_info: Declare "msgs" in early context
The parameter *is* being declared with the redefinition of the
function, but not in its initial form, which gets you a warning
about the parameter being defined globally. This fixes it.
2015-12-30 15:23:08 +01:00
Philip Sequeira
038b1d4b38 37345: VCS_INFO functions break with setopt no_unset
With setopt no_unset in my config file, vcs_info fails with:
VCS_INFO_maxexports:7: vcs: parameter not set
2015-12-23 01:57:45 +01:00
Peter Stephenson
4105f79a3a 37347: Remove incorrect local for msgs in VCS info 2015-12-08 12:59:48 +00:00
Daniel Shahaf
502d55c014 37252: vcs_info git: Compute %b correctly with "rebase --onto" of detached heads. (Follow-up to 36725.) 2015-11-30 03:42:47 +00:00
Peter Stephenson
ae4cf7b743 37186: a couple more WARN_CREATE_GLOBAL fixes 2015-11-22 16:06:20 +00:00
Daniel Shahaf
f59864ce7a 37025: vcs_info git: Add a cherry-pick patch-format 2015-11-13 20:17:27 +00:00
Daniel Shahaf
779b3112f8 36913 + 36945: vcs_info quilt: Pass patch subject lines to gen-applied-string
The format used is '${patchname} ${subject}', which is analogous to the git backend.
2015-10-24 20:42:26 +00:00
Daniel Shahaf
c62db9e7dc 36912: vcs_info quilt: Tolerate being in child of .pc's parent
Without this, gen-applied-string would only be set when .pc is a child of cwd,
not when it is a child of an ancestor of cwd.
2015-10-24 20:26:41 +00:00
Frank Terbeck
2e600b432a 36888: vcs_info: Prevent warn_create_global warning with '-preinit-' state
This is related to 33405. Turns out that not all other calls to
VCS_INFO_set are okay: With recent zsh versions the early call to that
function with the '-preinit-' argument causes a warning like this:

  VCS_INFO_set:9: math parameter maxexports created globally
                  in function VCS_INFO_set

This fixes it.
2015-10-18 20:40:18 +02:00
Frank Terbeck
e245dd7193 36832: vcs_info: Remove dependency on "seq"
The "seq" utility is usually available on GNU systems only. This
exchanges calls to seq with pure zsh features. Also: Less forks are
good.
2015-10-11 12:54:30 +02:00
Frank Terbeck
7a1678767f 36830: vcs_info: Silence an error message with new git versions
Mikael informs me on IRC, that in new versions of git (he used 2.6.1)
where the "am" subcommand is now a builtin, a file that is used by the
git backend of vcs_info (namely .git/rebase-apply/msg-clean) is not
available anymore, leading to an annoying error message:

  VCS_INFO_get_data_git:232: no such file or directory: .git/rebase-apply/msg-clean

This patch checks for the availabiliy of the file before using it,
and adjusts the value of the dependant values accordingly.
2015-10-11 12:29:41 +02:00
Daniel Shahaf
a90cf551ef 36725: vcs_info git: Compute %b correctly when "git am"-ing onto detached heads.
Before this patch, $gitbranch would be set to empty, which caused
VCS_INFO_get_data_git to early out with a failure status¹, consequently
$vcs_info_msg_0_ would be empty.

¹ via the 'if [[ -z ]]' block around line 170.
2015-09-30 21:43:37 +00:00
Daniel Shahaf
cd1cda9d57 36725: vcs_info git: Compute %b correctly when rebasing detached heads.
This sets the %b expando to the hash of the before-the-merge HEAD, rather
than to the literal string "detached HEAD".  That hash is already available
via the gen-applied-string hook.
2015-09-30 21:43:37 +00:00
Daniel Shahaf
7ac34a3055 36725: vcs_info git: Compute %b correctly when merging to detached heads.
The %b expando should be the hash prior to the merge.  The hash of the merge
result is available as the %i expando and via the gen-applied-string hook.
2015-09-30 21:43:37 +00:00
Daniel Hahler
45bdc87a1f 36601: vcs_info: handle missing .git/rebase-apply/{next,msg-clean}
When pressing Ctrl-C after `git am`, only `last` exists in
`.git/rebase-apply/`, which is empty.

This patch fixes it to fall back to "no patch applied" then.
2015-09-28 20:03:12 +02:00
Daniel Shahaf
880579dc1e 36410: vcs_info git: Present merge heads as patches
This shows, during 'git merge', the revision hashes of the "remote" head
(the one that will become second parent of the commit) in the %m expando.

Review-by: Frank Terbeck
2015-09-05 10:47:44 +00:00
brian m. carlson
9a369d39e1 36209: vcs_info: avoid grep error message when file is missing
When running git rebase -m and a conflict occurs, the git-rebase-todo
file is not present.  This leads to an error from grep every time the
shell prompt is printed when vcs_info is enabled.  Avoid this message by
checking if the file exists before trying to grep it.
2015-08-18 01:00:25 +02:00
Mikael Magnusson
c5abf2bcff 36077: vcs_info: stop exporting everything 2015-08-12 04:31:22 +02:00
Daniel Shahaf
57be7b743f 34673: vcs_info git: Fix error message when rebase hasn't started 2015-03-09 20:03:37 +00:00
Daniel Shahaf
9d25fd7255 vcs_info hg: Support inactive bookmarks
(Similar to git detached heads)
2015-01-25 01:42:05 +01:00
Marc Finet
9ea817acda PATCH: 34333: vcs_info quilt: fix unapplied detection in subdir
When patches are applied, let quilt use .pc without forcing the
patch directory, this will fix the unapplied detection when being in
subdir.
When no patches are applied, use zstyle quilt-patch-dir then
QUILT_PATCHES then "patches" for path to search for patches.

Note: prefer setting quilt-patch-dir rather than QUILT_PATCHES for
absolute path because when patches are applied, quilt unapplied will
not return the correct list (i.e. the whole list rather that the one
specified by .pc/.quilt_series).
2015-01-22 00:15:20 +01:00
Frank Terbeck
a03227de23 33405: vcs_info: Make sure maxexports is set when VCS_INFO_set is called
Reported-by: From: Marco Hinz <mh.codebro@gmail.com>
2014-10-09 18:36:13 +02:00
Marc Finet
0f73b35f4e 33391: vcs_info git: fix applied patch detection on git am
git-am also uses .git/rebase-apply for patch list but
the file original-commit does not exist (as no commit exist).
This patch handles both git rebase and git am. Also:
 - get the first line (rather than the first char) when the message
   contains only one line;
 - remove unused function (ironically that should have been used here).
2014-10-09 18:11:08 +02:00
Frank Terbeck
4a529201b8 33277: Fix VCS_INFO_reposub's command expansion
Reported-by: Marco Hinz <mh.codebro@gmail.com>
2014-09-29 19:20:11 +02:00
Daniel Hahler
64e2b4426e 33217: vcs_info: use --ignore-submodules=dirty with diff/diff-index
This will detect changes to submodules from the superproject's
perspective, e.g. after `git rm submodule`.

>From GIT-DIFF-INDEX(1)/GIT-DIFF(1):

    Using "dirty" ignores all changes to the work tree of submodules,
    only changes to the commits stored in the superproject are shown
    (this was the behavior until 1.7.0).
2014-09-22 23:23:03 +02:00
Marc Finet
9c29a4f1f6 33184: vcs_info git: consider patches for rebase
Since a rebase contains a list of patches to re-apply, re-use the
facility for stgit to have the same mechanism.
The patch list given to the gen-{un,}applied-string hooks is an array
with the sha1 and the subject of the commit. On rebase merge, the
applied patches prior to current contains only a number and "?".
2014-09-16 23:20:55 +02:00
Marc Finet
2c2d4f9627 33188: vcs_info git: set rrn before using it
This would fix handling get-revision, check-for-changes or
check-for-staged-changes when set per repository.
2014-09-16 23:20:52 +02:00
Marc Finet
d5f574e20a 33145: vcs_info git: fix applied-string name
Documentation and hg backend use applied-string. patch-string does not
appear anywhere.
2014-09-14 12:02:37 +02:00
Marc Finet
06e03e7234 33148: vcs_info quilt: refactor standalone detection
Since VCS_INFO_bydir_detect always uses the
vcs_comm[detect_need_file], it should be cleared when querying
it without file.
2014-09-14 12:02:36 +02:00
Marc Finet
5e40996891 33147: vcs_info git: detect revert or cherry-pick with multiple commits
When revert or cherry-pick involve many commits the .git/sequencer
directory holds context for the action and no CHERRY_PICK_HEAD exist.
2014-09-14 12:02:36 +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
b85b09b78b 32662: vcs_info git: Fix stagedstr for empty repos
In empty repositories, HEAD is an unresolvable symbolic ref.  Start computing
stagedstr/unstagedstr in that case; for the former, use a different method
than the non-empty-repository case.
2014-06-02 15:17:04 +02:00
Daniel Shahaf
55d5feed30 32621: vcs_info svn: 'Fix set-branch-format' when in subdirs
The previous code would fail to detect the wcroot with Subversion 1.7+
when cwd is at least two levels below the root (i.e., ../../.svn exists
and ../.svn doesn't), and would then pass to the hook the revision and
basename of cwd rather than of the wcroot.
2014-05-29 16:50:07 +02:00
Daniel Shahaf
bb271217fe 32619: vcs_info svn: Use the revision of cwd
Previously, the value of the wc root would be used.  In Subversion,
it makes more sense to use the revision of cwd, since all commands
(e.g., 'svn ci', 'svnversion') operate only on cwd and below, not on
wcroot and below.
2014-05-29 16:50:07 +02:00
Daniel Shahaf
6a201af341 32597: vcs_info git: Describe detached heads symbolically.
This makes %b expand to a refname rather than a sha1 when HEAD is detached but
happens to match some ref (branch, tag, etc).  The resulting output will
typically contain a slash (e.g., "tags/v1.0.2", "heads/mybranch"), which helps
distinguish it from the output in the "HEAD is a symbolic ref" case.
2014-05-06 14:22:10 +02:00
Daniel Shahaf
eb4c70d0b7 32528: vcs_info: Add check-for-staged-changes 2014-04-05 10:56:52 +02:00
Frank Terbeck
82a3591f57 32264: vcs_info, hg: Support detecting repos using ShareExtension 2014-01-17 08:58:52 +01:00
Daniel Shahaf
c1a15fb152 32089: tweak to detect Subversion repository 2013-12-05 20:06:34 +00:00
Barton E. Schaefer
9972fdeead 32066: fix %r and %S in vcs_info formats when a repository subdirectory is accessed via a symlink
31985 Clemens Hammacher and 32064 Hong Xu
2013-11-29 12:32:36 -08:00
Frank Terbeck
88599a0508 31485: vcs_info, git: Avoid error messages for `guilt' users
Guilt uses the same internal directory for keeping state as stgit, but
it doesn't use the same files (not surprisingly). This caused error
messages due to missing files.

This fixes that by making the "stgit-active?" test stricter.

Reported-by: Axel Beckert <abe@debian.org>
2013-06-18 09:16:59 +02:00
Mikael Magnusson
44907223ff 31136: vcs_info: just set parameters instead of passing over a pipe 2013-03-10 13:18:32 +00:00
Mikael Magnusson
0c8625299a 30639: Add support for showing the current action is cherry-pick to vcs_info git backend 2013-03-10 12:47:39 +00:00
Frank Terbeck
2e6363ed50 Baptiste Daroussin: 30703: VCS_INFO_detect_fossil: Fix fossil detection on unix 2012-09-28 22:11:32 +00:00
Frank Terbeck
feb6169bcd Seth House: 30702: contrib.yo, VCS_INFO_get_data_hg: Removed --debug flag from the hg vcs_info backend 2012-09-28 22:07:29 +00:00
Frank Terbeck
3aae0ef8fe Stepan Koltsov: vcs_info: %a to output number of all patches in (no)?patch-format styles 2012-08-17 08:22:52 +00:00
Frank Terbeck
c45bb3e70c Juliano Ravasi: VCS_INFO_get_data_git: Fix initialisation of `$stgit_unapplied' 2012-05-23 07:39:48 +00:00
Mikael Magnusson
150dc9021b 30461, 30462 (tweaked): add missing local for match, mbegin and mend 2012-05-02 13:09:37 +00:00