From: Nanako Shiraishi Date: Wed, 11 Mar 2009 10:02:27 GMT Subject: Re: [PATCH 1/3] bash completion: fix completion issues with fetch, pull, and push Message-ID: <20090311190227.6117@nanako3.lavabit.com> In-Reply-To: <20090306155814.GG16213@spearce.org> Quoting Shawn O. Pearce : > Jay Soffian wrote: >> Sverre Rabbelier noticed a completion issue with push: >> >> $ git push ori >> git push origin >> >> $ git push -f ori >> 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 > > Acked-by: Shawn O. Pearce While people's attention is on the completion, there is one case I wish the completion worked better. "git log origin..mas[TAB]" and "git log origin...mas[TAB]" work as expected, but the same completion does not work for "git diff". I don't miss the two-dot format but it's often useful to say "git diff origin...master". -- Nanako Shiraishi http://ivory.ap.teacup.com/nanako3/