git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Mike Hommey <mh@glandium.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [RFC PATCH 0/4] git_connect: add some flexibility
Date: Fri, 29 Apr 2016 08:29:36 +0900	[thread overview]
Message-ID: <20160428232936.GA8663@glandium.org> (raw)
In-Reply-To: <xmqqbn4t637r.fsf@gitster.mtv.corp.google.com>

On Thu, Apr 28, 2016 at 10:41:12AM -0700, Junio C Hamano wrote:
> Mike Hommey <mh@glandium.org> writes:
> 
> > As you may be aware, I'm working on a git remote helper to access
> > mercurial repositories (https://github.com/glandium/git-cinnabar/).
> >
> > At the moment, a small part is written in C, relying on the git code
> > base, but eventually, there would be more C.
> >
> > As I want to get rid of the dependency on Mercurial itself, I'm planning
> > to implement the wire protocol parts in git-cinnabar.
> 
> While all of the above sounds like a good thing to do, what I do not
> understand is why you need to even touch git_connect() at all, and
> we certainly do *not* want you to touch it to make its external
> interface unnecessarily ugly and complex with features that are only
> necessary if it needs to talk to non-git services.
> 
> In other words, why can't this cinnabar thing live on the other side
> of transport API, just like Git transport itself does not know about
> cURL and HTTP when talking with https:// repositories?

It does live on the other side of transport API. The changes are not
about git itself talking to mercurial servers. They are about a remote
helper (git-cinnabar), using native code based on git core code, to talk
to mercurial servers. Because I'd rather bend git_connect a little, if I
can, than copy it (as well as parse_connect_url). Because I want to
benefit from all tweaks it has (handling GIT_SSH/GIT_SSH_COMMAND
properly, handling tortoiseplink/plink properly, handling IPv6 forms of
the ssh url properly, ...)

Now, tweaking git_connect is one possible way to do what I want. Another
would be to make parse_connect_url non-static, and move the ssh command
line construction to a separate (non-static) function. Something with a
signature like:
  void prepare_ssh_command(struct argv_array **command,
                           const char *hostandport)

that would essentially do the part of git_connect that is in the if
(protocol == PROTO_SSH) block (not sure how CONNECT_DIAG_URL would fit
in this, though).

Thoughts?

Mike

  reply	other threads:[~2016-04-28 23:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-28 14:12 [RFC PATCH 0/4] git_connect: add some flexibility Mike Hommey
2016-04-28 14:12 ` [PATCH 1/4] git_connect: extend to take a pseudo format string for the program to run Mike Hommey
2016-04-28 14:12 ` [PATCH 2/4] git_connect: avoid quoting the path on the command line when it's not necessary Mike Hommey
2016-04-28 16:14   ` Stefan Beller
2016-04-28 14:12 ` [PATCH 3/4] git_connect: allow a file descriptor to be allocated for stderr Mike Hommey
2016-04-28 14:12 ` [PATCH 4/4] git_connect: add a flag to consider the path part of ssh urls relative Mike Hommey
2016-04-28 17:41 ` [RFC PATCH 0/4] git_connect: add some flexibility Junio C Hamano
2016-04-28 23:29   ` Mike Hommey [this message]
2016-04-29  0:43     ` [RFC PATCH 1/3] connect: make parse_connect_url public Mike Hommey
2016-04-29  0:43       ` [RFC PATCH 2/3] connect: group CONNECT_DIAG_URL handling code Mike Hommey
2016-04-29 15:59         ` Junio C Hamano
2016-04-29 17:13           ` Junio C Hamano
2016-04-29 20:00         ` Torsten Bögershausen
2016-04-29  0:43       ` [RFC PATCH 3/3] connect: move ssh command line preparation to a separate (public) function Mike Hommey
2016-04-29 16:58         ` Junio C Hamano

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20160428232936.GA8663@glandium.org \
    --to=mh@glandium.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).