threads / discuss / 22629

Subtle git completion hacks with aliases

Subject: Subtle git completion hacks with aliases

## tl;dr

One message between Feb 12, 2010 and Feb 12, 2010.

replies: 0people: 1as markdown or json

Ulrik Sverdrup· Feb 12, 2010, 13:40 UTC · lore

Relying on git refusing to use aliases that shadow git commands (and rightly so), but the git completion script taking them at face value, we can customize the completion of plumbing and custom scripts.

[alias]
        # Make this plumbing command autocomplete
        count-objects =
        # Make this custom shell script (git-unmerged)  autocomplete
arguments as branches, not paths
        unmerged = log

Given the firm beliefs in the aliases-shadowing-commands question, I think the above should be pretty safe.

Ulrik

← back to recent threads