[MacPorts] #37462: git: Actual bash_completion dir implies in bug on hub and git-flow bash completion
#37462: git: Actual bash_completion dir implies in bug on hub and git-flow bash completion ---------------------------------------+-------------------------------- Reporter: robsonpeixoto@… | Owner: macports-tickets@… Type: defect | Status: new Priority: High | Milestone: Component: ports | Version: 2.1.2 Keywords: haspatch, bash_completion | Port: git-core ---------------------------------------+-------------------------------- If change bash completion from ${destroot}${prefix}/share/bash-completion/completions to ${destroot}${prefix}/etc/bash_completion.d the git-flow completion and hub work very well. -- Ticket URL: <https://trac.macports.org/ticket/37462> MacPorts <http://www.macports.org/> Ports system for Mac OS
#37462: git-core: Actual bash_completion dir implies in bug on hub and git-flow bash completion ------------------------------+------------------------- Reporter: robsonpeixoto@… | Owner: ciserlohn@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: haspatch Port: git-core | ------------------------------+------------------------- Changes (by ciserlohn@…): * cc: ciserlohn@… (removed) * keywords: haspatch, bash_completion => haspatch * priority: High => Normal * owner: macports-tickets@… => ciserlohn@… Comment: Please note that priority 'high' is reserved for MacPorts team members. -- Ticket URL: <https://trac.macports.org/ticket/37462#comment:1> MacPorts <http://www.macports.org/> Ports system for Mac OS
#37462: git-core: Actual bash_completion dir implies in bug on hub and git-flow bash completion ------------------------------+------------------------- Reporter: robsonpeixoto@… | Owner: ciserlohn@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: haspatch Port: git-core | ------------------------------+------------------------- Comment (by robsonpeixoto@…): ping -- Ticket URL: <https://trac.macports.org/ticket/37462#comment:2> MacPorts <http://www.macports.org/> Ports system for Mac OS
#37462: git-core: Actual bash_completion dir implies in bug on hub and git-flow bash completion ------------------------------+------------------------- Reporter: robsonpeixoto@… | Owner: ciserlohn@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: haspatch Port: git-core | ------------------------------+------------------------- Changes (by raimue@…): * cc: raimue@… (added) Comment: The bash completion works for me as is. Can you please be more specific what kind of problems you are seeing? The directory `${prefix}/etc/bash_completion.d/` is deprecated and only available for compatibility. -- Ticket URL: <https://trac.macports.org/ticket/37462#comment:3> MacPorts <http://www.macports.org/> Ports system for Mac OS
#37462: git-core: Actual bash_completion dir implies in bug on hub and git-flow bash completion ------------------------------+------------------------- Reporter: robsonpeixoto@… | Owner: ciserlohn@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: haspatch Port: git-core | ------------------------------+------------------------- Comment (by robsonpeixoto@…): The bash-completion from git flow and hub git-prompt aren't working in ${prefix}/share/bash-completion/completions. The git-prompt aren't working on ${prefix}/share/bash- completion/completions, too. But if I put all git related on ${prefix}/etc/bash_completion.d/, everything works. On ${prefix}/share/bash-completion/completions only work the git-extras and git-core bash-completion -- Ticket URL: <https://trac.macports.org/ticket/37462#comment:4> MacPorts <http://www.macports.org/> Ports system for Mac OS
#37462: git-core: Actual bash_completion dir implies in bug on hub and git-flow bash completion ------------------------------+------------------------- Reporter: robsonpeixoto@… | Owner: ciserlohn@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: haspatch Port: git-core | ------------------------------+------------------------- Comment (by raimue@…): I cannot reproduce the issue. I have the files installed by the current ports. I can use `git <Tab>` in my bash to see the list of valid git commands. I don't know what "git flow" or "hub git-prompt" is, so please give me a way to reproduce the issue. {{{ $ port -q installed active and \( 'git*' 'bash*' \) bash @4.2.42_0 (active) bash-completion @2.0_1 (active) git-core @1.8.1.1_0+bash_completion+credential_osxkeychain+doc+pcre+python27 (active) git-flow @0.4.1_0 (active) }}} -- Ticket URL: <https://trac.macports.org/ticket/37462#comment:5> MacPorts <http://www.macports.org/> Ports system for Mac OS
#37462: git-core: Actual bash_completion dir implies in bug on hub and git-flow bash completion ------------------------------+------------------------- Reporter: robsonpeixoto@… | Owner: ciserlohn@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: worksforme | Keywords: haspatch Port: git-core | ------------------------------+------------------------- Changes (by ciserlohn@…): * status: new => closed * resolution: => worksforme Comment: @robsonpeixoto:[[BR]] Not sure what you mean, but both {{{git-prompt.sh}}} and [https://github.com/bobthecow/git-flow-completion git-flow completion] work fine for me. You find the {{{git-prompt.sh}}} here: {{{${prefix}/local/share/git-core /git-prompt.sh}}} and not in {{{${prefix}/share/bash- completion/completions/}}} Make sure you have something like this in your {{{.profile}}} or {{{.bashrc}}} {{{ if [ -f /opt/local/share/git-core/git-prompt.sh ]; then . /opt/local/share/git-core/git-prompt.sh fi }}} Add something like this to your {{{.profile}}} or {{{.bashrc}}} {{{ if [ -f ~/.git-flow-completion.bash ]; then . ~/.git-flow-completion.bash fi }}} and you can use {{{git flow <TAB>}}} to see a list of valid git-flow commands. -- Ticket URL: <https://trac.macports.org/ticket/37462#comment:6> MacPorts <http://www.macports.org/> Ports system for Mac OS
#37462: git-core: Actual bash_completion dir implies in bug on hub and git-flow bash completion ------------------------------+------------------------- Reporter: robsonpeixoto@… | Owner: ciserlohn@… Type: defect | Status: reopened Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: haspatch Port: git-core | ------------------------------+------------------------- Changes (by robsonpeixoto@…): * status: closed => reopened * resolution: worksforme => Comment: I had the `hub` installed and a created the alias `git='hub'` as the port suggest. When I try to use the bash-completion of hub using the git command, all commands of hub aren't completed. Like it: {{{ #!sh $ git f<tab> fetch filter-branch format-patch fsck }}} After move the bash-completion from `/opt/local/share/bash- completion/completions` to `/opt/local/etc/bash_completion.d` it's working very well. Now are showing the '''fork''' command. {{{ $!sh $ git f<tab> fetch filter-branch fork format-patch fsck }}} I'm attaching the file `git-bash-completion.patch` moving the bash- completion to `/opt/local/etc/bash_completion.d` -- Ticket URL: <https://trac.macports.org/ticket/37462#comment:7> MacPorts <http://www.macports.org/> Ports system for OS X
#37462: git-core: Actual bash_completion dir implies in bug on hub and git-flow bash completion ------------------------------+------------------------- Reporter: robsonpeixoto@… | Owner: ciserlohn@… Type: defect | Status: reopened Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: haspatch Port: git-core | ------------------------------+------------------------- Comment (by raimue@…): Moving the git completion back to `${prefix}/etc/bash_completion.d` should be avoided as it forces loading of the script each time a shell is started. This is the main advantage of bash-completion >= 2.0, as scripts are only loaded when actually required. The hub completion is just not compatible with bash-completion >= 2.0. Anyway, bash-completion does not work with other aliases either, so I don't think moving the git completion around just for the sake of hub's incompatible completion is the best solution. -- Ticket URL: <https://trac.macports.org/ticket/37462#comment:8> MacPorts <http://www.macports.org/> Ports system for OS X
#37462: git-core: Actual bash_completion dir implies in bug on hub and git-flow bash completion ------------------------------+------------------------- Reporter: robsonpeixoto@… | Owner: ciserlohn@… Type: defect | Status: reopened Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: haspatch Port: git-core | ------------------------------+------------------------- Comment (by robsonpeixoto@…): But it will help a lot with hub, git-flow and maybe with other tools. -- Ticket URL: <https://trac.macports.org/ticket/37462#comment:9> MacPorts <http://www.macports.org/> Ports system for OS X
#37462: git-core: Actual bash_completion dir implies in bug on hub and git-flow bash completion ------------------------------+------------------------- Reporter: robsonpeixoto@… | Owner: ciserlohn@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: fixed | Keywords: haspatch Port: git-core | ------------------------------+------------------------- Changes (by raimue@…): * status: reopened => closed * resolution: => fixed Comment: Completion for git-flow works, only `hub` causes issues. The problem is that you want the completion for `hub` to be loaded although you are typing the command `git`. This is unsupported by bash-completion and the existing <2.0 implementation is a hack. At the moment, the completion file for `hub` expects the completion file for `git` to be loaded beforehand as it merely modifies the existing completion. The load order is not guaranteed even if they are both in the old `${prefix}/etc/bash_completion.d` directory. I updated the hub completion to work properly with bash-completion >= 2.0 in r112130 and r112131. This does not solve the problem of the alias. However, this is the case for all bash-completion script and thus, out of scope of this request and would need to be addressed upstream. As a workaround, if you really want this to work now, add it now in the following way to your `~/.bashrc`: {{{ alias git='hub' source /opt/local/share/bash-completion/completions/hub }}} -- Ticket URL: <https://trac.macports.org/ticket/37462#comment:10> MacPorts <http://www.macports.org/> Ports system for OS X
#37462: git-core: Actual bash_completion dir implies in bug on hub and git-flow bash completion ------------------------------+------------------------- Reporter: robsonpeixoto@… | Owner: ciserlohn@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: fixed | Keywords: haspatch Port: git-core | ------------------------------+------------------------- Comment (by robsonpeixoto@…): Thanks! =D I need to reinstall hub: {{{ #!sh sudo port uninstall hub sudo port -s install hub }}} -- Ticket URL: <https://trac.macports.org/ticket/37462#comment:11> MacPorts <http://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts