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

Re: [PATCH 01/35] refspec: move refspec parsing logic into its own file

From
Junio C Hamano <gitster@pobox.com>
Date
May 15, 2018, 08:06 UTC
Message-ID
<xmqqr2md8hrz.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20180514215626.164960-2-bmwill@google.com>
Brandon Williams <bmwill@google.com> writes:
> In preperation for performing a refactor on refspec related code, move
Preparation?
Show 618 quoted lines
> the refspec parsing logic into its own file.
>
> Signed-off-by: Brandon Williams <bmwill@google.com>
> ---
>  Makefile                    |   1 +
>  branch.c                    |   1 +
>  builtin/clone.c             |   1 +
>  builtin/fast-export.c       |   1 +
>  builtin/fetch.c             |   1 +
>  builtin/merge.c             |   1 +
>  builtin/pull.c              |   1 +
>  builtin/push.c              |   1 +
>  builtin/remote.c            |   1 +
>  builtin/submodule--helper.c |   1 +
>  checkout.c                  |   1 +
>  refspec.c                   | 168 ++++++++++++++++++++++++++++++++++++
>  refspec.h                   |  23 +++++
>  remote.c                    | 165 +----------------------------------
>  remote.h                    |  20 -----
>  transport-helper.c          |   1 +
>  transport.c                 |   1 +
>  17 files changed, 205 insertions(+), 184 deletions(-)
>  create mode 100644 refspec.c
>  create mode 100644 refspec.h
>
> diff --git a/Makefile b/Makefile
> index ad880d1fc..4bca65383 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -928,6 +928,7 @@ LIB_OBJS += refs/files-backend.o
>  LIB_OBJS += refs/iterator.o
>  LIB_OBJS += refs/packed-backend.o
>  LIB_OBJS += refs/ref-cache.o
> +LIB_OBJS += refspec.o
>  LIB_OBJS += ref-filter.o
>  LIB_OBJS += remote.o
>  LIB_OBJS += replace-object.o
> diff --git a/branch.c b/branch.c
> index 2672054f0..32ccefc6b 100644
> --- a/branch.c
> +++ b/branch.c
> @@ -3,6 +3,7 @@
>  #include "config.h"
>  #include "branch.h"
>  #include "refs.h"
> +#include "refspec.h"
>  #include "remote.h"
>  #include "commit.h"
>  #include "worktree.h"
> diff --git a/builtin/clone.c b/builtin/clone.c
> index 84f1473d1..6d1614ed3 100644
> --- a/builtin/clone.c
> +++ b/builtin/clone.c
> @@ -14,6 +14,7 @@
>  #include "parse-options.h"
>  #include "fetch-pack.h"
>  #include "refs.h"
> +#include "refspec.h"
>  #include "tree.h"
>  #include "tree-walk.h"
>  #include "unpack-trees.h"
> diff --git a/builtin/fast-export.c b/builtin/fast-export.c
> index 530df12f0..a13b7c8ef 100644
> --- a/builtin/fast-export.c
> +++ b/builtin/fast-export.c
> @@ -7,6 +7,7 @@
>  #include "cache.h"
>  #include "config.h"
>  #include "refs.h"
> +#include "refspec.h"
>  #include "commit.h"
>  #include "object.h"
>  #include "tag.h"
> diff --git a/builtin/fetch.c b/builtin/fetch.c
> index 7ee83ac0f..1fce68e9a 100644
> --- a/builtin/fetch.c
> +++ b/builtin/fetch.c
> @@ -5,6 +5,7 @@
>  #include "config.h"
>  #include "repository.h"
>  #include "refs.h"
> +#include "refspec.h"
>  #include "commit.h"
>  #include "builtin.h"
>  #include "string-list.h"
> diff --git a/builtin/merge.c b/builtin/merge.c
> index 9db5a2cf1..c362cfe90 100644
> --- a/builtin/merge.c
> +++ b/builtin/merge.c
> @@ -14,6 +14,7 @@
>  #include "run-command.h"
>  #include "diff.h"
>  #include "refs.h"
> +#include "refspec.h"
>  #include "commit.h"
>  #include "diffcore.h"
>  #include "revision.h"
> diff --git a/builtin/pull.c b/builtin/pull.c
> index 71aac5005..6247c956d 100644
> --- a/builtin/pull.c
> +++ b/builtin/pull.c
> @@ -15,6 +15,7 @@
>  #include "remote.h"
>  #include "dir.h"
>  #include "refs.h"
> +#include "refspec.h"
>  #include "revision.h"
>  #include "submodule.h"
>  #include "submodule-config.h"
> diff --git a/builtin/push.c b/builtin/push.c
> index ac3705370..fa65999b2 100644
> --- a/builtin/push.c
> +++ b/builtin/push.c
> @@ -4,6 +4,7 @@
>  #include "cache.h"
>  #include "config.h"
>  #include "refs.h"
> +#include "refspec.h"
>  #include "run-command.h"
>  #include "builtin.h"
>  #include "remote.h"
> diff --git a/builtin/remote.c b/builtin/remote.c
> index 8708e584e..c49513995 100644
> --- a/builtin/remote.c
> +++ b/builtin/remote.c
> @@ -7,6 +7,7 @@
>  #include "strbuf.h"
>  #include "run-command.h"
>  #include "refs.h"
> +#include "refspec.h"
>  #include "argv-array.h"
>  
>  static const char * const builtin_remote_usage[] = {
> diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
> index c2403a915..6ab032acb 100644
> --- a/builtin/submodule--helper.c
> +++ b/builtin/submodule--helper.c
> @@ -12,6 +12,7 @@
>  #include "run-command.h"
>  #include "remote.h"
>  #include "refs.h"
> +#include "refspec.h"
>  #include "connect.h"
>  #include "revision.h"
>  #include "diffcore.h"
> diff --git a/checkout.c b/checkout.c
> index ac42630f7..193ba8567 100644
> --- a/checkout.c
> +++ b/checkout.c
> @@ -1,5 +1,6 @@
>  #include "cache.h"
>  #include "remote.h"
> +#include "refspec.h"
>  #include "checkout.h"
>  
>  struct tracking_name_data {
> diff --git a/refspec.c b/refspec.c
> new file mode 100644
> index 000000000..ecb0bdff3
> --- /dev/null
> +++ b/refspec.c
> @@ -0,0 +1,168 @@
> +#include "cache.h"
> +#include "refs.h"
> +#include "refspec.h"
> +
> +static struct refspec s_tag_refspec = {
> +	0,
> +	1,
> +	0,
> +	0,
> +	"refs/tags/*",
> +	"refs/tags/*"
> +};
> +
> +/* See TAG_REFSPEC for the string version */
> +const struct refspec *tag_refspec = &s_tag_refspec;
> +
> +static struct refspec *parse_refspec_internal(int nr_refspec, const char **refspec, int fetch, int verify)
> +{
> +	int i;
> +	struct refspec *rs = xcalloc(nr_refspec, sizeof(*rs));
> +
> +	for (i = 0; i < nr_refspec; i++) {
> +		size_t llen;
> +		int is_glob;
> +		const char *lhs, *rhs;
> +		int flags;
> +
> +		is_glob = 0;
> +
> +		lhs = refspec[i];
> +		if (*lhs == '+') {
> +			rs[i].force = 1;
> +			lhs++;
> +		}
> +
> +		rhs = strrchr(lhs, ':');
> +
> +		/*
> +		 * Before going on, special case ":" (or "+:") as a refspec
> +		 * for pushing matching refs.
> +		 */
> +		if (!fetch && rhs == lhs && rhs[1] == '\0') {
> +			rs[i].matching = 1;
> +			continue;
> +		}
> +
> +		if (rhs) {
> +			size_t rlen = strlen(++rhs);
> +			is_glob = (1 <= rlen && strchr(rhs, '*'));
> +			rs[i].dst = xstrndup(rhs, rlen);
> +		}
> +
> +		llen = (rhs ? (rhs - lhs - 1) : strlen(lhs));
> +		if (1 <= llen && memchr(lhs, '*', llen)) {
> +			if ((rhs && !is_glob) || (!rhs && fetch))
> +				goto invalid;
> +			is_glob = 1;
> +		} else if (rhs && is_glob) {
> +			goto invalid;
> +		}
> +
> +		rs[i].pattern = is_glob;
> +		rs[i].src = xstrndup(lhs, llen);
> +		flags = REFNAME_ALLOW_ONELEVEL | (is_glob ? REFNAME_REFSPEC_PATTERN : 0);
> +
> +		if (fetch) {
> +			struct object_id unused;
> +
> +			/* LHS */
> +			if (!*rs[i].src)
> +				; /* empty is ok; it means "HEAD" */
> +			else if (llen == GIT_SHA1_HEXSZ && !get_oid_hex(rs[i].src, &unused))
> +				rs[i].exact_sha1 = 1; /* ok */
> +			else if (!check_refname_format(rs[i].src, flags))
> +				; /* valid looking ref is ok */
> +			else
> +				goto invalid;
> +			/* RHS */
> +			if (!rs[i].dst)
> +				; /* missing is ok; it is the same as empty */
> +			else if (!*rs[i].dst)
> +				; /* empty is ok; it means "do not store" */
> +			else if (!check_refname_format(rs[i].dst, flags))
> +				; /* valid looking ref is ok */
> +			else
> +				goto invalid;
> +		} else {
> +			/*
> +			 * LHS
> +			 * - empty is allowed; it means delete.
> +			 * - when wildcarded, it must be a valid looking ref.
> +			 * - otherwise, it must be an extended SHA-1, but
> +			 *   there is no existing way to validate this.
> +			 */
> +			if (!*rs[i].src)
> +				; /* empty is ok */
> +			else if (is_glob) {
> +				if (check_refname_format(rs[i].src, flags))
> +					goto invalid;
> +			}
> +			else
> +				; /* anything goes, for now */
> +			/*
> +			 * RHS
> +			 * - missing is allowed, but LHS then must be a
> +			 *   valid looking ref.
> +			 * - empty is not allowed.
> +			 * - otherwise it must be a valid looking ref.
> +			 */
> +			if (!rs[i].dst) {
> +				if (check_refname_format(rs[i].src, flags))
> +					goto invalid;
> +			} else if (!*rs[i].dst) {
> +				goto invalid;
> +			} else {
> +				if (check_refname_format(rs[i].dst, flags))
> +					goto invalid;
> +			}
> +		}
> +	}
> +	return rs;
> +
> + invalid:
> +	if (verify) {
> +		/*
> +		 * nr_refspec must be greater than zero and i must be valid
> +		 * since it is only possible to reach this point from within
> +		 * the for loop above.
> +		 */
> +		free_refspec(i+1, rs);
> +		return NULL;
> +	}
> +	die("Invalid refspec '%s'", refspec[i]);
> +}
> +
> +int valid_fetch_refspec(const char *fetch_refspec_str)
> +{
> +	struct refspec *refspec;
> +
> +	refspec = parse_refspec_internal(1, &fetch_refspec_str, 1, 1);
> +	free_refspec(1, refspec);
> +	return !!refspec;
> +}
> +
> +struct refspec *parse_fetch_refspec(int nr_refspec, const char **refspec)
> +{
> +	return parse_refspec_internal(nr_refspec, refspec, 1, 0);
> +}
> +
> +struct refspec *parse_push_refspec(int nr_refspec, const char **refspec)
> +{
> +	return parse_refspec_internal(nr_refspec, refspec, 0, 0);
> +}
> +
> +void free_refspec(int nr_refspec, struct refspec *refspec)
> +{
> +	int i;
> +
> +	if (!refspec)
> +		return;
> +
> +	for (i = 0; i < nr_refspec; i++) {
> +		free(refspec[i].src);
> +		free(refspec[i].dst);
> +	}
> +	free(refspec);
> +}
> +
> diff --git a/refspec.h b/refspec.h
> new file mode 100644
> index 000000000..b1db91918
> --- /dev/null
> +++ b/refspec.h
> @@ -0,0 +1,23 @@
> +#ifndef REFSPEC_H
> +#define REFSPEC_H
> +
> +#define TAG_REFSPEC "refs/tags/*:refs/tags/*"
> +const struct refspec *tag_refspec;
> +
> +struct refspec {
> +	unsigned force : 1;
> +	unsigned pattern : 1;
> +	unsigned matching : 1;
> +	unsigned exact_sha1 : 1;
> +
> +	char *src;
> +	char *dst;
> +};
> +
> +int valid_fetch_refspec(const char *refspec);
> +struct refspec *parse_fetch_refspec(int nr_refspec, const char **refspec);
> +struct refspec *parse_push_refspec(int nr_refspec, const char **refspec);
> +
> +void free_refspec(int nr_refspec, struct refspec *refspec);
> +
> +#endif /* REFSPEC_H */
> diff --git a/remote.c b/remote.c
> index 91eb010ca..4d67c061a 100644
> --- a/remote.c
> +++ b/remote.c
> @@ -2,6 +2,7 @@
>  #include "config.h"
>  #include "remote.h"
>  #include "refs.h"
> +#include "refspec.h"
>  #include "commit.h"
>  #include "diff.h"
>  #include "revision.h"
> @@ -13,18 +14,6 @@
>  
>  enum map_direction { FROM_SRC, FROM_DST };
>  
> -static struct refspec s_tag_refspec = {
> -	0,
> -	1,
> -	0,
> -	0,
> -	"refs/tags/*",
> -	"refs/tags/*"
> -};
> -
> -/* See TAG_REFSPEC for the string version */
> -const struct refspec *tag_refspec = &s_tag_refspec;
> -
>  struct counted_string {
>  	size_t len;
>  	const char *s;
> @@ -499,158 +488,6 @@ static void read_config(void)
>  	alias_all_urls();
>  }
>  
> -static struct refspec *parse_refspec_internal(int nr_refspec, const char **refspec, int fetch, int verify)
> -{
> -	int i;
> -	struct refspec *rs = xcalloc(nr_refspec, sizeof(*rs));
> -
> -	for (i = 0; i < nr_refspec; i++) {
> -		size_t llen;
> -		int is_glob;
> -		const char *lhs, *rhs;
> -		int flags;
> -
> -		is_glob = 0;
> -
> -		lhs = refspec[i];
> -		if (*lhs == '+') {
> -			rs[i].force = 1;
> -			lhs++;
> -		}
> -
> -		rhs = strrchr(lhs, ':');
> -
> -		/*
> -		 * Before going on, special case ":" (or "+:") as a refspec
> -		 * for pushing matching refs.
> -		 */
> -		if (!fetch && rhs == lhs && rhs[1] == '\0') {
> -			rs[i].matching = 1;
> -			continue;
> -		}
> -
> -		if (rhs) {
> -			size_t rlen = strlen(++rhs);
> -			is_glob = (1 <= rlen && strchr(rhs, '*'));
> -			rs[i].dst = xstrndup(rhs, rlen);
> -		}
> -
> -		llen = (rhs ? (rhs - lhs - 1) : strlen(lhs));
> -		if (1 <= llen && memchr(lhs, '*', llen)) {
> -			if ((rhs && !is_glob) || (!rhs && fetch))
> -				goto invalid;
> -			is_glob = 1;
> -		} else if (rhs && is_glob) {
> -			goto invalid;
> -		}
> -
> -		rs[i].pattern = is_glob;
> -		rs[i].src = xstrndup(lhs, llen);
> -		flags = REFNAME_ALLOW_ONELEVEL | (is_glob ? REFNAME_REFSPEC_PATTERN : 0);
> -
> -		if (fetch) {
> -			struct object_id unused;
> -
> -			/* LHS */
> -			if (!*rs[i].src)
> -				; /* empty is ok; it means "HEAD" */
> -			else if (llen == GIT_SHA1_HEXSZ && !get_oid_hex(rs[i].src, &unused))
> -				rs[i].exact_sha1 = 1; /* ok */
> -			else if (!check_refname_format(rs[i].src, flags))
> -				; /* valid looking ref is ok */
> -			else
> -				goto invalid;
> -			/* RHS */
> -			if (!rs[i].dst)
> -				; /* missing is ok; it is the same as empty */
> -			else if (!*rs[i].dst)
> -				; /* empty is ok; it means "do not store" */
> -			else if (!check_refname_format(rs[i].dst, flags))
> -				; /* valid looking ref is ok */
> -			else
> -				goto invalid;
> -		} else {
> -			/*
> -			 * LHS
> -			 * - empty is allowed; it means delete.
> -			 * - when wildcarded, it must be a valid looking ref.
> -			 * - otherwise, it must be an extended SHA-1, but
> -			 *   there is no existing way to validate this.
> -			 */
> -			if (!*rs[i].src)
> -				; /* empty is ok */
> -			else if (is_glob) {
> -				if (check_refname_format(rs[i].src, flags))
> -					goto invalid;
> -			}
> -			else
> -				; /* anything goes, for now */
> -			/*
> -			 * RHS
> -			 * - missing is allowed, but LHS then must be a
> -			 *   valid looking ref.
> -			 * - empty is not allowed.
> -			 * - otherwise it must be a valid looking ref.
> -			 */
> -			if (!rs[i].dst) {
> -				if (check_refname_format(rs[i].src, flags))
> -					goto invalid;
> -			} else if (!*rs[i].dst) {
> -				goto invalid;
> -			} else {
> -				if (check_refname_format(rs[i].dst, flags))
> -					goto invalid;
> -			}
> -		}
> -	}
> -	return rs;
> -
> - invalid:
> -	if (verify) {
> -		/*
> -		 * nr_refspec must be greater than zero and i must be valid
> -		 * since it is only possible to reach this point from within
> -		 * the for loop above.
> -		 */
> -		free_refspec(i+1, rs);
> -		return NULL;
> -	}
> -	die("Invalid refspec '%s'", refspec[i]);
> -}
> -
> -int valid_fetch_refspec(const char *fetch_refspec_str)
> -{
> -	struct refspec *refspec;
> -
> -	refspec = parse_refspec_internal(1, &fetch_refspec_str, 1, 1);
> -	free_refspec(1, refspec);
> -	return !!refspec;
> -}
> -
> -struct refspec *parse_fetch_refspec(int nr_refspec, const char **refspec)
> -{
> -	return parse_refspec_internal(nr_refspec, refspec, 1, 0);
> -}
> -
> -struct refspec *parse_push_refspec(int nr_refspec, const char **refspec)
> -{
> -	return parse_refspec_internal(nr_refspec, refspec, 0, 0);
> -}
> -
> -void free_refspec(int nr_refspec, struct refspec *refspec)
> -{
> -	int i;
> -
> -	if (!refspec)
> -		return;
> -
> -	for (i = 0; i < nr_refspec; i++) {
> -		free(refspec[i].src);
> -		free(refspec[i].dst);
> -	}
> -	free(refspec);
> -}
> -
>  static int valid_remote_nick(const char *name)
>  {
>  	if (!name[0] || is_dot_or_dotdot(name))
> diff --git a/remote.h b/remote.h
> index 2b3180f94..386ced901 100644
> --- a/remote.h
> +++ b/remote.h
> @@ -68,18 +68,6 @@ int for_each_remote(each_remote_fn fn, void *priv);
>  
>  int remote_has_url(struct remote *remote, const char *url);
>  
> -struct refspec {
> -	unsigned force : 1;
> -	unsigned pattern : 1;
> -	unsigned matching : 1;
> -	unsigned exact_sha1 : 1;
> -
> -	char *src;
> -	char *dst;
> -};
> -
> -extern const struct refspec *tag_refspec;
> -
>  struct ref {
>  	struct ref *next;
>  	struct object_id old_oid;
> @@ -175,12 +163,6 @@ int ref_newer(const struct object_id *new_oid, const struct object_id *old_oid);
>   */
>  struct ref *ref_remove_duplicates(struct ref *ref_map);
>  
> -int valid_fetch_refspec(const char *refspec);
> -struct refspec *parse_fetch_refspec(int nr_refspec, const char **refspec);
> -extern struct refspec *parse_push_refspec(int nr_refspec, const char **refspec);
> -
> -void free_refspec(int nr_refspec, struct refspec *refspec);
> -
>  extern int query_refspecs(struct refspec *specs, int nr, struct refspec *query);
>  char *apply_refspecs(struct refspec *refspecs, int nr_refspec,
>  		     const char *name);
> @@ -313,8 +295,6 @@ extern int parseopt_push_cas_option(const struct option *, const char *arg, int
>  extern int is_empty_cas(const struct push_cas_option *);
>  void apply_push_cas(struct push_cas_option *, struct remote *, struct ref *);
>  
> -#define TAG_REFSPEC "refs/tags/*:refs/tags/*"
> -
>  void add_prune_tags_to_fetch_refspec(struct remote *remote);
>  
>  #endif
> diff --git a/transport-helper.c b/transport-helper.c
> index 11f1055b4..b99e1cce9 100644
> --- a/transport-helper.c
> +++ b/transport-helper.c
> @@ -11,6 +11,7 @@
>  #include "sigchain.h"
>  #include "argv-array.h"
>  #include "refs.h"
> +#include "refspec.h"
>  #include "transport-internal.h"
>  #include "protocol.h"
>  
> diff --git a/transport.c b/transport.c
> index 37410d8aa..2cf63d18b 100644
> --- a/transport.c
> +++ b/transport.c
> @@ -11,6 +11,7 @@
>  #include "bundle.h"
>  #include "dir.h"
>  #include "refs.h"
> +#include "refspec.h"
>  #include "branch.h"
>  #include "url.h"
>  #include "submodule.h"
Previous: Brandon WilliamsNext: Brandon Williams
Message 3 of 112 in “refactoring refspecs”
  1. 00/35 refactoring refspecsBrandon Williams, May 14, 2018
  2. 01/35 refspec: move refspec parsing logic into its own fileBrandon Williams, May 14, 2018
  3. Junio C HamanoMay 15, 2018
  4. Brandon WilliamsMay 15, 2018
  5. Junio C HamanoMay 16, 2018
  6. 02/35 refspec: factor out parsing a single refspecBrandon Williams, May 14, 2018
  7. 03/35 refspec: rename struct refspec to struct refspec_itemBrandon Williams, May 14, 2018
  8. Junio C HamanoMay 15, 2018
  9. Brandon WilliamsMay 15, 2018
  10. 04/35 refspec: introduce struct refspecBrandon Williams, May 14, 2018
  11. Junio C HamanoMay 15, 2018
  12. Brandon WilliamsMay 15, 2018
  13. 06/35 submodule--helper: convert push_check to use struct refspecBrandon Williams, May 14, 2018
  14. 07/35 pull: convert get_tracking_branch to use refspec_item_initBrandon Williams, May 14, 2018
  15. 05/35 refspec: convert valid_fetch_refspec to use parse_refspecBrandon Williams, May 14, 2018
  16. Junio C HamanoMay 15, 2018
  17. 08/35 transport: convert transport_push to use struct refspecBrandon Williams, May 14, 2018
  18. 09/35 remote: convert check_push_refs to use struct refspecBrandon Williams, May 14, 2018
  19. 14/35 remote: convert fetch refspecs to struct refspecBrandon Williams, May 14, 2018
  20. Ævar Arnfjörð BjarmasonMay 15, 2018
  21. Brandon WilliamsMay 15, 2018
  22. 15/35 transport-helper: convert to use struct refspecBrandon Williams, May 14, 2018
  23. 17/35 fetch: convert refmap to use struct refspecBrandon Williams, May 14, 2018
  24. 18/35 refspec: remove the deprecated functionsBrandon Williams, May 14, 2018
  25. 19/35 fetch: convert do_fetch to take a struct refspecBrandon Williams, May 14, 2018
  26. 22/35 remote: convert get_stale_heads to take a struct refspecBrandon Williams, May 14, 2018
  27. 24/35 remote: convert query_refspecs to take a struct refspecBrandon Williams, May 14, 2018
  28. 25/35 remote: convert get_ref_match to take a struct refspecBrandon Williams, May 14, 2018
  29. 26/35 remote: convert match_explicit_refs to take a struct refspecBrandon Williams, May 14, 2018
  30. 27/35 push: check for errors earlierBrandon Williams, May 14, 2018
  31. 32/35 http-push: store refspecs in a struct refspecBrandon Williams, May 14, 2018
  32. 33/35 remote: convert match_push_refs to take a struct refspecBrandon Williams, May 14, 2018
  33. 34/35 remote: convert check_push_refs to take a struct refspecBrandon Williams, May 14, 2018
  34. 35/35 submodule: convert push_unpushed_submodules to take a struct refspecBrandon Williams, May 14, 2018
  35. Ævar Arnfjörð BjarmasonMay 15, 2018
  36. Stefan BellerMay 15, 2018
  37. Brandon WilliamsMay 15, 2018
  38. 31/35 transport: remove transport_verify_remote_namesBrandon Williams, May 14, 2018
  39. 28/35 push: convert to use struct refspecBrandon Williams, May 14, 2018
  40. 30/35 send-pack: store refspecs in a struct refspecBrandon Williams, May 14, 2018
  41. 29/35 transport: convert transport_push to take a struct refspecBrandon Williams, May 14, 2018
  42. 23/35 remote: convert apply_refspecs to take a struct refspecBrandon Williams, May 14, 2018
  43. 21/35 fetch: convert prune_refs to take a struct refspecBrandon Williams, May 14, 2018
  44. 20/35 fetch: convert get_ref_map to take a struct refspecBrandon Williams, May 14, 2018
  45. 16/35 fetch: convert fetch_one to use struct refspecBrandon Williams, May 14, 2018
  46. 13/35 remote: convert push refspecs to struct refspecBrandon Williams, May 14, 2018
  47. 12/35 fast-export: convert to use struct refspecBrandon Williams, May 14, 2018
  48. 10/35 remote: convert match_push_refs to use struct refspecBrandon Williams, May 14, 2018
  49. 11/35 clone: convert cmd_clone to use refspec_item_initBrandon Williams, May 14, 2018
  50. Stefan BellerMay 14, 2018
  51. Junio C HamanoMay 15, 2018
  52. Ævar Arnfjörð BjarmasonMay 15, 2018
  53. Brandon WilliamsMay 15, 2018
  54. 00/36 refactoring refspecsBrandon Williams, May 16, 2018
  55. 01/36 refspec: move refspec parsing logic into its own fileBrandon Williams, May 16, 2018
  56. 02/36 refspec: rename struct refspec to struct refspec_itemBrandon Williams, May 16, 2018
  57. 03/36 refspec: factor out parsing a single refspecBrandon Williams, May 16, 2018
  58. 05/36 refspec: convert valid_fetch_refspec to use parse_refspecBrandon Williams, May 16, 2018
  59. Martin ÅgrenJun 3, 2018
  60. refspec: initalize `refspec_item` in `valid_fetch_refspec()`Martin Ågren, Jun 4, 2018
  61. Brandon WilliamsJun 4, 2018
  62. Ævar Arnfjörð BjarmasonJun 4, 2018
  63. Martin ÅgrenJun 5, 2018
  64. Brandon WilliamsJun 5, 2018
  65. 0/3 refspec: refactor & fix free() behaviorÆvar Arnfjörð Bjarmason, Jun 5, 2018
  66. 2/3 refspec: add back a refspec_item_init() functionÆvar Arnfjörð Bjarmason, Jun 5, 2018
  67. 1/3 refspec: s/refspec_item_init/&_or_die/gÆvar Arnfjörð Bjarmason, Jun 5, 2018
  68. 3/3 refspec: initalize `refspec_item` in `valid_fetch_refspec()`Ævar Arnfjörð Bjarmason, Jun 5, 2018
  69. Brandon WilliamsJun 5, 2018
  70. Martin ÅgrenJun 5, 2018
  71. 04/36 refspec: introduce struct refspecBrandon Williams, May 16, 2018
  72. 06/36 submodule--helper: convert push_check to use struct refspecBrandon Williams, May 16, 2018
  73. 07/36 pull: convert get_tracking_branch to use refspec_item_initBrandon Williams, May 16, 2018
  74. 10/36 remote: convert match_push_refs to use struct refspecBrandon Williams, May 16, 2018
  75. 11/36 clone: convert cmd_clone to use refspec_item_initBrandon Williams, May 16, 2018
  76. 12/36 fast-export: convert to use struct refspecBrandon Williams, May 16, 2018
  77. 09/36 remote: convert check_push_refs to use struct refspecBrandon Williams, May 16, 2018
  78. 14/36 remote: convert fetch refspecs to struct refspecBrandon Williams, May 16, 2018
  79. 13/36 remote: convert push refspecs to struct refspecBrandon Williams, May 16, 2018
  80. 16/36 transport-helper: convert to use struct refspecBrandon Williams, May 16, 2018
  81. 18/36 fetch: convert refmap to use struct refspecBrandon Williams, May 16, 2018
  82. 19/36 refspec: remove the deprecated functionsBrandon Williams, May 16, 2018
  83. 20/36 fetch: convert do_fetch to take a struct refspecBrandon Williams, May 16, 2018
  84. 21/36 fetch: convert get_ref_map to take a struct refspecBrandon Williams, May 16, 2018
  85. 15/36 remote: remove add_prune_tags_to_fetch_refspecBrandon Williams, May 16, 2018
  86. 24/36 remote: convert apply_refspecs to take a struct refspecBrandon Williams, May 16, 2018
  87. 26/36 remote: convert get_ref_match to take a struct refspecBrandon Williams, May 16, 2018
  88. 27/36 remote: convert match_explicit_refs to take a struct refspecBrandon Williams, May 16, 2018
  89. 17/36 fetch: convert fetch_one to use struct refspecBrandon Williams, May 16, 2018
  90. 25/36 remote: convert query_refspecs to take a struct refspecBrandon Williams, May 16, 2018
  91. 28/36 push: check for errors earlierBrandon Williams, May 16, 2018
  92. 32/36 transport: remove transport_verify_remote_namesBrandon Williams, May 16, 2018
  93. 34/36 remote: convert match_push_refs to take a struct refspecBrandon Williams, May 16, 2018
  94. 35/36 remote: convert check_push_refs to take a struct refspecBrandon Williams, May 16, 2018
  95. 33/36 http-push: store refspecs in a struct refspecBrandon Williams, May 16, 2018
  96. 36/36 submodule: convert push_unpushed_submodules to take a struct refspecBrandon Williams, May 16, 2018
  97. 30/36 transport: convert transport_push to take a struct refspecBrandon Williams, May 16, 2018
  98. 31/36 send-pack: store refspecs in a struct refspecBrandon Williams, May 16, 2018
  99. 29/36 push: convert to use struct refspecBrandon Williams, May 16, 2018
  100. 22/36 fetch: convert prune_refs to take a struct refspecBrandon Williams, May 16, 2018
  101. 23/36 remote: convert get_stale_heads to take a struct refspecBrandon Williams, May 16, 2018
  102. 08/36 transport: convert transport_push to use struct refspecBrandon Williams, May 16, 2018
  103. 0/2 generating ref-prefixes for configured refspecsBrandon Williams, May 16, 2018
  104. 1/2 refspec: consolidate ref-prefix generation logicBrandon Williams, May 16, 2018
  105. Jonathan NiederMay 31, 2018
  106. Jonathan NiederMay 31, 2018
  107. fetch: do not pass ref-prefixes for fetch by exact SHA1Jonathan Nieder, May 31, 2018
  108. Brandon WilliamsMay 31, 2018
  109. Junio C HamanoJun 1, 2018
  110. Jonathan NiederJun 1, 2018
  111. 2/2 fetch: generate ref-prefixes when using a configured refspecBrandon Williams, May 16, 2018
  112. Junio C HamanoMay 17, 2018

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.