From ee1e5412a702674d4da95a4aef73a73d2834dcc3 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sat, 13 May 2006 13:23:48 -0700 Subject: git diff: support "-U" and "--unified" options properly We used to parse "-U" and "--unified" as part of the GIT_DIFF_OPTS environment variable, but strangely enough we would _not_ parse them as part of the normal diff command line (where we only accepted "-u"). This adds parsing of -U and --unified, both with an optional numeric argument. So now you can just say git diff --unified=5 to get a unified diff with a five-line context, instead of having to do something silly like GIT_DIFF_OPTS="--unified=5" git diff -u (that silly format does continue to still work, of course). Signed-off-by: Linus Torvalds Signed-off-by: Junio C Hamano --- combine-diff.c | 1 + 1 file changed, 1 insertion(+) (limited to 'combine-diff.c') diff --git a/combine-diff.c b/combine-diff.c index 8a8fe3863a..64b20cce24 100644 --- a/combine-diff.c +++ b/combine-diff.c @@ -608,6 +608,7 @@ static int show_patch_diff(struct combine_diff_path *elem, int num_parent, int abbrev = opt->full_index ? 40 : DEFAULT_ABBREV; mmfile_t result_file; + context = opt->context; /* Read the result of merge first */ if (!working_tree_file) result = grab_blob(elem->sha1, &result_size); -- cgit v1.2.1