From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22655 invoked by alias); 22 Sep 2014 14:37:32 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 33217 Received: (qmail 2016 invoked from network); 22 Sep 2014 14:37:30 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:message-id:date:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=CpyqMft4SNnhB2PYK4GwQOzCwJayQI4OBUtt9yWV4wU=; b=P5PNpKkfPKGQrvTP4W5ypkY8BNRCkjhG9qbC+2JSjXPzjk6iatzOtipt/vZFnMhJ5c rff9uxYn/YZ3EYK8mcC0F2UNEQqyI6MAlvFEQXcKg6jDJreM3qOl7YeIpipyvqAm+DaS I40f5bMqSp7KoBR0jDYz4u1Td6y231tuFtCFhrFmC7vsE+EM+jKSYkxXvJmgamBg8fuG BqeGu5kCWpFf9YiMuEao3kcgGg1VYfraZ0B6AaJ+pDG4RWwIFtXKNV/WQX/T0D3LUBt2 9Hv4yBCH3lqHIGWXjSRcJAYrO4QP5HrSLeLiPLH9jBHuZIbSilzuxZ0+dXKjqKNzv05c Ah1g== X-Received: by 10.112.13.232 with SMTP id k8mr3206904lbc.81.1411396645845; Mon, 22 Sep 2014 07:37:25 -0700 (PDT) From: Daniel Hahler X-Google-Original-From: Daniel Hahler Message-ID: <54203423.1040500@thequod.de> Date: Mon, 22 Sep 2014 16:37:23 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: Zsh Hackers' List Subject: [PATCH] vcs_info: use `--ignore-submodules=dirty` with diff/diff-index Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit 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