From: Nguyen Thai Ngoc Duy Date: Thu, 21 Aug 2008 00:43:23 GMT Subject: Re: [PATCH] bash-completion: fix getting strategy list Message-ID: In-Reply-To: <20080820223938.GN23800@genesis.frugalware.org> On 8/21/08, Miklos Vajna wrote: > On Wed, Aug 20, 2008 at 02:13:42PM -0700, Junio C Hamano wrote: > > completion: find out supported merge strategies correctly > > > > "git-merge" is a binary executable these days, and looking for assignment > > to $all_strategies variable does not work well. > > > > When asked for an unknown strategy, pre-1.6.0 and post-1.6.0 "git merge" > > commands respectively say: > > > > $ $HOME/git-snap-v1.5.6.5/bin/git merge -s help > > available strategies are: recur recursive octopus resolve stupid ours subtree > > $ $HOME/git-snap-v1.6.0/bin/git merge -s help > > Could not find merge strategy 'help'. > > Available strategies are: recursive octopus resolve ours subtree. > > > > both on its standard error stream. We can use this to learn what > > strategies are supported. > > > > The sed script is written in such a way that it catches both old and new > > message styles ("Available" vs "available", and the full stop at the end). > > It also allows future versions of "git merge" to line-wrap the list of > > strategies, and add extra comments, like this: > > > > $ $HOME/git-snap-v1.6.1/bin/git merge -s help > > Could not find merge strategy 'help'. > > Available strategies are: blame recursive octopus resolve ours > > subtree. > > Also you have custom strategies: theirs > > > > Make sure you spell strategy names correctly. > > > I like this, not adding something to builtin-merge when it's already > there. :) Me too. Did not realize it's already there :P -- Duy