From 81e50eabf06dd68e8e62a9b697eaf60904c58b22 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 21 May 2005 19:42:18 -0700 Subject: [PATCH] The diff-raw format updates. Update the diff-raw format as Linus and I discussed, except that it does not use sequence of underscore '_' letters to express nonexistence. All '0' mode is used for that purpose instead. The new diff-raw format can express rename/copy, and the earlier restriction that -M and -C _must_ be used with the patch format output is no longer necessary. The patch makes -M and -C flags independent of -p flag, so you need to say git-whatchanged -M -p to get the diff/patch format. Updated are both documentations and tests. Signed-off-by: Junio C Hamano Signed-off-by: Linus Torvalds --- Documentation/diff-format.txt | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'Documentation/diff-format.txt') diff --git a/Documentation/diff-format.txt b/Documentation/diff-format.txt index 9e6453997..7e9a515ad 100644 --- a/Documentation/diff-format.txt +++ b/Documentation/diff-format.txt @@ -16,25 +16,30 @@ git-diff-tree [-r] [...]:: git-diff-files [...]:: compares the cache and the files on the filesystem. -The following desription uses "old" and "new" to mean those -compared entities. -For files in old but not in new (i.e. removed): +An output line is formatted this way: - - \t \t \t + ':' ' ' ' ' ' ' I I L -For files not in old but in new (i.e. added): +By default, I and L are '\t' and '\n' respectively. When '-z' +flag is in effect, both I and L are '\0'. - + \t \t \t +In each , and pair, left hand side describes +the left hand side of what is being compared ( in +git-diff-cache, in git-diff-tree, cache contents in +git-diff-files). Non-existence is shown by having 000000 in the + column. That is, 000000 appears as the first for +newly created files, and as the second for deleted files. -For files that differ: +Usually two are the same. When rename/copy detection is +used, however, an "create" and another "delete" records can be +merged into a single record that has two , old name and +new name. - *-> \t \t -> \t + is shown as all 0's if new is a file on the filesystem +and it is out of sync with the cache. Example: - is shown as all 0's if new is a file on the -filesystem and it is out of sync with the cache. Example: - - *100644->100644 blob 5be4a4.......->000000....... file.c + :100644 100644 5be4a4...... 000000...... file.c file.c Generating patches with -p -- cgit v1.2.1