git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC PATCH 3/3] connect: move ssh command line preparation to a separate (public) function

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 29, 2016, 16:58 UTC
Message-ID
<xmqqa8kc1hdu.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<1461890625-23222-3-git-send-email-mh@glandium.org>
Mike Hommey <mh@glandium.org> writes:
> Signed-off-by: Mike Hommey <mh@glandium.org>
> ---

I think moving it out into a separate helper function is a very good change to make the end result easier to follow.

Turning the helper to extern and adding it to connect.h does not benefit us (and [PATCH 1/3] doesn't, either).

And in the longer term, I doubt think it (and [PATCH 1/3]) would benefit you, either. We do not mean to make what goes into libgit.a (which connect.o is a part of) be a stable "library interface", so all sorts of future changes we make would affect your external code, e.g.

 - some people periodically check for extern symbols that do not
   have to be extern, and this will be marked static again any time
   (or you somehow need to arrange it so that this function is
   marked as special to reduce false positives);
 - we may need to update the external interface to this function,
   changing parameters, or updating its return value.

even if we promise not to make such a change only for the purpose of deliberately breaking you. So you have to be prepared and willing to follow the evolution of in-core code anyway.

So I would suggest restructuring this series to do
 * 2/3 (DIAG consolidation)
 * refactoring in 3/3 but not s/static/extern/
and in optional follow(s)-up, do
 * s/static/extern/ and update to *.h in 3/3
 * 1/3, but I do not think it is necessary for users of
   prepare_ssh_command()

The last patch could be kept in your fork of git.git if you want to keep linking with libgit.a, but my feeling is that we'd prefer to do without it at least for now, until we gain in-tree users that live outside connect.c that want to call the helper.

Thanks.
Previous: Mike Hommey
Message 15 of 15 in “git_connect: add some flexibility”
  1. 0/4 git_connect: add some flexibilityMike Hommey, Apr 28, 2016
  2. 1/4 git_connect: extend to take a pseudo format string for the program to runMike Hommey, Apr 28, 2016
  3. 2/4 git_connect: avoid quoting the path on the command line when it's not necessaryMike Hommey, Apr 28, 2016
  4. Stefan BellerApr 28, 2016
  5. 3/4 git_connect: allow a file descriptor to be allocated for stderrMike Hommey, Apr 28, 2016
  6. 4/4 git_connect: add a flag to consider the path part of ssh urls relativeMike Hommey, Apr 28, 2016
  7. Junio C HamanoApr 28, 2016
  8. Mike HommeyApr 28, 2016
  9. 1/3 connect: make parse_connect_url publicMike Hommey, Apr 29, 2016
  10. 2/3 connect: group CONNECT_DIAG_URL handling codeMike Hommey, Apr 29, 2016
  11. Junio C HamanoApr 29, 2016
  12. Junio C HamanoApr 29, 2016
  13. Torsten BögershausenApr 29, 2016
  14. 3/3 connect: move ssh command line preparation to a separate (public) functionMike Hommey, Apr 29, 2016
  15. Junio C HamanoApr 29, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.