git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kerrick Staley <mail@kerrickstaley.com>
To: Jonathan Nieder <jrnieder@gmail.com>, gitster@pobox.com
Cc: bash-completion-devel@lists.alioth.debian.org, git@vger.kernel.org
Subject: Re: bash-completion now loads completions dynamically, so __git_ps1 is not defined when you open a shell
Date: Wed, 28 Mar 2012 19:00:35 -0500	[thread overview]
Message-ID: <CANaWP3w9KDu57aHquRRYt8td_haSWTBKs7zUHy-xu0B61gmr9A@mail.gmail.com> (raw)
In-Reply-To: <20120328230642.GA16925@burratino>

On Wed, Mar 28, 2012 at 5:17 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Sorry, I don't quite get it.  "newer verions" of what?
>
> To me, completion scripts have always been to be dot-sourced early, making
> sure inclusion happen before PS1 is used.  Did we change anything recently
> to break it????

bash-completion 1.99 (still a "beta", but Arch Linux now ships it)
will automatically source the git-completion.bash script when you type
git <tab>. The script is no longer sourced when you first open a
shell.

There are two main ways to fix this:
1) define __git_ps1 (and friends) in a different script, which will
get installed in /etc/profile.d (this is the "proper way")
2) require that git-completion.bash always be loaded in the beginning
instead of on-the-fly (which is how it works now now)

I can submit a patch implementing option (1) if needed.

This is a very minor issue, but some recommendation from upstream
would be nice so that distros know how to handle this.

On Wed, Mar 28, 2012 at 6:06 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:
> Yes, I think so.  Do the release notes for version 2.0 of the
> /etc/bash_completion wrapper script mention this change?

I'm not sure, but the feature is definitely there. The branch
implementing this feature has been merged into the project's master
(see http://anonscm.debian.org/gitweb/?p=bash-completion/bash-completion.git;a=commit;h=b377dc5de84913b69efa325590e9d0bb97d02128).

-Kerrick

  reply	other threads:[~2012-03-29  0:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-28 20:27 bash-completion now loads completions dynamically, so __git_ps1 is not defined when you open a shell Kerrick Staley
2012-03-28 22:17 ` Junio C Hamano
2012-03-29  5:57   ` Jeff King
2012-03-28 23:06 ` Jonathan Nieder
2012-03-29  0:00   ` Kerrick Staley [this message]
2012-03-29  5:49     ` Jeff King
2012-04-07 13:01     ` Felipe Contreras
2012-04-07 13:47       ` Jonathan Nieder

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=CANaWP3w9KDu57aHquRRYt8td_haSWTBKs7zUHy-xu0B61gmr9A@mail.gmail.com \
    --to=mail@kerrickstaley.com \
    --cc=bash-completion-devel@lists.alioth.debian.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    /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).