From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3634 invoked by alias); 25 Oct 2015 18:42:58 -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: 36959 Received: (qmail 9244 invoked from network); 25 Oct 2015 18:42:55 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=y8h4fNssuI4kiK145gKBiNaACaM=; b=Ad/CFD 11ZMjpf4ipx/5hLGxgIZP8NB4fs2zJJF1GvOeYtFEbUS/vmgiV9yWmSyNfrgZ6iS WI5+/9wtMR4tXX70k7YkZYRQ+1pCMTE0zw3JYXSnQ8gIFeWNAmA2uxcchHG3zzIy B1WCaxGtptCrriE82CZEvpokQa0XAMG4z96l4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=y8h4fNssuI4kiK145gKBiNaACaM=; b=bOIGO vun7qIs35mj2S9qC+vWD+pyyP7YiOh1jR/DqOln9KyMwaiJQ08tFLvKgeMUTPEcu Ce3a1bzlD/4oH6rKJnGepjsdVyuxPqsWwwdKR+Ko5KzCLPOSCFKpu7v1y+opDs9v ySdRTVxpT+dfRb9jrwg+tfETQOp5kWvMGcENVI= X-Sasl-enc: JtbLPKyEhXg3uCQ1Ut1Li6RgYTghNDHUoMH1pfyZ5yaf 1445798102 Date: Sun, 25 Oct 2015 18:34:58 +0000 From: Daniel Shahaf To: zsh-workers@zsh.org Subject: [PATCH 2/5] _git: Offer @~$n as completion of recent commits. Message-ID: <20151025183458.GK11372@tarsus.local2> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.5.21 (2010-09-15) Suggested-by: Oliver Kiddle (users/20705) --- Output after the first two patches: % git commit --fixup= ed49c5f @~0 - [HEAD] _git: Offer @~$n as completion of recent commits. (2 minutes ago) ⋮ 2685bbc @~6 - [HEAD~6] Merge branch 'master' of git://git.code.sf.net/p/zsh/code (15 hours ago) 506d592 @~7 - [HEAD~7] 36943: restore scan for reclaimable blocks in freeheap() (15 hours ago) e3c6845 - [e3c6845] unposted: _beep completion: Actually hook it for the 'beep' command. (15 hours ago) 779b311 - [779b311] 36913 + 36945: vcs_info quilt: Pass patch subject lines to gen-applied-string (15 hours ago) c62db9e - [c62db9e] 36912: vcs_info quilt: Tolerate being in child of .pc's parent (15 hours ago) 272119b @~8 - [HEAD~8] unposted: small typo again (16 hours ago) c8c42d6 @~9 - [HEAD~9] unposted: small typo (16 hours ago) Completion/Unix/Command/_git | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 7f9881f..11e2395 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -5695,13 +5695,14 @@ __git_recent_commits () { else label="[HEAD~$distance_from_head]" fi + descr+=("@~${distance_from_head}":"${label} $k") # CROSSREF: use the same label as below # Prepare for the next first-parent-ancestry commit. (( ++distance_from_head )) next_first_parent_ancestral_line_commit=${parents%% *} fi # label is now 9 bytes, so the descriptions ($k) will be aligned. - descr+=($i:"${label} $k") + descr+=($i:"${label} $k") # CROSSREF: use the same label as above j=${${j# \(}%\)} # strip leading ' (' and trailing ')' j=${j/ ->/,} # Convert " -> master, origin/master". -- 2.1.4