git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Pieter de Bie <frimmirf@gmail.com>,
	Miklos Vajna <vmiklos@frugalware.org>,
	git@vger.kernel.org
Subject: Re: About -X<option>
Date: Sun, 06 Jul 2008 12:25:23 -0700	[thread overview]
Message-ID: <7vd4lqerx8.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <alpine.LSU.1.00.0807061315310.32725@wbgn129.biozentrum.uni-wuerzburg.de> (Johannes Schindelin's message of "Sun, 6 Jul 2008 13:28:00 +0200 (CEST)")

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).

      reply	other threads:[~2008-07-06 19:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vd4lqerx8.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=frimmirf@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=vmiklos@frugalware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).