git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
d693aa1744e7c95e8532f579c346a94e82bf8503 blob 939 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
 
#include "diff.h"
#include "log-tree.h"
#include "color.h"
#include "format-support.h"

static int istitlechar(char c)
{
	return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') ||
		(c >= '0' && c <= '9') || c == '.' || c == '_';
}

void format_sanitized_subject(struct strbuf *sb, const char *msg, size_t len)
{
	char *r = xmemdupz(msg, len);
	size_t trimlen;
	size_t start_len = sb->len;
	int space = 2;
	int i;

	for (i = 0; i < len; i++) {
		if (r[i] == '\n')
			r[i] = ' ';
		if (istitlechar(r[i])) {
			if (space == 1)
				strbuf_addch(sb, '-');
			space = 0;
			strbuf_addch(sb, r[i]);
			if (r[i] == '.')
				while (r[i+1] == '.')
					i++;
		} else
			space |= 1;
	}
	free(r);

	/* trim any trailing '.' or '-' characters */
	trimlen = 0;
	while (sb->len - trimlen > start_len &&
		(sb->buf[sb->len - 1 - trimlen] == '.'
		|| sb->buf[sb->len - 1 - trimlen] == '-'))
		trimlen++;
	strbuf_remove(sb, sb->len - trimlen, trimlen);
}
debug log:

solving d693aa1744 ...
found d693aa1744 in https://public-inbox.org/git/9dc619b44888024201d9ae1f83a4b34c81fa693f.1595882588.git.gitgitgadget@gmail.com/ ||
	https://public-inbox.org/git/7a64495f99ec97258687695d41d106e3f946d551.1597687822.git.gitgitgadget@gmail.com/ ||
	https://public-inbox.org/git/1c43f55d7c1d5a16031115d5de56b5a5302b5597.1596664306.git.gitgitgadget@gmail.com/

applying [1/3] https://public-inbox.org/git/9dc619b44888024201d9ae1f83a4b34c81fa693f.1595882588.git.gitgitgadget@gmail.com/
diff --git a/format-support.c b/format-support.c
new file mode 100644
index 0000000000..d693aa1744

Checking patch format-support.c...
Applied patch format-support.c cleanly.

skipping https://public-inbox.org/git/7a64495f99ec97258687695d41d106e3f946d551.1597687822.git.gitgitgadget@gmail.com/ for d693aa1744
skipping https://public-inbox.org/git/1c43f55d7c1d5a16031115d5de56b5a5302b5597.1596664306.git.gitgitgadget@gmail.com/ for d693aa1744
index at:
100644 d693aa1744e7c95e8532f579c346a94e82bf8503	format-support.c

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