Bug 4473 - git-prompt package causes ugly login for pdksh users
Summary: git-prompt package causes ugly login for pdksh users
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Shlomi Fish
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-10 23:23 CET by Ryan McCoskrie
Modified: 2012-03-09 08:20 CET (History)
2 users (show)

See Also:
Source RPM: git
CVE:
Status comment:


Attachments

Description Ryan McCoskrie 2012-02-10 23:23:38 CET
Description of problem:

When I start a shell session with pdksh while the git-prompt package is installed I get an error message along these lines ahead of the prompt:

[1] 13639
__git_ps1 not found
[1] + Done (1)             whence -v __git_ps1

It only happens once per session but it is annoying.

How reproducible:
Absolutely every time.


Steps to Reproduce:
1: Install pdksh and git-prompt
2: Start a session with ksh/pdksh.
3: If this does not happen try using ksh -l
Remco Rijnders 2012-02-27 13:23:27 CET

CC: (none) => remco

Comment 1 Remco Rijnders 2012-02-28 21:28:21 CET
Hi Ryan,

I can confirm this issue. Having had a further look, I see it is caused by this:

if type __git_ps1 &>/dev/null; then
  export PS1="$(echo -n "$PS1" | sed "s|\\\W\]|\\\W\$(type __git_ps1 \&>/dev/null \&\& __git_ps1 \" (%s)\")\]|")"
fi

which appears in /etc/profile.d/93git-branch.sh
which in turn is read by /etc/profile .

pdksh has 'type' aliased as 'whence -v', and that's why you see what you see.

Now we know where the problem is, the next question is which package is responsible for fixing it? pdksh? setup? (the owner of /etc/profile) git? (the owner of 93git-branch.sh)

Cc'ing the maintainer of git on this report to see if he has any thoughts on this.

CC: (none) => shlomif

Comment 2 Remco Rijnders 2012-03-01 11:44:00 CET
Hi Shlomi,

Assigning to you as maintainer of git. If you accept this bug report, please set status to assigned. If you feel you are not the proper person to fix this, assign it back to bugsquad.

Assignee: bugsquad => shlomif
Source RPM: (none) => git

Comment 3 Shlomi Fish 2012-03-01 18:10:02 CET
(In reply to comment #2)
> Hi Shlomi,
> 
> Assigning to you as maintainer of git. If you accept this bug report, please
> set status to assigned. If you feel you are not the proper person to fix this,
> assign it back to bugsquad.

OK, I think that type ought to work fine in pdksh, and if it doesn't it's a pdksh bug. According to http://en.wikipedia.org/wiki/Korn_shell , it has some forks that are more actively maintained such as mksh and oksh. Can you try seeing if this is fixed in mksh? If so, we may wish to package it instead of pdksh and deprecate pdksh.

Regards,

-- Shlomi Fish
Comment 4 Remco Rijnders 2012-03-07 07:31:28 CET
(In reply to comment #3)
> OK, I think that type ought to work fine in pdksh, and if it doesn't it's a
> pdksh bug. 

@Shlomi,

As discussed on -dev and IRC, "type" is a bashishm that has no place in #!/bin/sh scripts (#!/bin/bash would be ok). The type command is not part of the POSIX shell specifications. As such, this probably has to be worked around in either the git-prompt file, or the package which sources *.sh from /etc/profile.d for all shells.

> According to http://en.wikipedia.org/wiki/Korn_shell , it has some
> forks that are more actively maintained such as mksh and oksh. Can you try
> seeing if this is fixed in mksh? If so, we may wish to package it instead of
> pdksh and deprecate pdksh.

@Ryan,

Is there a particular reason for using pdksh, or would any ksh work for your particular needs? This because it might be a good idea indeed to switch to / have Mageia ship a better maintained korn shell.
Comment 5 Ryan McCoskrie 2012-03-07 20:07:14 CET
@Remco,
That was the one that I knew definitely was under a non-proprietary license. In future  I'll avoid relying on heavily dated information on such issues.
Comment 6 Remco Rijnders 2012-03-07 20:12:09 CET
Ryan, not your fault for using a package Mageia ships! And I'm not seeing an alternative ksh packaged either.

So, your bug report seems very valid to me.
Comment 7 Shlomi Fish 2012-03-08 19:11:35 CET
The problem was the "&>" - not the use of "type" which is OK in pdksh.

It is now fixed in git-1.7.9.2-2.mga2.src.rpm which was just submitted to the build system. Please let me know if it works for you and if so we can close this bug.

Regards,

-- Shlomi Fish
Comment 8 Remco Rijnders 2012-03-09 08:20:13 CET
Hi Shlomi,

I just installed 1.7.9.3-1 on Beta 1 and confirm the problem no longer appears. Closing this report as fixed. Thanks!

@Ryan, should you still have problems, you can reopen the bug report.

Status: NEW => RESOLVED
Resolution: (none) => FIXED


Note You need to log in before you can comment on or make changes to this bug.