94ac3c31
|
38
|
static int disable_bits(tcflag_t bits)
|
94ac3c31
|
49
|
t.c_lflag &= ~bits;
|
94ac3c31
|
59
|
static int disable_echo(void)
|
94ac3c31
|
61
|
return disable_bits(ECHO);
|
a5e46e6b
|
64
|
static int enable_non_canonical(void)
|
a5e46e6b
|
66
|
return disable_bits(ICANON | ECHO);
|
12acdf57
|
255
|
static int sequence_entry_cmp(const void *hashmap_cmp_fn_data,
|
12acdf57
|
260
|
return strcmp(e1->sequence, keydata ? keydata : e2->sequence);
|
12acdf57
|
263
|
static int is_known_escape_sequence(const char *sequence)
|
12acdf57
|
268
|
if (!initialized) {
|
12acdf57
|
269
|
struct child_process cp = CHILD_PROCESS_INIT;
|
12acdf57
|
270
|
struct strbuf buf = STRBUF_INIT;
|
12acdf57
|
273
|
hashmap_init(&sequences, (hashmap_cmp_fn)sequence_entry_cmp,
|
12acdf57
|
276
|
argv_array_pushl(&cp.args, "infocmp", "-L", "-1", NULL);
|
12acdf57
|
277
|
if (pipe_command(&cp, NULL, 0, &buf, 0, NULL, 0))
|
12acdf57
|
278
|
strbuf_setlen(&buf, 0);
|
12acdf57
|
280
|
for (eol = p = buf.buf; *p; p = eol + 1) {
|
12acdf57
|
281
|
p = strchr(p, '=');
|
12acdf57
|
282
|
if (!p)
|
12acdf57
|
283
|
break;
|
12acdf57
|
284
|
p++;
|
12acdf57
|
285
|
eol = strchrnul(p, '\n');
|
12acdf57
|
287
|
if (starts_with(p, "\\E")) {
|
12acdf57
|
288
|
char *comma = memchr(p, ',', eol - p);
|
12acdf57
|
291
|
p[0] = '^';
|
12acdf57
|
292
|
p[1] = '[';
|
12acdf57
|
293
|
FLEX_ALLOC_MEM(e, sequence, p, comma - p);
|
12acdf57
|
294
|
hashmap_entry_init(&e->entry,
|
12acdf57
|
295
|
strhash(e->sequence));
|
12acdf57
|
296
|
hashmap_add(&sequences, &e->entry);
|
12acdf57
|
298
|
if (!*eol)
|
12acdf57
|
299
|
break;
|
12acdf57
|
301
|
initialized = 1;
|
12acdf57
|
304
|
return !!hashmap_get_from_hash(&sequences, strhash(sequence), sequence);
|
a5e46e6b
|
307
|
int read_key_without_echo(struct strbuf *buf)
|
a5e46e6b
|
312
|
if (warning_displayed || enable_non_canonical() < 0) {
|
a5e46e6b
|
313
|
if (!warning_displayed) {
|
a5e46e6b
|
316
|
warning_displayed = 1;
|
a5e46e6b
|
319
|
return strbuf_getline(buf, stdin);
|
a5e46e6b
|
322
|
strbuf_reset(buf);
|
a5e46e6b
|
323
|
ch = getchar();
|
a5e46e6b
|
324
|
if (ch == EOF) {
|
a5e46e6b
|
325
|
restore_term();
|
a5e46e6b
|
326
|
return EOF;
|
a5e46e6b
|
328
|
strbuf_addch(buf, ch);
|
e118f063
|
330
|
if (ch == '\033' /* ESC */) {
|
e118f063
|
338
|
strbuf_splice(buf, buf->len - 1, 1, "^[", 2);
|
12acdf57
|
345
|
while (!is_known_escape_sequence(buf->buf)) {
|
e118f063
|
346
|
struct pollfd pfd = { .fd = 0, .events = POLLIN };
|
e118f063
|
348
|
if (poll(&pfd, 1, 500) < 1)
|
e118f063
|
349
|
break;
|
e118f063
|
351
|
ch = getchar();
|
e118f063
|
352
|
if (ch == EOF)
|
e118f063
|
353
|
return 0;
|
e118f063
|
354
|
strbuf_addch(buf, ch);
|
a5e46e6b
|
358
|
restore_term();
|
a5e46e6b
|
359
|
return 0;
|
Alban Gruin
|
5a5445d8
|
rebase-interactive: warn if commit is dropped with `rebase --edit-todo'
|
Alban Gruin
|
1da5874c
|
sequencer: move check_todo_list_from_file() to rebase-interactive.c
|
Benno Evers
|
30b1c7ad
|
describe: don't abort too early when searching tags
|
Bert Wesarg
|
f2a2327a
|
config: provide access to the current line number
|
Bert Wesarg
|
b3fd6cbf
|
remote rename/remove: gently handle remote.pushDefault config
|
Bert Wesarg
|
ceff1a13
|
remote: clean-up config callback
|
Bert Wesarg
|
923d4a5c
|
remote rename/remove: handle branch..pushRemote config values
|
Bert Wesarg
|
88f8576e
|
pull --rebase/remote rename: document and honor single-letter abbreviations rebase types
|
Bert Wesarg
|
1a83068c
|
remote: clean-up by returning early to avoid one indentation
|
Derrick Stolee
|
2631dc87
|
sparse-checkout: create 'add' subcommand
|
Derrick Stolee
|
bd64de42
|
sparse-checkout: unquote C-style strings over --stdin
|
Derrick Stolee
|
ef076599
|
sparse-checkout: work with Windows paths
|
Derrick Stolee
|
3c754067
|
sparse-checkout: create leading directories
|
Elijah Newren
|
8295ed69
|
rebase: make the backend configurable via config setting
|
Elijah Newren
|
e98c4269
|
rebase (interactive-backend): fix handling of commits that become empty
|
Elijah Newren
|
8a997ed1
|
rebase, sequencer: remove the broken GIT_QUIET handling
|
Elijah Newren
|
10cdb9f3
|
rebase: rename the two primary rebase backends
|
Elijah Newren
|
d48e5e21
|
rebase (interactive-backend): make --keep-empty the default
|
Emily Shaffer
|
02225408
|
fetch: emphasize failure during submodule fetch
|
Hans Jerry Illikainen
|
54887b46
|
gpg-interface: add minTrustLevel as a configuration option
|
Hariom Verma
|
4ef34648
|
receive.denyCurrentBranch: respect all worktrees
|
Jeff King
|
da806352
|
diff: move diff.wsErrorHighlight to "basic" config
|
Jeff King
|
4eb707eb
|
rev-list: allow commit-only bitmap traversals
|
Jeff King
|
4f3bd560
|
pack-bitmap: implement BLOB_NONE filtering
|
Jeff King
|
bb514de3
|
pack-objects: improve partial packfile reuse
|
Jeff King
|
63f4a7fc
|
pack-check: push oid lookup into loop
|
Jeff King
|
84243da1
|
pack-bitmap: implement BLOB_LIMIT filtering
|
Jeff King
|
551cf8b6
|
pack-bitmap: factor out type iterator initialization
|
Jeff King
|
500e4f23
|
pack-bitmap: use object_id when loading on-disk bitmaps
|
Jeff King
|
3cd309c1
|
xdiff: avoid computing non-zero offset from NULL pointer
|
Jeff King
|
6ac9760a
|
packed_object_info(): use object_id internally for delta base
|
Jeff King
|
55cb10f9
|
rev-list: make --count work with --objects
|
Jeff King
|
e704fc79
|
pack-objects: introduce pack.allowPackReuse
|
Jeff King
|
792f8119
|
rev-list: factor out bitmap-optimized routines
|
Jeff King
|
8dd40c04
|
traverse_trees(): use stack array for name entries
|
Jeff King
|
b99b6bcc
|
packed_object_info(): use object_id for returning delta base
|
Jeff King
|
3f83fd5e
|
pack-objects: read delta base oid into object_id struct
|
Jeff King
|
2fecc48c
|
packfile: drop nth_packed_object_sha1()
|
Jeff King
|
92fb0db9
|
pack-objects: add checks for duplicate objects
|
Jeff King
|
608d9c93
|
rev-list: allow bitmaps when counting objects
|
Johannes Schindelin
|
26027625
|
rebase -i: also avoid SHA-1 collisions with missingCommitsCheck
|
Johannes Schindelin
|
6610e462
|
built-in stash: use the built-in `git add -p` if so configured
|
Johannes Schindelin
|
180f48df
|
built-in add -p: support interactive.diffFilter
|
Johannes Schindelin
|
d2a233cb
|
built-in add -p: prepare for patch modes other than "stage"
|
Johannes Schindelin
|
b6992261
|
rebase -i: re-fix short SHA-1 collision
|
Johannes Schindelin
|
94ac3c31
|
terminal: make the code of disable_echo() reusable
|
Johannes Schindelin
|
12acdf57
|
built-in add -p: handle Escape sequences more efficiently
|
Johannes Schindelin
|
52628f94
|
built-in add -p: implement the "checkout" patch modes
|
Johannes Schindelin
|
a5e46e6b
|
terminal: add a new function to read a single keystroke
|
Johannes Schindelin
|
e118f063
|
built-in add -p: handle Escape sequences in interactive.singlekey mode
|
Johannes Schindelin
|
04f816b1
|
built-in add -p: respect the `interactive.singlekey` config setting
|
Johannes Schindelin
|
90a6bb98
|
legacy stash -p: respect the add.interactive.usebuiltin setting
|
Jonathan Tan
|
50033772
|
connected: verify promisor-ness of partial clone
|
Junio C Hamano
|
0106b1d4
|
Revert "gpg-interface: prefer check_signature() for GPG verification"
|
Junio C Hamano
|
e8e71848
|
Merge branch 'jk/nth-packed-object-id'
|
Kevin Willford
|
8da2c576
|
fsmonitor: handle version 2 of the hooks that will use opaque token
|
Kevin Willford
|
56c69100
|
fsmonitor: change last update timestamp on the index_state to opaque token
|
Matheus Tavares
|
31877c9a
|
object-store: allow threaded access to object reading
|
Matheus Tavares
|
c8123e72
|
streaming: allow open_istream() to handle any repo
|
Matthew Rogers
|
9a83d088
|
submodule-config: add subomdule config scope
|
Matthew Rogers
|
e37efa40
|
config: teach git_config_source to remember its scope
|
Matthew Rogers
|
6dc905d9
|
config: split repo scope to local and worktree
|
Matthew Rogers
|
a5cb4204
|
config: make scope_name non-static and rename it
|
Pranit Bauva
|
6c69f222
|
bisect: libify `bisect_next_all`
|
Pranit Bauva
|
45b63708
|
bisect: libify `check_good_are_ancestors_of_bad` and its dependents
|
René Scharfe
|
2ce6d075
|
use strpbrk(3) to search for characters from a given set
|
René Scharfe
|
a91cc7fa
|
strbuf: add and use strbuf_insertstr()
|
René Scharfe
|
2d539754
|
name-rev: release unused name strings
|
Tanushree Tumane
|
bfacfce7
|
bisect--helper: introduce new `decide_next()` function
|
Tanushree Tumane
|
292731c4
|
bisect--helper: change `retval` to `res`
|
Taylor Blau
|
0bd52e27
|
commit-graph.h: store an odb in 'struct write_commit_graph_context'
|