Re: [PATCH] bash-completion: Make use of git status

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ron Panduwana wrote:
> $ git add [TAB]path/to/deeply/located/[TAB][TAB]
> path/to/deeply/located/modified-file   path/to/deeply/located/new-file
[...]
> +# __git_files_having_status requires 1 argument
> +__git_files_having_status ()
> +{
> +	echo "$(git status -uall --porcelain . 2>/dev/null | egrep "^$1" | cut -c4-)"
> +}
> +

Some thoughts:

* running git-status for . has some issues: it doesn't work in the
  case of

    cd subdir
    git add ../some/file[TAB]

  It's also inefficient if you are at the top level and

    git add path/to/file/a/few/levels/down[TAB]

  since it wouldn't actually have to look for untracked files in the
  entire repo.

* -uall is not required unless you are looking for untracked files.
   For the other commands you could speed up completion by passing
   -uno instead.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]