{"thread":{"id":"14298","subject":"About -X<option>","startedAt":"2008-07-05T12:57:12Z","lastAt":"2008-07-06T19:25:23Z","messageCount":8,"participants":["Johannes Schindelin","Miklos Vajna","Pieter de Bie","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"82282","messageId":"alpine.DEB.1.00.0807051454060.3334@eeepc-johanness","threadId":"14298","inReplyTo":null,"subject":"About -X<option>","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-07-05T12:57:12Z","receivedAt":"2008-07-05T12:57:12Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nthe -X<option> options are not really easy to convert to parseopt.  This \nis only one indication that the interface can be improved.\n\nAnother one: you are more likely wanting to pass backend-_specific_ \noptions to git-merge.\n\nSo, how about using this syntax instead?\n\n\tgit pull -s recursive,theirs\n\ni.e. strategy terms consist of the strategy name, optionally followed by a \ncomma separated list of backend options.\n\nHmm?\n\nCiao,\nDscho\n"},{"id":"82283","messageId":"20080705133245.GH4729@genesis.frugalware.org","threadId":"14298","inReplyTo":"alpine.DEB.1.00.0807051454060.3334@eeepc-johanness","subject":"Re: About -X<option>","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2008-07-05T13:32:45Z","receivedAt":"2008-07-05T13:32:45Z","isPatch":false,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"On Sat, Jul 05, 2008 at 02:57:12PM +0200, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> So, how about using this syntax instead?\n> \n> \tgit pull -s recursive,theirs\n> \n> i.e. strategy terms consist of the strategy name, optionally followed by a \n> comma separated list of backend options.\n\nAs a user I would think that it tells git-merge to first try 'recursive'\nthen 'theirs'.\n\nOf course you can still say that users should read the documentation,\nbut... ;-)\n"},{"id":"82284","messageId":"AB745D70-D23A-4742-A5B3-DC1B6CAD9C30@ai.rug.nl","threadId":"14298","inReplyTo":"20080705133245.GH4729@genesis.frugalware.org","subject":"Re: About -X<option>","fromName":"Pieter de Bie","fromEmail":"frimmirf@gmail.com","sentAt":"2008-07-05T13:48:07Z","receivedAt":"2008-07-05T13:48:07Z","isPatch":false,"sender":{"key":"frimmirf@gmail.com","avatar":null},"body":"\nOn 5 jul 2008, at 15:32, Miklos Vajna wrote:\n\n> As a user I would think that it tells git-merge to first try  \n> 'recursive'\n> then 'theirs'.\n>\n\nI agree with this. Perhaps there's an easy fix: how about a colon?\n\n\tgit pull -s recursive:theirs\n\nmight be more intuitive?\n"},{"id":"82293","messageId":"7v63rktekf.fsf@gitster.siamese.dyndns.org","threadId":"14298","inReplyTo":"AB745D70-D23A-4742-A5B3-DC1B6CAD9C30@ai.rug.nl","subject":"Re: About -X<option>","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-05T17:40:16Z","receivedAt":"2008-07-05T17:40:16Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Pieter de Bie <frimmirf@gmail.com> writes:\n\n> On 5 jul 2008, at 15:32, Miklos Vajna wrote:\n>\n>> As a user I would think that it tells git-merge to first try\n>> 'recursive'\n>> then 'theirs'.\n>>\n>\n> I agree with this. Perhaps there's an easy fix: how about a colon?\n>\n> \tgit pull -s recursive:theirs\n>\n> might be more intuitive?\n\nHow would you do the equivalent of\n\n\tgit pull -s recursive -Xsubtree=\"My Playpen/\" -Xours\n\nwith the syntax?\n\nNote that the current scripted \"pull\" and \"merge\" has a limitation that it\ndoes not allow $IFS in -X<option> but that is not a designed-in limitation\nbut purely comes from a lazy implementation .\n\nAlso I do not see why -X<option> is not easy with parseopt() as Dscho\nclaimed in the original message in this thread...\n"},{"id":"82322","messageId":"alpine.DEB.1.00.0807060342550.3557@eeepc-johanness","threadId":"14298","inReplyTo":"7v63rktekf.fsf@gitster.siamese.dyndns.org","subject":"Re: About -X<option>","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-07-06T01:44:03Z","receivedAt":"2008-07-06T01:44:03Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 5 Jul 2008, Junio C Hamano wrote:\n\n> Also I do not see why -X<option> is not easy with parseopt() as Dscho \n> claimed in the original message in this thread...\n\nIsn't that obvious?  -X looks like a short option, but the rest of that \nstring does not consist of aggregated short options.\n\nBesides, it is extremely ugly a syntax.  Just like git-log's -S thing.\n\nCiao,\nDscho\n"},{"id":"82335","messageId":"7vmykvpq2n.fsf@gitster.siamese.dyndns.org","threadId":"14298","inReplyTo":"alpine.DEB.1.00.0807060342550.3557@eeepc-johanness","subject":"Re: About -X<option>","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-06T04:57:36Z","receivedAt":"2008-07-06T04:57:36Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> Isn't that obvious?  -X looks like a short option, but the rest of that \n> string does not consist of aggregated short options.\n\nAh, I see.  Then the issue is not about \"not easy to code\" but about \"not\nbeing consistent\".  We should care much more deeply about the latter.\n\nWe can change it to \"--X<option>[=<value>]\" and \"-X option[=<value>]\"; the\ntopic is still young, not even documented properly IIRC, and is not\nscheduled for 'master' any time soon yet.\n"},{"id":"82356","messageId":"alpine.LSU.1.00.0807061315310.32725@wbgn129.biozentrum.uni-wuerzburg.de","threadId":"14298","inReplyTo":"7vmykvpq2n.fsf@gitster.siamese.dyndns.org","subject":"Re: About -X<option>","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-07-06T11:28:00Z","receivedAt":"2008-07-06T11:28:00Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 5 Jul 2008, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > Isn't that obvious?  -X looks like a short option, but the rest of \n> > that string does not consist of aggregated short options.\n> \n> Ah, I see.  Then the issue is not about \"not easy to code\" but about \"not\n> being consistent\".\n\nI never meant to say \"easy to code\".  I always meant \"not possible with \nparseopt, without major -- and ugly -- surgery\".\n\n> We can change it to \"--X<option>[=<value>]\" and \"-X option[=<value>]\"; \n> the topic is still young, not even documented properly IIRC, and is not \n> scheduled for 'master' any time soon yet.\n\nI feel that this is too limiting.  You really do not want to allow passing \n\"theirs\" to git-merge, when you only ask for stratgey \"resolve\", right?  \nBecause the \"resolve\" strategy never heard about \"theirs\".\n\nTo be frank, the semantics of \"theirs\" _wants_ to treat it as a strategy; \njust think of\n\n\t$ git merge -s ours -Xtheirs\n\nBesides, I sincerely doubt that anybody will find the naming of \"-X\" \nintuitive.\n\nBut let's step back a little: \"theirs\" is most likely something we do not \nwant to announce, since a careful review in case of merge conflicts should \nbe performed in that case.\n\nSo we do not want official support for it.\n\nAnd there comes in an aspect of the broader plan for the second half of \nMiklos' project: user-defined merge backends.\n\nBy allowing users to put a script in their PATH (possibly resorting to \".\" \njust for that script), named \"git-merge-<mybackend>\", the following \nbecomes possible:\n\n\t$ echo 'git merge-recursive --theirs \"$@\"' > ~/bin/git-merge-X\n\t$ chmod a+x ~/bin/git-merge-X\n\t$ git merge -s X\n\nThis would be even more flexible than the \"-X\" option, and it would \nproperly keep \"--theirs\" out of our officially supported features.\n\nIf we feel like it, we could even accept a \"git-merge-partially-theirs\" \ninto contrib/.\n\nCiao,\nDscho\n"},{"id":"82383","messageId":"7vd4lqerx8.fsf@gitster.siamese.dyndns.org","threadId":"14298","inReplyTo":"alpine.LSU.1.00.0807061315310.32725@wbgn129.biozentrum.uni-wuerzburg.de","subject":"Re: About -X<option>","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-06T19:25:23Z","receivedAt":"2008-07-06T19:25:23Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> By allowing users to put a script in their PATH (possibly resorting to \".\" \n> just for that script), named \"git-merge-<mybackend>\", the following \n> becomes possible:\n>\n> \t$ echo 'git merge-recursive --theirs \"$@\"' > ~/bin/git-merge-X\n> \t$ chmod a+x ~/bin/git-merge-X\n> \t$ git merge -s X\n>\n> This would be even more flexible than the \"-X\" option, and it would \n> properly keep \"--theirs\" out of our officially supported features.\n\nThe above \"custom backend\" is fine, and would be useful for _other_ things\n(That's why I invented \"-s\" option to \"git-merge\" to begin with).  The sad\npart is that it does not have much to do with a solution about -X<option>\nissue.\n\nImagine you want to enhance the recursive strategy so that the user can\ntweak the similarity threashold used in the rename detection.  You would\nwant to pass the equilvalent of -M<similarity> to the strategy backend\nthrough \"git merge\".  You could use millions of such custom merge backend\nto do so:\n\n\t$ echo 'git merge-recursive -M2 \"$@\"' >~/bin/git-merge-M2\n\t$ echo 'git merge-recursive -M4 \"$@\"' >~/bin/git-merge-M4\n\t$ echo 'git merge-recursive -M6 \"$@\"' >~/bin/git-merge-M6\n\t$ ... millions of these ...\n        $ git merge -s M09\n\nbut that's not a solution.  You are kuldging around the issue by punting\nand by not solving it (iow \"I did not have forsight to allow passing\noptions through git-merge, and as consequence, the users are forced to\nhave canned set of options in their backend\").  You have the same issue\nwith \"-Xsubtree=git-gui/\", for example.\n\nBeing able to pick strategy backend is wonderful, and being able to define\nnew ones is also wonderful.  But that is unrelated to what we are\ndiscussing here.  Don't confuse the issue.\n\nI am not married to -X<option> notation. Perhaps we can borrow the way\n\"gcc\" does this, when allowing linker and assmebler options to be passed\nfrom the command line to the backend with -Wa,<option> and -Wl,<option>.\n\nThe issue being addressed with these notation is exactly the same as what\nwe are discussing, and we can follow the same model.  The intermediary\n(gcc and git-merge) does not have to fully understand what the option they\nare passing to the backend (assembler and merge-* strategy).\n"}]}