git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Matěj Cepl" <mcepl@cepl.eu>
To: "avih" <avihpit@yahoo.com>, "Taylor Blau" <me@ttaylorr.com>
Cc: "SZEDER Gábor" <szeder.dev@gmail.com>,
	"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: bash prompt evaporates in subdirectories
Date: Thu, 24 Oct 2024 15:33:09 +0200	[thread overview]
Message-ID: <D542P2ZTHIUJ.2GEJYE41VTC0J@cepl.eu> (raw)
In-Reply-To: <1101848017.3146876.1729770380522@mail.yahoo.com>

[-- Attachment #1: Type: text/plain, Size: 3670 bytes --]

On Thu Oct 24, 2024 at 1:46 PM CEST, avih wrote:
> - What is the "innermost" distro where this happens? Thumbleweed?
>   which version?

Yes, Tumbleweed (actually MicroOS uses Tumbleweed packages as
well), which is a rolling distro and I updated (almost) daily, so
it is hard to say which version.

> - Which git version do you have installed? How did you install it?

mitmanek:~ $ rpm -qf "$(which git)"
git-core-2.47.0-1.1.x86_64
mitmanek:~ $ 

> - How did you install the git-prompt support?

Using the git-prompt.sh from the package, but it seems to be the same as the upstream one in contrib/

mitmanek:~ $ rpm -qf /bin/bash
bash-5.2.37-14.2.x86_64
mitmanek:~ $ rpm -qf /usr/share/bash-completion/completions/git-prompt.sh
git-core-2.47.0-1.1.x86_64
mitmanek:~ $ diff -u \
    /usr/share/bash-completion/completions/git-prompt.sh \
    <(curl -L -s https://github.com/git/git/raw/refs/heads/master/contrib/completion/git-prompt.sh)
mitmanek:~ $ 

> - Which shell do you use? (bash? zsh? something else?)

bash with ble.sh (freshly updated, but the problem can be reproduced even without it)

> - How is the (git) prompt set in your shell startup file? (~/.bashrc,
>   or ~/.profile, etc). If you don't know exactly, then can you please
>   attach your shell startup files?

* /etc/bash.bashrc is
  https://mcepl.fedorapeople.org/tmp/bash.bashrc (the
  standard openSUSE one with the addition of loading
  /etc/profile.d/distrobox_profile.sh)
* /etc/profile is https://mcepl.fedorapeople.org/tmp/profile
  (git is not mentioned anywhere in /etc/profile.d)
* /etc/bash_completion.d/git-prompt is
  https://mcepl.fedorapeople.org/tmp/git-prompt (so, yes
  git-prompt may be attempted to be loaded twice)
* /etc/profile.d/distrobox_profile.sh is
  https://mcepl.fedorapeople.org/tmp/distrobox_profile.sh
* ~/.bashrc is https://mcepl.fedorapeople.org/tmp/bashrc
* ~/.config/blesh/init.sh is
  https://mcepl.fedorapeople.org/tmp/init.sh

> - Can you provide a sample repository to clone which reproduces the
>   issue? for instance, you can pick a small repo from github.

Basically any git repository which has more than one
level of directories, I spent most of my time in
https://git.sr.ht/~mcepl/m2crypto, so when I do `cd src` the git
status evaporates.

> - What are the steps to reproduce the issue? is it enough to "cd"
>   into an existing sub-dir at the git dir? or is it only broken
>   when creating an unrelated sub-dir and "cd" into it? better yet,
>   provide a 1:... 2:... 3:... steps which reproduce the issue for
>   you, and which others can try to follow.

Yes, just run `cat <(curl -L -s https://mcepl.fedorapeople.org/tmp/typescript)`

>    sudo zypper install bash-git-prompt

I don’t have this package installed at all, using the script from git-core.

>      . ~/git-prompt.sh
>      PS1='\w$(__git_ps1)\n\$ '

Yes, that works:

mitmanek:~ $ export PS1='\w$(__git_ps1)\n\$ '
~
$ ~/repos/m2crypto
cd -- /home/matej/repos/m2crypto
~/repos/m2crypto (master $)
$ cd src
~/repos/m2crypto/src (master $)
$ 

So, the problem is somewhere in my too complicated configuration. Any idea, where?

Thank you for your help so far!

Matěj

-- 
http://matej.ceplovi.cz/blog/, @mcepl@floss.social
GPG Finger: 3C76 A027 CA45 AD70 98B5  BC1D 7920 5802 880B C9D8
 
Books aren’t written - they’re rewritten. Including your own. It
is one of the hardest things to accept, especially after the
seventh rewrite hasn’t quite done it.
  -- Michael Crichton, alluding to Steele MacKaye (1889) article
     where he said this about theater plays.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 216 bytes --]

  parent reply	other threads:[~2024-10-24 13:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-22 15:02 bash prompt evaporates in subdirectories Matěj Cepl
2024-10-22 15:53 ` Taylor Blau
2024-10-24 10:17   ` Matěj Cepl
2024-10-24 11:46     ` avih
2024-10-24 12:35       ` avih
2024-10-24 13:33       ` Matěj Cepl [this message]
2024-10-24 14:19         ` avih
2024-10-24 14:26         ` RESOLVED [Was: Re: bash prompt evaporates in subdirectories] Matěj Cepl
2024-10-24 15:50           ` Taylor Blau
2024-10-24 20:03           ` avih

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=D542P2ZTHIUJ.2GEJYE41VTC0J@cepl.eu \
    --to=mcepl@cepl.eu \
    --cc=avihpit@yahoo.com \
    --cc=git@vger.kernel.org \
    --cc=me@ttaylorr.com \
    --cc=szeder.dev@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).