git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
19fff9a113d1ceb02ebad272ef8c35af6189971d blob 1579 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
 
#define USE_THE_INDEX_COMPATIBILITY_MACROS
#include "builtin.h"
#include "lockfile.h"
#include "merge-strategies.h"

int cmd_merge_index(int argc, const char **argv, const char *prefix)
{
	int i, force_file = 0, err = 0, one_shot = 0, quiet = 0;
	const char *pgm;
	void *data;
	merge_cb merge_action;
	struct lock_file lock = LOCK_INIT;

	/* Without this we cannot rely on waitpid() to tell
	 * what happened to our children.
	 */
	signal(SIGCHLD, SIG_DFL);

	if (argc < 3)
		usage("git merge-index [-o] [-q] <merge-program> (-a | [--] [<filename>...])");

	read_cache();

	i = 1;
	if (!strcmp(argv[i], "-o")) {
		one_shot = 1;
		i++;
	}
	if (!strcmp(argv[i], "-q")) {
		quiet = 1;
		i++;
	}

	pgm = argv[i++];
	if (!strcmp(pgm, "git-merge-one-file")) {
		merge_action = merge_one_file_cb;
		data = (void *)the_repository;

		setup_work_tree();
		hold_locked_index(&lock, LOCK_DIE_ON_ERROR);
	} else {
		merge_action = merge_program_cb;
		data = (void *)pgm;
	}

	for (; i < argc; i++) {
		const char *arg = argv[i];
		if (!force_file && *arg == '-') {
			if (!strcmp(arg, "--")) {
				force_file = 1;
				continue;
			}
			if (!strcmp(arg, "-a")) {
				err |= merge_all(&the_index, one_shot, quiet,
						 merge_action, data);
				continue;
			}
			die("git merge-index: unknown option %s", arg);
		}
		err |= merge_one_path(&the_index, one_shot, quiet, arg,
				      merge_action, data);
	}

	if (merge_action == merge_one_file_cb) {
		if (err) {
			rollback_lock_file(&lock);
			return err;
		}

		return write_locked_index(&the_index, &lock, COMMIT_LOCK);
	}
	return err;
}
debug log:

solving 19fff9a113 ...
found 19fff9a113 in https://public-inbox.org/git/20201005122646.27994-5-alban.gruin@gmail.com/ ||
	https://public-inbox.org/git/20200901105705.6059-5-alban.gruin@gmail.com/ ||
	https://public-inbox.org/git/alpine.LFD.2.21.2007121330130.17922@andromeda.lan/
found 6cb666cc78 in https://public-inbox.org/git/20201005122646.27994-4-alban.gruin@gmail.com/ ||
	https://public-inbox.org/git/20200901105705.6059-4-alban.gruin@gmail.com/ ||
	https://public-inbox.org/git/20200625121953.16991-7-alban.gruin@gmail.com/
found 38ea6ad6ca in https://80x24.org/mirrors/git.git
preparing index
index prepared:
100644 38ea6ad6ca25d5a969afdbfc5b3510ba44e49a33	builtin/merge-index.c

applying [1/6] https://public-inbox.org/git/20201005122646.27994-4-alban.gruin@gmail.com/
diff --git a/builtin/merge-index.c b/builtin/merge-index.c
index 38ea6ad6ca..6cb666cc78 100644

Checking patch builtin/merge-index.c...
Applied patch builtin/merge-index.c cleanly.

skipping https://public-inbox.org/git/20200901105705.6059-4-alban.gruin@gmail.com/ for 6cb666cc78
skipping https://public-inbox.org/git/20200625121953.16991-7-alban.gruin@gmail.com/ for 6cb666cc78
index at:
100644 6cb666cc78fdb9050374796f0801d204b8e6da0b	builtin/merge-index.c

applying [2/6] https://public-inbox.org/git/20201005122646.27994-5-alban.gruin@gmail.com/
diff --git a/builtin/merge-index.c b/builtin/merge-index.c
index 6cb666cc78..19fff9a113 100644

Checking patch builtin/merge-index.c...
Applied patch builtin/merge-index.c cleanly.

skipping https://public-inbox.org/git/20200901105705.6059-5-alban.gruin@gmail.com/ for 19fff9a113
skipping https://public-inbox.org/git/alpine.LFD.2.21.2007121330130.17922@andromeda.lan/ for 19fff9a113
index at:
100644 19fff9a113d1ceb02ebad272ef8c35af6189971d	builtin/merge-index.c

Code repositories for project(s) associated with this 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).