From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14460 invoked by alias); 23 Mar 2015 02:05:36 -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: 34761 Received: (qmail 15429 invoked from network); 23 Mar 2015 02:05:32 -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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=thequod.de; h= content-transfer-encoding:content-type:content-type:subject :subject:mime-version:user-agent:from:from:date:date:message-id :received:received; s=postfix2; t=1427076329; bh=pudJ90b8e9/TyoI bJdtUHpOxhBYHQTVcwqo+87rhE0o=; b=EunWVlv5P7VFhk0E1skBkNYXnKq+769 eZRM25KtXIvNJ5T3xP4E+fYPpYJElCVYyLI1QDGd3W5mJqhMWeCcvAcNY9awTD/U ZCekDoQMLOgggOKtgwB/3TuoN6fTW0AbCZHu3IpejzLBkcqDkX49a2x5wLqODHwd g9kknODGbDcM= Message-ID: <550F74E9.40909@thequod.de> Date: Mon, 23 Mar 2015 03:05:29 +0100 From: Daniel Hahler User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Zsh Hackers' List Subject: completion: git: mutual exclusive handling of patch diff options Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, __git_setup_diff_options makes the assumption that different options cannot be used together, based on: diff_types='(-p -u --patch -U --unified --raw --patch-with-raw --stat --numstat --shortstat --dirstat --dirstat-by-file --summary --patch-with-stat --name-only --name-status --cumulative -s --no-patch)' But "git diff --stat -p" is a useful combination, and Zsh will currently only complete "changed in working tree file" after this. I've noticed this because I've changed my "gd" alias to: "git diff - --submodule --stat -p" Options like "--name-only" can only be used alone, but there's also no error when using "-p" or "--stat" with it. For my alias I can use "--patch-with-stat" (instead of "-p --stat"), but then the completion would still be broken for "gd --no-patch" (in case you would not want a diff-stat once). I think the options shouldn't be mutual exclusive here in general, but only where it makes sense, e.g. "--name-only". It seems like the reason for only using "changed in working tree files" is that the previous word is not recognized as an option nor as a commit/blob/reference. Maybe that restriction could be also lifted to skip/ignore any arguments starting with a dash ("-"). Otherwise any new options to git-diff, which are not handled by the completion would cause the same problem when being used. Regards, Daniel. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iD8DBQFVD3TpfAK/hT/mPgARAhyaAJ9N5WNsYn5WBxHZ0TSSpjtGXxPdcgCg+5ff Z2jKc9ic4emhOjEHtEDPEEs= =jg4S -----END PGP SIGNATURE-----