Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: completion: git: --fixup: problem with _describe -2V and duplicate commit subjects
- X-seq: zsh-workers 35125
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Daniel Hahler <genml+zsh-workers@xxxxxxxxxx>
- Subject: Re: completion: git: --fixup: problem with _describe -2V and duplicate commit subjects
- Date: Thu, 14 May 2015 14:28:00 +0000
- Cc: Zsh Hackers' List <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=NFShUmXWgRarNVP0JjxhS7PedZ0=; b=OLu7sB xgARw/wkEqCKNx/S5bC+DPvhkmLx9rT8fSXdR5/uUCLgRZ4D3GDDZbNUztXjgDVO 2RMhWWb+oB73BTROIgkaZ9CKMu3B+AXMgQ4x4mfDWfEdTeWpmw0mLwzWXLRFDtMl XaBhV6DTnzyhmL3YbnwR54T8Wd6Ng8E70Cty8=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=NFShUmXWgRarNVP0JjxhS7PedZ0=; b=HW32t isik6EwzyNLiCLNfrEZijdhq/n0wiYyNqK/7i8Todc2IET9ynTSU2cyFdWyrOTo6 jrVPuBkhxarhc8K1Kc0SDRi0NbR/J8nBaiNM/2Z+M/s0n5bkvfNp3/62QUSDXj1c KFR8XnaUH6WAePFCirrG9me8Q3CopQD1/g2BS4=
- In-reply-to: <5553466C.7060100@thequod.de>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <5510AAD4.8040807@thequod.de> <20150329054753.GA2766@tarsus.local2> <20150330182141.GC3767@tarsus.local2> <5553466C.7060100@thequod.de>
Daniel Hahler wrote on Wed, May 13, 2015 at 14:41:16 +0200:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 30.03.2015 20:21, Daniel Shahaf wrote:
> > Daniel Shahaf wrote on Sun, Mar 29, 2015 at 05:47:53 +0000:
> >>> As a workaround I could imagine also adding the date, which is useful
> >>> by itself:
> > ...
> >> Actually, I'm tempted to deduplicate it by throwing the hash into the
> >> description:
> >
> > Another option: add the "HEAD~15" gitrevisions(7) identifier of the
> > commit to the description, which also uniquifies, isn't redundant, and
> > may be easier to type.
> >
> > ...
> >
> > I came up with this because copying the hex digits is annoying. (It's
> > basically a captcha.) I'm half seriously considering binding '=' to
> > a widget that inserts '=<TAB>HEAD~' if [[ $LBUFFER == *--fixup ]], to
> > allow me to type just '--fixup=12' to get '--fixup=HEAD~12'.
>
> I like this idea. Have you experimented further with it?
Nope, but here it is if anyone wants it:
equal_for_git_fixup() {
zle .self-insert
if [[ $LBUFFER == *--fixup= ]] ; then
zle complete-word
LBUFFER+="HEAD~"
fi
}
zle -N equal_for_git_fixup
bindkey '=' equal_for_git_fixup
It'd be especially useful if "HEAD~15" were offered as completions (not
just as descriptions). However, we can't simply add both the hash and
the HEAD~$n name of the commit to the 'descr' array, due to the bug in
'_describe -2V' when a description is repeated (workers/34814).
So we'd need to fix 34814 in order to add the HEAD~$n as completions.
I'll post about that separately.
Daniel
Messages sorted by:
Reverse Date,
Date,
Thread,
Author