From: Junio C Hamano Date: Sat, 19 Jul 2008 05:32:10 GMT Subject: Re: What's cooking in git.git (topics) Message-ID: <7vabge30dh.fsf@gitster.siamese.dyndns.org> In-Reply-To: Johannes Schindelin writes: > On Fri, 18 Jul 2008, Junio C Hamano wrote: > >> +The 'recursive' strategy can take the following options: >> + >> +ours;; > > You still have not addressed the issue that you can specify multiple > strategies,... Even though multiple -s parameters are supported, I know you have been here long enough in git scene to remember how it came about. I've seen some third-party documents that talk about our ability to "try multiple strategies and pick the best one" as one of the unique features, but anybody who was there knows that it was just a failed experiment that we did not bother removing. The thing is, trying multiple strategies was a cute idea and it was quite straightforward to implement. But picking the best one is the much more important part, and judging whose result is the best shouldn't be done with just a naïve "how many conflicting paths remain there?" metric (c.f. $gmane/87297 which talks about "stupid" but the argument is exactly the same --- smaller number of conflicts may not necessarily be the easiest to resolve nor the right resolution). I would be surprised if anybody uses multiple -s options in their daily workflow, even though I would not be surprised if people tried to use it just as an experiment and for its entertainment value once or maybe twice. After all, I invented the multiple strategy support for amusement, not from any practical real world needs ;-) So I do not consider that a convincing argument at all. > ... or even a single _wrong_ one. So: > > $ git merge -s stupid -Xours > > would not fail at all, but definitely not do the right thing either (it > disobeys a direct command of the user). It does fail gracefully, though. $ git merge -s resolve -Xours next Trying really trivial in-index merge... error: Untracked working tree file '.gitattributes' would be overwritten by merge. Nope. fatal: Not a valid object name --ours Merge with strategy resolve failed. I consider this falls into "You say it hurts? Don't do that, then" category. The error message will naturally improve, once we teach the merge strategy backends that they can be given --