Skip to content

Commit

Permalink
Merge branch 'js/apply'
Browse files Browse the repository at this point in the history
* js/apply:
  apply: make --verbose a little more useful
  • Loading branch information
Junio C Hamano committed Feb 24, 2007
2 parents 503ca3a + aeabfa0 commit 7bd59de
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion builtin-apply.c
Original file line number Diff line number Diff line change
Expand Up @@ -1723,6 +1723,8 @@ static int apply_one_fragment(struct buffer_desc *desc, struct fragment *frag, i
/* Ignore it, we already handled it */
break;
default:
if (apply_verbosely)
error("invalid start of line: '%c'", first);
return -1;
}
patch += len;
Expand Down Expand Up @@ -1820,6 +1822,9 @@ static int apply_one_fragment(struct buffer_desc *desc, struct fragment *frag, i
}
}

if (offset && apply_verbosely)
error("while searching for:\n%.*s", oldsize, oldlines);

free(old);
free(new);
return offset;
Expand Down Expand Up @@ -2811,7 +2816,7 @@ int cmd_apply(int argc, const char **argv, const char *unused_prefix)
apply = apply_with_reject = apply_verbosely = 1;
continue;
}
if (!strcmp(arg, "--verbose")) {
if (!strcmp(arg, "-v") || !strcmp(arg, "--verbose")) {
apply_verbosely = 1;
continue;
}
Expand Down

0 comments on commit 7bd59de

Please sign in to comment.