Re: [PATCH 1/3] bash completion: fix completion issues with fetch, pull, and push

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

 



Jay Soffian <jaysoffian@xxxxxxxxx> wrote:
> Sverre Rabbelier noticed a completion issue with push:
> 
>  $ git push ori<tab>
>  git push origin
> 
>  $ git push -f ori<tab>
>  git push -f origin/
> 
> Markus Heidelberg pointed out that the issue extends to fetch and pull.
> 
> The reason is that the current code naively assumes that if
> COMP_CWORD=2, it should complete a remote name, otherwise it should
> complete a refspec. This assumption fails if there are any --options.
> 
> This patch fixes that issue by instead scanning COMP_CWORDS to see if
> the remote has been completed yet (we now assume the first non-dashed
> argument is the remote). The new logic is factored into a function,
> shared by fetch, pull, and push.
> 
> The new function also properly handles '.' as the remote.
> 
> Signed-off-by: Jay Soffian <jaysoffian@xxxxxxxxx>

Acked-by: Shawn O. Pearce <spearce@xxxxxxxxxxx>


> ---
>  contrib/completion/git-completion.bash |  109 +++++++++++++++++--------------
>  1 files changed, 60 insertions(+), 49 deletions(-)

-- 
Shawn.
--
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]

  Powered by Linux