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

Re: [PATCH 2/2] fetch/push: readd rsync support

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 28, 2007, 21:20 UTC
Message-ID
<7vtzpeo5ar.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<Pine.LNX.4.64.0709281629270.28395@racer.site>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 42 quoted lines
> diff --git a/transport.c b/transport.c
> index 4f9cddc..c8eed95 100644
> --- a/transport.c
> +++ b/transport.c
> @@ -6,6 +6,330 @@
> ...
> +static int direntry_cmp(const void *a, const void *b)
> +{
> +	const struct dirent *d1 = a;
> +	const struct dirent *d2 = b;
> +
> +	return strcmp(d1->d_name, d2->d_name);
> +}
> ...
> +/*
> + * path is assumed to point to a buffer of PATH_MAX bytes, and
> + * path + name_offset is expected to point to "refs/".
> + */
> +
> +static int read_loose_refs(struct strbuf *path, int name_offset,
> +		struct ref **tail)
> +{
> +	DIR *dir = opendir(path->buf);
> +	struct dirent *de;
> +	struct {
> +		char **entries;
> +		int nr, alloc;
> +	} list;
> ...
> +	while ((de = readdir(dir))) {
> +		if (de->d_name[0] == '.' && (de->d_name[1] == '\0' ||
> +				(de->d_name[1] == '.' &&
> +				 de->d_name[2] == '\0')))
> +			continue;
> +		ALLOC_GROW(list.entries, list.nr + 1, list.alloc);
> +		list.entries[list.nr++] = xstrdup(de->d_name);
> +	}
> +	closedir(dir);
> +
> +	/* sort the list */
> +
> +	qsort(list.entries, list.nr, sizeof(*de), direntry_cmp);
Hmmmph...?
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 15 of 19 in “rsync support”
  1. 0/2 rsync supportJohannes Schindelin, Sep 28, 2007
  2. 1/2 Introduce remove_dir_recursively()Johannes Schindelin, Sep 28, 2007
  3. Junio C HamanoSep 28, 2007
  4. Johannes SchindelinSep 28, 2007
  5. David KastrupSep 28, 2007
  6. 2/2 fetch/push: readd rsync supportJohannes Schindelin, Sep 28, 2007
  7. Shawn O. PearceSep 28, 2007
  8. Johannes SchindelinSep 28, 2007
  9. Junio C HamanoSep 28, 2007
  10. Johannes SchindelinSep 28, 2007
  11. 0/2 rsync support, was Re: [PATCH 0/2] rsync supportJohannes Schindelin, Sep 28, 2007
  12. 1/2 Introduce remove_dir_recursively()Johannes Schindelin, Sep 28, 2007
  13. 2/2 fetch/push: readd rsync supportJohannes Schindelin, Sep 28, 2007
  14. Johannes SchindelinSep 28, 2007
  15. Junio C HamanoSep 28, 2007
  16. Johannes SchindelinSep 28, 2007
  17. 2/2 fetch/push: readd rsync supportJohannes Schindelin, Sep 29, 2007
  18. Junio C HamanoSep 30, 2007
  19. Johannes SchindelinSep 30, 2007

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.