Bug 231775 - devel/git: not all bash contrib scripts linked to /usr/local/etc/bash_completion.d
Summary: devel/git: not all bash contrib scripts linked to /usr/local/etc/bash_complet...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Renato Botelho
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-28 08:34 UTC by pierogmorski
Modified: 2018-09-28 21:17 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (garga)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description pierogmorski 2018-09-28 08:34:02 UTC
Hi,

I've noticed the devel/git/Makefile doesn't link git-prompt.sh to /usr/local/etc/bash_completion.d.  Further, it links git-completion.bash to /usr/local/etc/bash_completion.d/git.sh.

# l /usr/local/etc/bash_completion.d/
total 35
drwxr-xr-x   2 root  wheel      6 Sep 22 14:13 .
drwxr-xr-x  35 root  wheel     57 Sep 28 00:50 ..
-rw-r--r--   1 root  wheel  19809 Sep 12 18:33 _pkg.bash
-r-xr-xr-x   1 root  wheel    559 Sep 12 18:38 dbus-bash-completion.sh
lrwxr-xr-x   1 root  wheel     59 Sep 19 18:46 git.sh -> ../../share/git-core/contrib/completion/git-completion.bash
-rw-r--r--   1 root  wheel   4603 Sep 12 18:47 tmux

This appears a non-standard approach.  Homebrew on OSX links them both using their original filenames, for example.  Could you please comment?  There's also the csh and zsh completion files, but those are outside my scope.

FreeBSD 11.2, git 2.19.

Thanks!
Comment 1 Renato Botelho freebsd_committer freebsd_triage 2018-09-28 11:47:49 UTC
(In reply to pierogmorski from comment #0)

Both git-prompt.sh and git-completion.bash are available under /usr/local/share/git-core/contrib/completion/ when CONTRIB option is selected.

git-prompt.sh is a script to help users to configure bash's prompt to show git information, it's not a completion related script so IMO it doesn't belong to /usr/local/etc/bash_completion.d

git-completion.bash is installed there as git.sh for a long time, before I adopted this port. I never changed that to avoid breaking users' configuration.

I agree it's non standard so I'll work on a change to install it keeping original name and add a notice in pkg-message.
Comment 2 commit-hook freebsd_committer freebsd_triage 2018-09-28 12:48:56 UTC
A commit references this bug:

Author: garga
Date: Fri Sep 28 12:48:38 UTC 2018
New revision: 480858
URL: https://svnweb.freebsd.org/changeset/ports/480858

Log:
  devel/git: Keep original bash completion filename

  Do not rename git-completion.bash to git.sh to make it easier for users
  that follow git docs, which point to original filename. Add a note in
  pkg-message to let users know about it.

  PR:		231775
  Submitted by:	pierogmorski@gmail.com
  Sponsored by:	Rubicon Communications, LLC (Netgate)

Changes:
  head/devel/git/Makefile
  head/devel/git/pkg-message
  head/devel/git/pkg-plist
Comment 3 pierogmorski 2018-09-28 21:17:33 UTC
(In reply to Renato Botelho from comment #1)

Renato,

First off, thanks for the blindingly quick turnaround with this.

You make a reasonable argument re: git-prompt.sh.  Agreed that it isn't actually part of the bash completion feature.