git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / Atom feed
659b6bfa81df6d0bcffb8d0a975492d54d79d6bc blob 1514 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
 
#include "test-tool.h"
#include "git-compat-util.h"
#include "strbuf.h"
#include "iterator.h"
#include "dir-iterator.h"

static const char *error_name(int error_number)
{
	switch (error_number) {
	case ENOENT: return "ENOENT";
	case ENOTDIR: return "ENOTDIR";
	default: return "ESOMETHINGELSE";
	}
}

/*
 * usage:
 * tool-test dir-iterator [--follow-symlinks] [--pedantic] directory_path
 */
int cmd__dir_iterator(int argc, const char **argv)
{
	struct dir_iterator *diter;
	unsigned int flags = 0;
	int iter_status;

	for (++argv, --argc; *argv && starts_with(*argv, "--"); ++argv, --argc) {
		if (strcmp(*argv, "--follow-symlinks") == 0)
			flags |= DIR_ITERATOR_FOLLOW_SYMLINKS;
		else if (strcmp(*argv, "--pedantic") == 0)
			flags |= DIR_ITERATOR_PEDANTIC;
		else
			die("invalid option '%s'", *argv);
	}

	if (!*argv || argc != 1)
		die("dir-iterator needs exactly one non-option argument");

	diter = dir_iterator_begin(*argv, flags);

	if (!diter) {
		printf("dir_iterator_begin failure: %s\n", error_name(errno));
		exit(EXIT_FAILURE);
	}

	while ((iter_status = dir_iterator_advance(diter)) == ITER_OK) {
		if (S_ISDIR(diter->st.st_mode))
			printf("[d] ");
		else if (S_ISREG(diter->st.st_mode))
			printf("[f] ");
		else if (S_ISLNK(diter->st.st_mode))
			printf("[s] ");
		else
			printf("[?] ");

		printf("(%s) [%s] %s\n", diter->relative_path, diter->basename,
		       diter->path.buf);
	}

	if (iter_status != ITER_DONE) {
		printf("dir_iterator_advance failure\n");
		return 1;
	}

	return 0;
}
debug log:

solving 659b6bfa81 ...
found 659b6bfa81 in https://80x24.org/mirrors/git.git

git@vger.kernel.org list mirror (unofficial, one of many)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 git git/ https://public-inbox.org/git \
		git@vger.kernel.org
	public-inbox-index git

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for the project(s) associated with this inbox:

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

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git