From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 73ed912c for ; Sun, 24 Nov 2019 22:53:08 +0000 (UTC) Received: (qmail 25102 invoked by alias); 23 Nov 2019 22:15:43 -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: List-Unsubscribe: X-Seq: 44918 Received: (qmail 28077 invoked by uid 1010); 23 Nov 2019 22:15:43 -0000 X-Qmail-Scanner-Diagnostics: from mail-lf1-f67.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.0/25635. spamassassin: 3.4.2. Clear:RC:0(209.85.167.67):SA:0(-2.0/5.0):. Processed in 4.613918 secs); 23 Nov 2019 22:15:43 -0000 X-Envelope-From: mezin.alexander@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.167.67 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=yEkaFjKR6G2RDcl8IfU5j/+m/OqtTBfxHTGUoKcyLCg=; b=YE2z978sxCeWhkJxtDUEaQmE07nzdhrlcnJ6eVBmwRf5A0Le9hTpc54CDQSDuyGkFz wdvgKO90v1ZWF838Lapf8qQM8CqzuaWktmwLDmMJkSjEY/X8fAhsymXK/+7FkcPDrbuS Fb8Dg6gdVXaEexqLN925fZ3O5Nn6OdPhTzymcyTL6wTrmng2k2e1CbfBV9dgP1kkX3l1 aZDLXr0URTyBAjDxfHUTqhdEM/HFxzxuvQ8EmqDOwTLUF83Ak8WR0EPaGofp7T5GVfcV XI7mzZKLGlFPuTCYg4zLM+37aZU+09notqA5UVySifDermaYbpCHnB6VtvWMITfuKmvh QXwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=yEkaFjKR6G2RDcl8IfU5j/+m/OqtTBfxHTGUoKcyLCg=; b=Q8yU8OvCnBHzPYRLibVqCDXAGbT1Z+07ndpKmI9B6BaWhYUv0Dc8vAG11blZVrjjdH XZSHSHpQeDpwjqbdwWwFa14D+42PPBa1zG8GuM50brQRVNM/lCzyEA61fAFxIGQrEInG D0TlUPFMCyk+RKmlcrhlY9Tw69WIjbb+uNdTD26B4//hQ6YSDBCxiuALaWUfQBT3cfup jWs3yg60Ucf3oA9NM20JOgFfYqv4gTiAJHUs8m7Rk+Oifym7o2R/sqoOFKLM3T2Zga17 PVxTST5Iyzb45eVaOGdnQya2wpCevWBOueadDYrxL2KVdp4McMKk4zQPf7TNGYBfS4sC ENfQ== X-Gm-Message-State: APjAAAVRInbPiOTSynkHsKaNehfnN06lqWe6DOTWW2347dUuzpUF0zrP 3V1AAYI4J5RjcqyV3oE/U5IhwdLd9zR5YA== X-Google-Smtp-Source: APXvYqxJcEovrZKJCsEfII10Z9f7U9DjK0Ab0UfnZL06wdDwSM5psLLX5RbhYCqoF6Fn5rG6C7pDkQ== X-Received: by 2002:ac2:5499:: with SMTP id t25mr15849254lfk.157.1574547302670; Sat, 23 Nov 2019 14:15:02 -0800 (PST) From: Aleksandr Mezin To: zsh-workers@zsh.org Cc: Aleksandr Mezin Subject: [PATCH 0/3] vcs_info: handle nested repositories of different types Date: Sun, 24 Nov 2019 04:14:40 +0600 Message-Id: <20191123221443.279556-1-mezin.alexander@gmail.com> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Qmail-Scanner-2.11: added fake Content-Type header Content-Type: text/plain I've noticed that vcs_info doesn't correctly handle the case when a repository of one type is nested inside of a repository of another type. Example: - git repository in ~/git-repo - hg repository in ~/git-repo/hg-repo (it's not a submodule) - vcs_info called in ~/git-repo/hg-repo will output information about git-repo To fix this, I've made following changes: - Modified VCS_INFO_detect_{git,cvs} to set vcs_comm[basedir] (other backends do it) - Modified vcs_info to choose the repository with the longest vcs_comm[basedir] (as an absolute path) However, this logic may not work correctly for symlinked repositories, if VCS_INFO_detect_* functions will continue to use :P modifier for the basedir. Is there a reason why :P is used for basedir instead of :a? Aleksandr Mezin (3): vcs_info/git: set vcs_comm[basedir] in VCS_INFO_detect_git vcs_info/cvs: set vcs_comm[basedir] in VCS_INFO_detect_cvs vcs_info: choose the nearest repository .../VCS_Info/Backends/VCS_INFO_detect_cvs | 11 ++++++++-- .../VCS_Info/Backends/VCS_INFO_detect_git | 1 + .../VCS_Info/Backends/VCS_INFO_get_data_cvs | 6 +----- .../VCS_Info/Backends/VCS_INFO_get_data_git | 2 +- Functions/VCS_Info/vcs_info | 21 +++++++++++++------ 5 files changed, 27 insertions(+), 14 deletions(-) -- 2.24.0