From: Daniel Hahler <dhahler@gmail.com>
To: Zsh Hackers' List <zsh-workers@zsh.org>
Subject: [PATCH] vcs_info: use `--ignore-submodules=dirty` with diff/diff-index
Date: Mon, 22 Sep 2014 16:37:23 +0200 [thread overview]
Message-ID: <54203423.1040500@thequod.de> (raw)
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).
---
Functions/VCS_Info/Backends/VCS_INFO_get_data_git | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
index c243bf7..ee50be6 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
@@ -176,17 +176,17 @@ if (( querystaged || queryunstaged )) && \
[[ "$(${vcs_comm[cmd]} rev-parse --is-inside-work-tree 2> /dev/null)" == 'true' ]] ; then
# Default: off - these are potentially expensive on big repositories
if (( queryunstaged )) ; then
- ${vcs_comm[cmd]} diff --no-ext-diff --ignore-submodules --quiet --exit-code ||
+ ${vcs_comm[cmd]} diff --no-ext-diff --ignore-submodules=dirty --quiet --exit-code ||
gitunstaged=1
fi
if (( querystaged )) ; then
if ${vcs_comm[cmd]} rev-parse --quiet --verify HEAD &> /dev/null ; then
- ${vcs_comm[cmd]} diff-index --cached --quiet --ignore-submodules HEAD 2> /dev/null
+ ${vcs_comm[cmd]} diff-index --cached --quiet --ignore-submodules=dirty HEAD 2> /dev/null
(( $? && $? != 128 )) && gitstaged=1
else
# empty repository (no commits yet)
# 4b825dc642cb6eb9a060e54bf8d69288fbee4904 is the git empty tree.
- ${vcs_comm[cmd]} diff-index --cached --quiet --ignore-submodules 4b825dc642cb6eb9a060e54bf8d69288fbee4904 2>/dev/null
+ ${vcs_comm[cmd]} diff-index --cached --quiet --ignore-submodules=dirty 4b825dc642cb6eb9a060e54bf8d69288fbee4904 2>/dev/null
(( $? && $? != 128 )) && gitstaged=1
fi
fi
--
2.1.0
next reply other threads:[~2014-09-22 14:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-22 14:37 Daniel Hahler [this message]
2014-09-22 21:23 ` Frank Terbeck
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=54203423.1040500@thequod.de \
--to=dhahler@gmail.com \
--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).