* About -X<option> @ 2008-07-05 12:57 Johannes Schindelin 2008-07-05 13:32 ` Miklos Vajna 0 siblings, 1 reply; 8+ messages in thread From: Johannes Schindelin @ 2008-07-05 12:57 UTC (permalink / raw) To: gitster, git Hi, the -X<option> options are not really easy to convert to parseopt. This is only one indication that the interface can be improved. Another one: you are more likely wanting to pass backend-_specific_ options to git-merge. So, how about using this syntax instead? git pull -s recursive,theirs i.e. strategy terms consist of the strategy name, optionally followed by a comma separated list of backend options. Hmm? Ciao, Dscho ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: About -X<option> 2008-07-05 12:57 About -X<option> Johannes Schindelin @ 2008-07-05 13:32 ` Miklos Vajna 2008-07-05 13:48 ` Pieter de Bie 0 siblings, 1 reply; 8+ messages in thread From: Miklos Vajna @ 2008-07-05 13:32 UTC (permalink / raw) To: Johannes Schindelin; +Cc: gitster, git [-- Attachment #1: Type: text/plain, Size: 484 bytes --] On Sat, Jul 05, 2008 at 02:57:12PM +0200, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote: > So, how about using this syntax instead? > > git pull -s recursive,theirs > > i.e. strategy terms consist of the strategy name, optionally followed by a > comma separated list of backend options. As a user I would think that it tells git-merge to first try 'recursive' then 'theirs'. Of course you can still say that users should read the documentation, but... ;-) [-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: About -X<option> 2008-07-05 13:32 ` Miklos Vajna @ 2008-07-05 13:48 ` Pieter de Bie 2008-07-05 17:40 ` Junio C Hamano 0 siblings, 1 reply; 8+ messages in thread From: Pieter de Bie @ 2008-07-05 13:48 UTC (permalink / raw) To: Miklos Vajna; +Cc: Johannes Schindelin, gitster, git On 5 jul 2008, at 15:32, Miklos Vajna wrote: > As a user I would think that it tells git-merge to first try > 'recursive' > then 'theirs'. > I agree with this. Perhaps there's an easy fix: how about a colon? git pull -s recursive:theirs might be more intuitive? ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: About -X<option> 2008-07-05 13:48 ` Pieter de Bie @ 2008-07-05 17:40 ` Junio C Hamano 2008-07-06 1:44 ` Johannes Schindelin 0 siblings, 1 reply; 8+ messages in thread From: Junio C Hamano @ 2008-07-05 17:40 UTC (permalink / raw) To: Pieter de Bie; +Cc: Miklos Vajna, Johannes Schindelin, gitster, git Pieter de Bie <frimmirf@gmail.com> writes: > On 5 jul 2008, at 15:32, Miklos Vajna wrote: > >> As a user I would think that it tells git-merge to first try >> 'recursive' >> then 'theirs'. >> > > I agree with this. Perhaps there's an easy fix: how about a colon? > > git pull -s recursive:theirs > > might be more intuitive? How would you do the equivalent of git pull -s recursive -Xsubtree="My Playpen/" -Xours with the syntax? Note that the current scripted "pull" and "merge" has a limitation that it does not allow $IFS in -X<option> but that is not a designed-in limitation but purely comes from a lazy implementation . Also I do not see why -X<option> is not easy with parseopt() as Dscho claimed in the original message in this thread... ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: About -X<option> 2008-07-05 17:40 ` Junio C Hamano @ 2008-07-06 1:44 ` Johannes Schindelin 2008-07-06 4:57 ` Junio C Hamano 0 siblings, 1 reply; 8+ messages in thread From: Johannes Schindelin @ 2008-07-06 1:44 UTC (permalink / raw) To: Junio C Hamano; +Cc: Pieter de Bie, Miklos Vajna, git Hi, On Sat, 5 Jul 2008, Junio C Hamano wrote: > Also I do not see why -X<option> is not easy with parseopt() as Dscho > claimed in the original message in this thread... Isn't that obvious? -X looks like a short option, but the rest of that string does not consist of aggregated short options. Besides, it is extremely ugly a syntax. Just like git-log's -S thing. Ciao, Dscho ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: About -X<option> 2008-07-06 1:44 ` Johannes Schindelin @ 2008-07-06 4:57 ` Junio C Hamano 2008-07-06 11:28 ` Johannes Schindelin 0 siblings, 1 reply; 8+ messages in thread From: Junio C Hamano @ 2008-07-06 4:57 UTC (permalink / raw) To: Johannes Schindelin; +Cc: Pieter de Bie, Miklos Vajna, git Johannes Schindelin <Johannes.Schindelin@gmx.de> writes: > Isn't that obvious? -X looks like a short option, but the rest of that > string does not consist of aggregated short options. Ah, I see. Then the issue is not about "not easy to code" but about "not being consistent". We should care much more deeply about the latter. We can change it to "--X<option>[=<value>]" and "-X option[=<value>]"; the topic is still young, not even documented properly IIRC, and is not scheduled for 'master' any time soon yet. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: About -X<option> 2008-07-06 4:57 ` Junio C Hamano @ 2008-07-06 11:28 ` Johannes Schindelin 2008-07-06 19:25 ` Junio C Hamano 0 siblings, 1 reply; 8+ messages in thread From: Johannes Schindelin @ 2008-07-06 11:28 UTC (permalink / raw) To: Junio C Hamano; +Cc: Pieter de Bie, Miklos Vajna, git Hi, On Sat, 5 Jul 2008, Junio C Hamano wrote: > Johannes Schindelin <Johannes.Schindelin@gmx.de> writes: > > > Isn't that obvious? -X looks like a short option, but the rest of > > that string does not consist of aggregated short options. > > Ah, I see. Then the issue is not about "not easy to code" but about "not > being consistent". I never meant to say "easy to code". I always meant "not possible with parseopt, without major -- and ugly -- surgery". > We can change it to "--X<option>[=<value>]" and "-X option[=<value>]"; > the topic is still young, not even documented properly IIRC, and is not > scheduled for 'master' any time soon yet. I feel that this is too limiting. You really do not want to allow passing "theirs" to git-merge, when you only ask for stratgey "resolve", right? Because the "resolve" strategy never heard about "theirs". To be frank, the semantics of "theirs" _wants_ to treat it as a strategy; just think of $ git merge -s ours -Xtheirs Besides, I sincerely doubt that anybody will find the naming of "-X" intuitive. But let's step back a little: "theirs" is most likely something we do not want to announce, since a careful review in case of merge conflicts should be performed in that case. So we do not want official support for it. And there comes in an aspect of the broader plan for the second half of Miklos' project: user-defined merge backends. By allowing users to put a script in their PATH (possibly resorting to "." just for that script), named "git-merge-<mybackend>", the following becomes possible: $ echo 'git merge-recursive --theirs "$@"' > ~/bin/git-merge-X $ chmod a+x ~/bin/git-merge-X $ git merge -s X This would be even more flexible than the "-X" option, and it would properly keep "--theirs" out of our officially supported features. If we feel like it, we could even accept a "git-merge-partially-theirs" into contrib/. Ciao, Dscho ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: About -X<option> 2008-07-06 11:28 ` Johannes Schindelin @ 2008-07-06 19:25 ` Junio C Hamano 0 siblings, 0 replies; 8+ messages in thread From: Junio C Hamano @ 2008-07-06 19:25 UTC (permalink / raw) To: Johannes Schindelin; +Cc: Pieter de Bie, Miklos Vajna, git Johannes Schindelin <Johannes.Schindelin@gmx.de> writes: > By allowing users to put a script in their PATH (possibly resorting to "." > just for that script), named "git-merge-<mybackend>", the following > becomes possible: > > $ echo 'git merge-recursive --theirs "$@"' > ~/bin/git-merge-X > $ chmod a+x ~/bin/git-merge-X > $ git merge -s X > > This would be even more flexible than the "-X" option, and it would > properly keep "--theirs" out of our officially supported features. The above "custom backend" is fine, and would be useful for _other_ things (That's why I invented "-s" option to "git-merge" to begin with). The sad part is that it does not have much to do with a solution about -X<option> issue. Imagine you want to enhance the recursive strategy so that the user can tweak the similarity threashold used in the rename detection. You would want to pass the equilvalent of -M<similarity> to the strategy backend through "git merge". You could use millions of such custom merge backend to do so: $ echo 'git merge-recursive -M2 "$@"' >~/bin/git-merge-M2 $ echo 'git merge-recursive -M4 "$@"' >~/bin/git-merge-M4 $ echo 'git merge-recursive -M6 "$@"' >~/bin/git-merge-M6 $ ... millions of these ... $ git merge -s M09 but that's not a solution. You are kuldging around the issue by punting and by not solving it (iow "I did not have forsight to allow passing options through git-merge, and as consequence, the users are forced to have canned set of options in their backend"). You have the same issue with "-Xsubtree=git-gui/", for example. Being able to pick strategy backend is wonderful, and being able to define new ones is also wonderful. But that is unrelated to what we are discussing here. Don't confuse the issue. I am not married to -X<option> notation. Perhaps we can borrow the way "gcc" does this, when allowing linker and assmebler options to be passed from the command line to the backend with -Wa,<option> and -Wl,<option>. The issue being addressed with these notation is exactly the same as what we are discussing, and we can follow the same model. The intermediary (gcc and git-merge) does not have to fully understand what the option they are passing to the backend (assembler and merge-* strategy). ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2008-07-06 19:26 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2008-07-05 12:57 About -X<option> Johannes Schindelin 2008-07-05 13:32 ` Miklos Vajna 2008-07-05 13:48 ` Pieter de Bie 2008-07-05 17:40 ` Junio C Hamano 2008-07-06 1:44 ` Johannes Schindelin 2008-07-06 4:57 ` Junio C Hamano 2008-07-06 11:28 ` Johannes Schindelin 2008-07-06 19:25 ` Junio C Hamano
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).