git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
blob 0c55ee0b2b254428efe08ec04fddba926d2098f5 877 bytes (raw)
name: prefix-map.h 	 # note: path name is non-authoritative(*)

 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
 
#ifndef PREFIX_MAP_H
#define PREFIX_MAP_H

#include "hashmap.h"

struct prefix_item {
	const char *name;
	size_t prefix_length;
};

/*
 * Given an array of names, find unique prefixes (i.e. the first <n> characters
 * that uniquely identify the names) and store the lengths of the unique
 * prefixes in the 'prefix_length' field of the elements of the given array..
 *
 * Typically, the `struct prefix_item` information is a field in the actual
 * item struct; For this reason, the `array` parameter is specified as an array
 * of pointers to the items.
 *
 * The `min_length`/`max_length` parameters define what length the unique
 * prefixes should have.
 *
 * If no unique prefix could be found for a given item, its `prefix_length`
 * will be set to 0.
 */
void find_unique_prefixes(struct prefix_item **array, size_t nr,
			  size_t min_length, size_t max_length);

#endif

debug log:

solving 0c55ee0b2b ...
found 0c55ee0b2b in https://public-inbox.org/git/c5a699b6b27e04cf341a20258702bb6d3df917e5.1566910672.git.gitgitgadget@gmail.com/

applying [1/1] https://public-inbox.org/git/c5a699b6b27e04cf341a20258702bb6d3df917e5.1566910672.git.gitgitgadget@gmail.com/
diff --git a/prefix-map.h b/prefix-map.h
new file mode 100644
index 0000000000..0c55ee0b2b

Checking patch prefix-map.h...
Applied patch prefix-map.h cleanly.

index at:
100644 0c55ee0b2b254428efe08ec04fddba926d2098f5	prefix-map.h

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).