Skip to content

Instantly share code, notes, and snippets.

@superfrink
superfrink / git-diff-autocomplete-no-branches.sh
Last active July 25, 2023 18:14
git diff without branch names
# Added to ~/.bash_profile
#
# This changes the git autocomplete to not include branch names for "git diff" commands.
# "git diff m<tab>" was completing the "main" branch when I wanted it to complet "main.go".
# Kluge warning: When the Debian completion code changes this could cause problems.
GIT_COMPLETION_FILE="/usr/share/bash-completion/completions/git"
if [ -f "$GIT_COMPLETION_FILE" ] ; then
source "$GIT_COMPLETION_FILE"
declare -f _git_diff | sed -e 's/__git_complete_revlist_file/#__git_complete_revlist_file/' > .fix-git-diff-autocomplete.sh

Keybase proof

I hereby claim:

  • I am superfrink on github.
  • I am superfrink (https://keybase.io/superfrink) on keybase.
  • I have a public key whose fingerprint is 75B7 D1E4 382E B8EC 2D95 6305 B912 48C8 F03A 8558

To claim this, I am signing this object: