author | Junio C Hamano <gitster@pobox.com> | |
Wed, 6 Aug 2008 20:50:42 +0000 (13:50 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 6 Aug 2008 20:50:48 +0000 (13:50 -0700) |
index 23981acf3974a3c609c8ad91683b03a7b8676a39..47ca1724620fa25491c27984a41ca56e2aa4e323 100644 (file)
* "git cvsimport" used to spit out "UNKNOWN LINE..." diagnostics to stdout.
+* "git commit -F filename" and "git tag -F filename" run from subdirectories
+ did not read the right file.
+
* "git init --template=" with blank "template" parameter linked files
under root directories to .git, which was a total nonsense. Instead, it
means "I do not want to use anything from the template directory".
header properly.
Contains other various documentation fixes.
-
---
-exec >/var/tmp/1
-echo O=$(git describe maint)
-O=v1.5.6.4-26-g2b6ca6d
-git shortlog --no-merges $O..maint
index 8c8f35b7a762d42d3c45ff9f4eee1cb32d3917b6..1fdf20dcc9169be2c7a51b32f94893442e160436 100644 (file)
--stdin::
When '--stdin' is specified, the command does not take
<tree-ish> arguments from the command line. Instead, it
- reads either one <commit> or a pair of <tree-ish>
+ reads either one <commit> or a list of <commit>
separated with a single space from its standard input.
+
When a single commit is given on one line of such input, it compares
the commit with its parents. The following flags further affects its
-behavior. This does not apply to the case where two <tree-ish>
-separated with a single space are given.
+behavior. The remaining commits, when given, are used as if they are
+parents of the first commit.
-m::
By default, 'git-diff-tree --stdin' does not show
diff --git a/Documentation/git.txt b/Documentation/git.txt
index 3da5bf050c70b6b73ec72e192fa3fb5c1eb7641c..b1cb97236982dd5fe718765136aa4f1a4fdb994f 100644 (file)
--- a/Documentation/git.txt
+++ b/Documentation/git.txt
branch of the `git.git` repository.
Documentation for older releases are available here:
-* link:v1.5.6.4/git.html[documentation for release 1.5.6.4]
+* link:v1.5.6.5/git.html[documentation for release 1.5.6.5]
* release notes for
+ link:RelNotes-1.5.6.5.txt[1.5.6.5],
link:RelNotes-1.5.6.4.txt[1.5.6.4],
link:RelNotes-1.5.6.3.txt[1.5.6.3],
link:RelNotes-1.5.6.2.txt[1.5.6.2],
diff --git a/builtin-commit.c b/builtin-commit.c
index b783e6eb46d2603d61d3260420c5dff48913d182..649c8beb3e716dd5797787ced61d2fee23b7140f 100644 (file)
--- a/builtin-commit.c
+++ b/builtin-commit.c
COMMIT_PARTIAL,
} commit_style;
-static char *logfile, *force_author;
+static const char *logfile, *force_author;
static const char *template_file;
static char *edit_message, *use_message;
static char *author_name, *author_email, *author_date;
}
static int parse_and_validate_options(int argc, const char *argv[],
- const char * const usage[])
+ const char * const usage[],
+ const char *prefix)
{
int f = 0;
argc = parse_options(argc, argv, builtin_commit_options, usage, 0);
+ logfile = parse_options_fix_filename(prefix, logfile);
+ template_file = parse_options_fix_filename(prefix, template_file);
if (logfile || message.len || use_message)
use_editor = 0;
if (wt_status_use_color == -1)
wt_status_use_color = git_use_color_default;
- argc = parse_and_validate_options(argc, argv, builtin_status_usage);
+ argc = parse_and_validate_options(argc, argv, builtin_status_usage, prefix);
index_file = prepare_index(argc, argv, prefix);
git_config(git_commit_config, NULL);
- argc = parse_and_validate_options(argc, argv, builtin_commit_usage);
+ argc = parse_and_validate_options(argc, argv, builtin_commit_usage, prefix);
index_file = prepare_index(argc, argv, prefix);
diff --git a/builtin-tag.c b/builtin-tag.c
index 325b1b2632e44121c23bc6df556bf3aa4e32ba04..f2853d08c77368b37b40c7ea51f5a124208d385f 100644 (file)
--- a/builtin-tag.c
+++ b/builtin-tag.c
int annotate = 0, sign = 0, force = 0, lines = 0,
list = 0, delete = 0, verify = 0;
- char *msgfile = NULL, *keyid = NULL;
+ const char *msgfile = NULL, *keyid = NULL;
struct msg_arg msg = { 0, STRBUF_INIT };
struct option options[] = {
OPT_BOOLEAN('l', NULL, &list, "list tag names"),
git_config(git_tag_config, NULL);
argc = parse_options(argc, argv, options, git_tag_usage, 0);
+ msgfile = parse_options_fix_filename(prefix, msgfile);
if (keyid) {
sign = 1;
diff --git a/parse-options.c b/parse-options.c
index 71a7acf4e22bd12c0919f277410d6ec52dd5efc8..fd08bb425c241a0861588ec0aedd15041095a95f 100644 (file)
--- a/parse-options.c
+++ b/parse-options.c
*(unsigned long *)(opt->value) = approxidate(arg);
return 0;
}
+
+/*
+ * This should really be OPTION_FILENAME type as a part of
+ * parse_options that take prefix to do this while parsing.
+ */
+extern const char *parse_options_fix_filename(const char *prefix, const char *file)
+{
+ if (!file || !prefix || is_absolute_path(file) || !strcmp("-", file))
+ return file;
+ return prefix_filename(prefix, strlen(prefix), file);
+}
+
diff --git a/parse-options.h b/parse-options.h
index bc317e7512af7a1cc86641a651ae5415d28e71c4..5199950c006df4625355ce227970cc3e8a72ed41 100644 (file)
--- a/parse-options.h
+++ b/parse-options.h
"use <n> digits to display SHA-1s", \
PARSE_OPT_OPTARG, &parse_opt_abbrev_cb, 0 }
+extern const char *parse_options_fix_filename(const char *prefix, const char *file);
+
#endif
diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index bc7ce2cbbb712f890245688da03be96146a1d9ed..8d44c2ed1f5148cbfc7affe155eaa4b6bd04c66a 100755 (executable)
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
test_cmp expect actual
'
+test_expect_success 'filename for the message is relative to cwd' '
+ mkdir subdir &&
+ echo "Tag message in top directory" >msgfile-5 &&
+ echo "Tag message in sub directory" >subdir/msgfile-5 &&
+ (
+ cd subdir &&
+ git tag -a -F msgfile-5 tag-from-subdir
+ ) &&
+ git cat-file tag tag-from-subdir | grep "in sub directory"
+'
+
+test_expect_success 'filename for the message is relative to cwd' '
+ echo "Tag message in sub directory" >subdir/msgfile-6 &&
+ (
+ cd subdir &&
+ git tag -a -F msgfile-6 tag-from-subdir-2
+ ) &&
+ git cat-file tag tag-from-subdir-2 | grep "in sub directory"
+'
+
test_done
diff --git a/t/t7500-commit.sh b/t/t7500-commit.sh
index d89f91a6fb7fa12d41cc4a346829bff7cbd3e76b..809bdba6309c57f149b6c7f3dc3f4e147f9eb24b 100755 (executable)
--- a/t/t7500-commit.sh
+++ b/t/t7500-commit.sh
diff expect output
'
+test_expect_success 'commit message from file (1)' '
+ mkdir subdir &&
+ echo "Log in top directory" >log &&
+ echo "Log in sub directory" >subdir/log &&
+ (
+ cd subdir &&
+ git commit --allow-empty -F log
+ ) &&
+ commit_msg_is "Log in sub directory"
+'
+
+test_expect_success 'commit message from file (2)' '
+ rm -f log &&
+ echo "Log in sub directory" >subdir/log &&
+ (
+ cd subdir &&
+ git commit --allow-empty -F log
+ ) &&
+ commit_msg_is "Log in sub directory"
+'
+
+test_expect_success 'commit message from stdin' '
+ (
+ cd subdir &&
+ echo "Log with foo word" | git commit --allow-empty -F -
+ ) &&
+ commit_msg_is "Log with foo word"
+'
+
test_done