summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
4d8fa91)
git-merge-cache reporting failed merge program is undesirable for
Cogito, since it emits its own more appropriate error message in that
case. However, I want to show other possible git-merge-cache error
messages. So -q will just silence this particular error.
Signed-off-by: Petr Baudis <pasky@ucw.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
-'git-merge-cache' [-o] <merge-program> (-a | -- | <file>\*)
+'git-merge-cache' [-o] [-q] <merge-program> (-a | -- | <file>\*)
returned errors, and only return the error code after all the
merges are over.
returned errors, and only return the error code after all the
merges are over.
+-q::
+ Do not complain about failed merge program (the merge program
+ failure usually indicates conflicts during merge). This is for
+ porcelains which might want to emit custom messages.
+
If "git-merge-cache" is called with multiple <file>s (or -a) then it
processes them in turn only stopping if merge returns a non-zero exit
code.
If "git-merge-cache" is called with multiple <file>s (or -a) then it
processes them in turn only stopping if merge returns a non-zero exit
code.
the RCS package.
A sample script called "git-merge-one-file-script" is included in the
the RCS package.
A sample script called "git-merge-one-file-script" is included in the
ALERT ALERT ALERT! The git "merge object order" is different from the
RCS "merge" program merge object order. In the above ordering, the
ALERT ALERT ALERT! The git "merge object order" is different from the
RCS "merge" program merge object order. In the above ordering, the
static const char *pgm = NULL;
static const char *arguments[8];
static const char *pgm = NULL;
static const char *arguments[8];
+static int one_shot, quiet;
static int err;
static void run_program(void)
static int err;
static void run_program(void)
die("unable to execute '%s'", pgm);
}
if (waitpid(pid, &status, 0) < 0 || !WIFEXITED(status) || WEXITSTATUS(status)) {
die("unable to execute '%s'", pgm);
}
if (waitpid(pid, &status, 0) < 0 || !WIFEXITED(status) || WEXITSTATUS(status)) {
- else
- die("merge program failed");
+ } else {
+ if (quiet)
+ die("merge program failed");
+ exit(1);
+ }
int i, force_file = 0;
if (argc < 3)
int i, force_file = 0;
if (argc < 3)
- usage("git-merge-cache [-o] <merge-program> (-a | <filename>*)");
+ usage("git-merge-cache [-o] [-q] <merge-program> (-a | <filename>*)");
- if (!strcmp(argv[1], "-o")) {
+ if (!strcmp(argv[i], "-o")) {
+ if (!strcmp(argv[i], "-q")) {
+ quiet = 1;
+ i++;
+ }
pgm = argv[i++];
for (; i < argc; i++) {
char *arg = argv[i];
pgm = argv[i++];
for (; i < argc; i++) {
char *arg = argv[i];
die("merge program failed");
die("merge program failed");