git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
18699ea9c4a3dba2603773b17356d023d4396ca0 blob 1706 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
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
 
#!/bin/rc

rfork e

fn die {
	echo $* >[1=2]
	exit die
}

fn command_list {
	grep -v '^#' $1
}

fn get_categories {
	tr ' ' '\x0a'|
	grep -v '^$' |
	sort |
	uniq
}

fn category_list {
	command_list $1 |
	awk '{ print substr($0, 40) }' |
	get_categories
}

fn get_synopsis {
	sed -n '
		/^NAME/,/'$1'/h
		${
			x
			s/.*'$1' - (.*)/N_\("\1"\)/
			p
		}' Documentation/$1.txt
}

fn define_categories {
	echo
	echo '/* Command categories */'
	bit=0
	category_list $1 |
	while(cat=`{read}){
		echo '#define CAT_'$"cat' (1UL << '$bit')'
		bit=`{hoc -e $bit' + 1'}
	}
	test $bit -gt 32 && die 'Urgh.. too many categories?'
}

fn define_category_names {
	echo
	echo '/* Category names */'
	echo 'static const char *category_names[] = {'
	bit=0
	category_list $1 |
	while(cat=`{read}){
		echo '	"'$"cat'", /* (1UL << '$bit') */'
		bit=`{hoc -e $bit' + 1'}
	}
	echo '	NULL,'
	echo '};'
}

fn print_command_list {
	echo 'static struct cmdname_help command_list[] = {'

	command_list $1 |
	while(a=`{read}){
		s=`{get_synopsis $a(1)}
		q=`{seq 2 $#a}
		echo -n '	{ "'^$a(1)^'", '$"s', 0'
		for(cat in `{echo $a($q) | get_categories})
			echo -n ' | CAT_'^$cat
		echo ' },'
	}
	echo '};'
}

fn print_config_list {
	echo 'static const char *config_name_list[] = {'
	grep -h '^[a-zA-Z].*\..*::$' Documentation/*config.txt Documentation/config/*.txt |
	sed '/deprecated/d; s/::$//; s/,  */\n/g' |
	sort |
	while(line=`{read})
		echo '	"'$"line'",'
	echo '	NULL'
	echo '};'
}

echo '/* Automatically generated by generate-cmdlist.sh */
struct cmdname_help {
	const char *name;
	const char *help;
	uint32_t category;
};
'
define_categories $1
echo
define_category_names $1
echo
print_command_list $1
echo
print_config_list
debug log:

solving 18699ea9c4 ...
found 18699ea9c4 in https://public-inbox.org/git/d25bcb43e1d8fe68717c6df57063427ab5a142f4.1564876327.git.gitgitgadget@gmail.com/

applying [1/1] https://public-inbox.org/git/d25bcb43e1d8fe68717c6df57063427ab5a142f4.1564876327.git.gitgitgadget@gmail.com/
diff --git a/generate-cmdlist.rc b/generate-cmdlist.rc
new file mode 100755
index 0000000000..18699ea9c4

Checking patch generate-cmdlist.rc...
Applied patch generate-cmdlist.rc cleanly.

index at:
100755 18699ea9c4a3dba2603773b17356d023d4396ca0	generate-cmdlist.rc

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://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/inbox.comp.version-control.git
	nntp://ie5yzdi7fg72h7s4sdcztq5evakq23rdt33mfyfcddc5u3ndnw24ogqd.onion/inbox.comp.version-control.git
	nntp://4uok3hntl7oi7b4uf4rtfwefqeexfzil2w6kgk2jn5z2f764irre7byd.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 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