From 0660626caff6ac3745cd7b7908a2ca540141a2ec Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 5 May 2006 02:41:53 -0700 Subject: binary diff: further updates. This updates the user interface and generated diff data format. * "diff --binary" is used to signal that we want an e-mailable binary patch. It implies --full-index and -p. * "apply --allow-binary-replacement" acquired a short synonym "apply --binary". * After the "GIT binary patch\n" header line there is a token to record which binary patch mechanism was used, so that we can extend it later. Currently there are two mechanisms defined: "literal" and "delta". The former records the deflated postimage and the latter records the deflated delta from the preimage to postimage. For purely implementation convenience, I added the deflated length after these "literal/delta" tokens (otherwise the decoding side needs to guess and reallocate the buffer while inflating). Improvement patches are very welcomed. Signed-off-by: Junio C Hamano --- diff.h | 1 + 1 file changed, 1 insertion(+) (limited to 'diff.h') diff --git a/diff.h b/diff.h index b3b2c4dd2..d05260840 100644 --- a/diff.h +++ b/diff.h @@ -28,6 +28,7 @@ struct diff_options { with_raw:1, with_stat:1, tree_in_recursive:1, + binary:1, full_index:1, silent_on_remove:1, find_copies_harder:1; -- cgit v1.2.1 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 --- diff.h | 1 + 1 file changed, 1 insertion(+) (limited to 'diff.h') diff --git a/diff.h b/diff.h index d05260840..bef586d85 100644 --- a/diff.h +++ b/diff.h @@ -32,6 +32,7 @@ struct diff_options { full_index:1, silent_on_remove:1, find_copies_harder:1; + int context; int break_opt; int detect_rename; int line_termination; -- cgit v1.2.1 From 4bbd261bbd941066735e41dff0ade9f50e6fe84d Mon Sep 17 00:00:00 2001 From: Sean Date: Sun, 14 May 2006 08:13:49 -0400 Subject: Add "--summary" option to git diff. Remove the need to pipe git diff through git apply to get the extended headers summary. Signed-off-by: Sean Estabrooks Signed-off-by: Junio C Hamano --- diff.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'diff.h') diff --git a/diff.h b/diff.h index d05260840..70077c6ed 100644 --- a/diff.h +++ b/diff.h @@ -31,7 +31,8 @@ struct diff_options { binary:1, full_index:1, silent_on_remove:1, - find_copies_harder:1; + find_copies_harder:1, + summary:1; int break_opt; int detect_rename; int line_termination; -- cgit v1.2.1 From 8824689884a5673f803d77cda499f83b84145a06 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Sat, 20 May 2006 23:43:13 +0200 Subject: diff family: add --check option Actually, it is a diff option now, so you can say git diff --check to ask if what you are about to commit is a good patch. [jc: this also would work for fmt-patch, but the point is that the check is done before making a commit. format-patch is run from an already created commit, and that is too late to catch whitespace damaged change.] Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- diff.h | 1 + 1 file changed, 1 insertion(+) (limited to 'diff.h') diff --git a/diff.h b/diff.h index 3027974c1..c672277df 100644 --- a/diff.h +++ b/diff.h @@ -153,6 +153,7 @@ extern int diff_queue_is_empty(void); #define DIFF_FORMAT_NAME 4 #define DIFF_FORMAT_NAME_STATUS 5 #define DIFF_FORMAT_DIFFSTAT 6 +#define DIFF_FORMAT_CHECKDIFF 7 extern void diff_flush(struct diff_options*); -- cgit v1.2.1