git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Subject: Re: [PATCH] cache.h: move remote/connect API out of it
Date: Mon, 08 Jul 2013 14:35:57 -0700	[thread overview]
Message-ID: <7vwqp0ybsy.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <7v1u78zrko.fsf@alter.siamese.dyndns.org> (Junio C. Hamano's message of "Mon, 08 Jul 2013 14:09:59 -0700")

Junio C Hamano <gitster@pobox.com> writes:

> The definition of "struct ref" in "cache.h", a header file so
> central to the system, always confused me.  This structure is not
> about the local ref used by sha1-name API to name local objects.
>
> It is what refspecs are expanded into, after finding out what refs
> the other side has, to define what refs are updated after object
> transfer succeeds to what values.  It belongs to "remote.h" together
> with "struct refspec".
>
> While we are at it, also move the types and functions related to the
> Git transport connection to a new header file connect.h
>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---
>
>  * I hate to to this kind of code-movement in the middle of the
>    cycle, but every time I follow the push->transport codepath, I
>    become disoriented by these "struct ref"s.

>
>  builtin/fetch-pack.c   |  2 ++
>  builtin/receive-pack.c |  1 +
>  builtin/send-pack.c    |  1 +
>  cache.h                | 62 --------------------------------------------------
>  connect.c              |  1 +
>  fetch-pack.c           |  1 +
>  fetch-pack.h           |  1 +
>  refs.c                 |  8 -------
>  remote.c               |  8 +++++++
>  remote.h               | 54 +++++++++++++++++++++++++++++++++++++++++++
>  send-pack.c            |  1 +
>  transport.c            |  2 ++
>  transport.h            |  1 +
>  upload-pack.c          |  1 +
>  14 files changed, 74 insertions(+), 70 deletions(-)

Of course, I should have noticed that the math does not work out
without this part:

 connect.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/connect.h b/connect.h
new file mode 100644
index 0000000..9dff25c
--- /dev/null
+++ b/connect.h
@@ -0,0 +1,13 @@
+#ifndef CONNECT_H
+#define CONNECT_H
+
+#define CONNECT_VERBOSE       (1u << 0)
+extern struct child_process *git_connect(int fd[2], const char *url, const char *prog, int flags);
+extern int finish_connect(struct child_process *conn);
+extern int git_connection_is_socket(struct child_process *conn);
+extern int server_supports(const char *feature);
+extern int parse_feature_request(const char *features, const char *feature);
+extern const char *server_feature_value(const char *feature, int *len_ret);
+extern const char *parse_feature_value(const char *feature_list, const char *feature, int *len_ret);
+
+#endif

  reply	other threads:[~2013-07-08 21:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-08 21:09 [PATCH] cache.h: move remote/connect API out of it Junio C Hamano
2013-07-08 21:35 ` Junio C Hamano [this message]
2013-07-09  4:21 ` Jeff King
2013-07-09  5:38   ` 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=7vwqp0ybsy.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.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.
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).