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

« back to all changes in this revision

Viewing changes to builtin-describe.c

  • 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:
3
3
#include "tag.h"
4
4
#include "refs.h"
5
5
#include "builtin.h"
 
6
#include "exec_cmd.h"
6
7
 
7
8
#define SEEN            (1u<<0)
8
9
#define MAX_TAGS        (FLAG_BITS - 1)
242
243
int cmd_describe(int argc, const char **argv, const char *prefix)
243
244
{
244
245
        int i;
 
246
        int contains = 0;
245
247
 
246
248
        for (i = 1; i < argc; i++) {
247
249
                const char *arg = argv[i];
248
250
 
249
251
                if (*arg != '-')
250
252
                        break;
 
253
                else if (!strcmp(arg, "--contains"))
 
254
                        contains = 1;
251
255
                else if (!strcmp(arg, "--debug"))
252
256
                        debug = 1;
253
257
                else if (!strcmp(arg, "--all"))
272
276
 
273
277
        save_commit_buffer = 0;
274
278
 
 
279
        if (contains) {
 
280
                const char **args = xmalloc((4 + argc - i) * sizeof(char*));
 
281
                args[0] = "name-rev";
 
282
                args[1] = "--name-only";
 
283
                args[2] = "--tags";
 
284
                memcpy(args + 3, argv + i, (argc - i) * sizeof(char*));
 
285
                args[3 + argc - i] = NULL;
 
286
                return cmd_name_rev(3 + argc - i, args, prefix);
 
287
        }
 
288
 
275
289
        if (argc <= i)
276
290
                describe("HEAD", 1);
277
291
        else