git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: martin f krafft <madduck-JX/+c5DPh7vR7s880joybQ@public.gmane.org>
To: "git-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<git-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	vcs-home
	<vcs-home-qhrM8SXbD5JdXEZaVTQqel6hYfS7NtTn@public.gmane.org>
Subject: Re: cdgit: cd relative to git workdir root
Date: Tue, 17 Sep 2013 07:33:04 +0200	[thread overview]
Message-ID: <20130917053303.GF5390@fishbowl> (raw)
In-Reply-To: <201309162101.14879.thomas-5j3myg3OO4w@public.gmane.org>


[-- Attachment #1.1: Type: text/plain, Size: 964 bytes --]

also sprach Thomas Koch <thomas-5j3myg3OO4w@public.gmane.org> [2013.09.16.2101 +0200]:
> shell alias cdgit = cd $(git root)

I've tried to make this happen many years ago, but I never finished
the ZLE widget that did it. The idea was to bind 'tab' to a function
that would replace an occurrence of ~g in $LBUFFER with the output
of rev-parse--show-toplevel and then delegate to normal tab
expansion.

So now I just have

  hash -d g=$(git rev-parse --show-toplevel)

in a pre-prompt function and get the same effect.

  fishbowl:~/code/salt|develop|debian% ls ~g/debi<tab>

-- 
martin | http://madduck.net/ | http://two.sentenc.es/
 
"i am not in favour of long engagements. they give people the
 opportunity of finding out each other's character before marriage,
 which i think is never advisable."
                                                        -- oscar wilde
 
spamtraps: madduck.bogus-JX/+c5DPh7vR7s880joybQ@public.gmane.org

[-- Attachment #1.2: Digital signature (see http://martin-krafft.net/gpg/sig-policy/999bbcc4/current) --]
[-- Type: application/pgp-signature, Size: 1124 bytes --]



      parent reply	other threads:[~2013-09-17  5:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-16 19:01 cdgit: cd relative to git workdir root Thomas Koch
2013-09-16 19:25 ` Adam Spiers
     [not found] ` <201309162101.14879.thomas-5j3myg3OO4w@public.gmane.org>
2013-09-17  5:33   ` martin f krafft [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130917053303.GF5390@fishbowl \
    --to=madduck-jx/+c5dph7vr7s880joybq@public.gmane.org \
    --cc=git-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=vcs-home-qhrM8SXbD5JdXEZaVTQqel6hYfS7NtTn@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).