On Mon, 8 Jul 2013 11:41:09 -0700 (PDT) Andy From <[email protected]> wrote:
> Hi, > > I wonder if there's been any work on providing SHA-1 tab completion > for any command (e.g. show or diff) ? > Completion works fine for e.g. branches but it might be a convenience > feature to also be able to complete on SHA-1. > > Maybe there would be some performance drawbacks on this and there's > been some discussion on this already... > > BR, A > There could be major performance drawbacks, memory problems and just the shear amount that will be displayed. Completion works on the principal of getting all potential completions in memory and then showing them. So for example with branches, git checkout b<TAB><TAB> All branches that start with b are loaded in memory and displayed. Now imagine this with all your commits. Do a git rev-list|wc -l on your repository and see how long it takes and how many commits you have. For the kernel repo for example: $time git rev-list --all | wc -l 419811 real 0m5.209s user 0m4.881s sys 0m1.280s So 419811 possibilities would be displayed after you do git diff<TAB><TAB> Assume you know the SHA1 starts with e $time git rev-list --all | grep ^e | wc -l 26365 real 0m5.826s user 0m6.223s sys 0m0.923s 26365 possibilities on git diff e<TAB><TAB> -- Peter van der Does GPG key: CB317D6E Site: http://avirtualhome.com GitHub: https://github.com/petervanderdoes Twitter: @petervanderdoes -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
