~ubuntu-branches/ubuntu/intrepid/git-core/intrepid-security

« back to all changes in this revision

Viewing changes to Documentation/diff-format.txt

  • Committer: Package Import Robot
  • Author(s): Gerrit Pape
  • Date: 2007-10-04 08:27:01 UTC
  • mfrom: (1.1.23)
  • Revision ID: package-import@ubuntu.com-20071004082701-rsd058ontoqz4i30
Tags: 1:1.5.3.4-1
new upstream point release (closes: #445188).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
The output format from "git-diff-index", "git-diff-tree" and
2
2
"git-diff-files" are very similar.
3
3
 
4
 
These commands all compare two sets of things; what is 
 
4
These commands all compare two sets of things; what is
5
5
compared differs:
6
6
 
7
7
git-diff-index <tree-ish>::
126
126
    If there is need for such substitution then the whole
127
127
    pathname is put in double quotes.
128
128
 
 
129
The similarity index is the percentage of unchanged lines, and
 
130
the dissimilarity index is the percentage of changed lines.  It
 
131
is a rounded down integer, followed by a percent sign.  The
 
132
similarity index value of 100% is thus reserved for two equal
 
133
files, while 100% dissimilarity means that no line from the old
 
134
file made it into the new one.
 
135
 
129
136
 
130
137
combined diff format
131
138
--------------------
139
146
--- a/describe.c
140
147
+++ b/describe.c
141
148
@@@ -98,20 -98,12 +98,20 @@@
142
 
        return (a_date > b_date) ? -1 : (a_date == b_date) ? 0 : 1;
 
149
        return (a_date > b_date) ? -1 : (a_date == b_date) ? 0 : 1;
143
150
  }
144
 
  
 
151
 
145
152
- static void describe(char *arg)
146
153
 -static void describe(struct commit *cmit, int last_one)
147
154
++static void describe(char *arg, int last_one)
148
155
  {
149
156
 +      unsigned char sha1[20];
150
157
 +      struct commit *cmit;
151
 
        struct commit_list *list;
152
 
        static int initialized = 0;
153
 
        struct commit_name *n;
154
 
  
 
158
        struct commit_list *list;
 
159
        static int initialized = 0;
 
160
        struct commit_name *n;
 
161
 
155
162
 +      if (get_sha1(arg, sha1) < 0)
156
163
 +              usage(describe_usage);
157
164
 +      cmit = lookup_commit_reference(sha1);
158
165
 +      if (!cmit)
159
166
 +              usage(describe_usage);
160
167
 +
161
 
        if (!initialized) {
162
 
                initialized = 1;
163
 
                for_each_ref(get_name);
 
168
        if (!initialized) {
 
169
                initialized = 1;
 
170
                for_each_ref(get_name);
164
171
------------
165
172
 
166
173
1.   It is preceded with a "git diff" header, that looks like
233
240
two unresolved merge parents with the working tree file
234
241
(i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
235
242
"their version").
236