Merge branch 'master' into next

* master:
  git-tar-tree: fix minor memory leak
  Document rev-list's option --merge
  Further clean-up: usage() vs die()
  Replace some calls to die(usage_str) with usage(usage_str).
  Fixup command names in some usage strings.
This commit is contained in:
Junio C Hamano
2006-08-04 02:09:52 -07:00
15 changed files with 26 additions and 19 deletions

View File

@@ -22,6 +22,7 @@ SYNOPSIS
[ [\--objects | \--objects-edge] [ \--unpacked ] ]
[ \--pretty | \--header ]
[ \--bisect ]
[ \--merge ]
<commit>... [ \-- <paths>... ]
DESCRIPTION
@@ -123,6 +124,10 @@ OPTIONS
topological order (i.e. descendant commits are shown
before their parents).
--merge::
After a failed merge, show refs that touch files having a
conflict and don't exist on all heads to merge.
Author
------
Written by Linus Torvalds <torvalds@osdl.org>

View File

@@ -20,7 +20,7 @@
#define DEBUG 0
static const char blame_usage[] = "[-c] [-l] [-t] [-S <revs-file>] [--] file [commit]\n"
static const char blame_usage[] = "git-blame [-c] [-l] [-t] [-S <revs-file>] [--] file [commit]\n"
" -c, --compatibility Use the same output mode as git-annotate (Default: off)\n"
" -l, --long Show long commit SHA1 (Default: off)\n"
" -t, --time Show raw timestamp (Default: off)\n"

View File

@@ -117,7 +117,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
verbose = 1;
continue;
}
die(builtin_add_usage);
usage(builtin_add_usage);
}
pathspec = get_pathspec(prefix, argv + i);

View File

@@ -9,6 +9,6 @@
int cmd_check_ref_format(int argc, const char **argv, const char *prefix)
{
if (argc != 2)
usage("git check-ref-format refname");
usage("git-check-ref-format refname");
return !!check_ref_format(argv[1]);
}

View File

@@ -23,7 +23,7 @@ struct blobinfo {
};
static const char builtin_diff_usage[] =
"diff <options> <rev>{0,2} -- <path>*";
"git-diff <options> <rev>{0,2} -- <path>*";
static int builtin_diff_files(struct rev_info *revs,
int argc, const char **argv)

View File

@@ -267,7 +267,7 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
else if (!strncmp(arg, "--shared=", 9))
shared_repository = git_config_perm("arg", arg+9);
else
die(init_db_usage);
usage(init_db_usage);
}
/*

View File

@@ -99,7 +99,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
ignore_errors = 1;
continue;
}
die(builtin_mv_usage);
usage(builtin_mv_usage);
}
count = argc - i - 1;
if (count < 1)

View File

@@ -10,7 +10,7 @@
#include "builtin.h"
#include "cache-tree.h"
static const char prune_usage[] = "git prune [-n]";
static const char prune_usage[] = "git-prune [-n]";
static int show_only = 0;
static struct rev_info revs;

View File

@@ -8,7 +8,7 @@
#define MAX_URI (16)
static const char push_usage[] = "git push [--all] [--tags] [-f | --force] <repository> [<refspec>...]";
static const char push_usage[] = "git-push [--all] [--tags] [-f | --force] <repository> [<refspec>...]";
static int all = 0, tags = 0, force = 0, thin = 1;
static const char *execute = NULL;

View File

@@ -80,7 +80,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
force = 1;
continue;
}
die(builtin_rm_usage);
usage(builtin_rm_usage);
}
if (argc <= i)
usage(builtin_rm_usage);
@@ -115,7 +115,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
printf("rm '%s'\n", path);
if (remove_file_from_cache(path))
die("git rm: unable to remove %s", path);
die("git-rm: unable to remove %s", path);
cache_tree_invalidate_path(active_cache_tree, path);
}
@@ -139,7 +139,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
continue;
}
if (!removed)
die("git rm: %s: %s", path, strerror(errno));
die("git-rm: %s: %s", path, strerror(errno));
}
}

View File

@@ -314,6 +314,7 @@ static int generate_tar(int argc, const char **argv, const char *prefix)
struct commit *commit;
struct tree_desc tree;
struct strbuf current_path;
void *buffer;
current_path.buf = xmalloc(PATH_MAX);
current_path.alloc = PATH_MAX;
@@ -341,8 +342,8 @@ static int generate_tar(int argc, const char **argv, const char *prefix)
} else
archive_time = time(NULL);
tree.buf = read_object_with_reference(sha1, tree_type, &tree.size,
tree_sha1);
tree.buf = buffer = read_object_with_reference(sha1, tree_type,
&tree.size, tree_sha1);
if (!tree.buf)
die("not a reference to a tag, commit or tree object: %s",
sha1_to_hex(sha1));
@@ -351,6 +352,7 @@ static int generate_tar(int argc, const char **argv, const char *prefix)
write_entry(tree_sha1, &current_path, 040777, NULL, 0);
traverse_tree(&tree, &current_path);
write_trailer();
free(buffer);
free(current_path.buf);
return 0;
}

View File

@@ -73,7 +73,7 @@ int cmd_write_tree(int argc, const char **argv, const char *unused_prefix)
else if (!strncmp(arg, "--prefix=", 9))
prefix = arg + 9;
else
die(write_tree_usage);
usage(write_tree_usage);
argc--; argv++;
}

View File

@@ -46,7 +46,7 @@ int main(int argc, char **argv)
if (!no_more_flags && argv[i][0] == '-') {
if (!strcmp(argv[i], "-t")) {
if (argc <= ++i)
die(hash_object_usage);
usage(hash_object_usage);
type = argv[i];
}
else if (!strcmp(argv[i], "-w")) {
@@ -66,8 +66,8 @@ int main(int argc, char **argv)
hash_stdin(type, write_object);
}
else
die(hash_object_usage);
}
usage(hash_object_usage);
}
else {
const char *arg = argv[i];
if (0 <= prefix_length)

View File

@@ -123,7 +123,7 @@ int main(int argc, char **argv)
unsigned char result_sha1[20];
if (argc != 1)
usage("cat <signaturefile> | git-mktag");
usage("git-mktag < signaturefile");
setup_git_directory();

View File

@@ -71,7 +71,7 @@ static void write_tree(unsigned char *sha1)
write_sha1_file(buffer, offset, tree_type, sha1);
}
static const char mktree_usage[] = "mktree [-z]";
static const char mktree_usage[] = "git-mktree [-z]";
int main(int ac, char **av)
{