summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2347fae)
raw | patch | inline | side by side (parent: 2347fae)
author | Johan Herland <johan@herland.net> | |
Sat, 13 Feb 2010 21:28:34 +0000 (22:28 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 14 Feb 2010 03:36:16 +0000 (19:36 -0800) |
The semantics for "git notes edit -m/-F" overlap with those for
"git notes add -f", and the behaviour (i.e. overwriting existing
notes with the given message/file) is more intuitively captured
by (and better documented with) "git notes add -f".
Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
"git notes add -f", and the behaviour (i.e. overwriting existing
notes with the given message/file) is more intuitively captured
by (and better documented with) "git notes add -f".
Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
index 35dd8fa8a0842424415c3f9f6c439dfe12cb9ee8..53c5d9014dfca7cf3650e7091abf51f0c441dee9 100644 (file)
'git notes' [list [<object>]]
'git notes' add [-f] [-F <file> | -m <msg>] [<object>]
'git notes' append [-F <file> | -m <msg>] [<object>]
-'git notes' edit [-F <file> | -m <msg>] [<object>]
+'git notes' edit [<object>]
'git notes' show [<object>]
'git notes' remove [<object>]
'git notes' prune
diff --git a/builtin-notes.c b/builtin-notes.c
index c88df00b3adb7165a49dbe35048b4447d84bf0ae..572b47746bcb3f98528417595988229e72fccbc4 100644 (file)
--- a/builtin-notes.c
+++ b/builtin-notes.c
"git notes [list [<object>]]",
"git notes add [-f] [-m <msg> | -F <file>] [<object>]",
"git notes append [-m <msg> | -F <file>] [<object>]",
- "git notes edit [-m <msg> | -F <file>] [<object>]",
+ "git notes edit [<object>]",
"git notes show [<object>]",
"git notes remove [<object>]",
"git notes prune",
const char *msgfile = NULL;
struct msg_arg msg = { 0, STRBUF_INIT };
struct option options[] = {
- OPT_GROUP("Notes edit options"),
+ OPT_GROUP("Notes options"),
OPT_CALLBACK('m', "message", &msg, "msg",
"note contents as a string", parse_msg_arg),
OPT_FILENAME('F', "file", &msgfile, "note contents in a file"),
usage_with_options(git_notes_usage, options);
}
+ if ((msg.given || msgfile) && edit) {
+ fprintf(stderr, "The -m and -F options has been deprecated for"
+ " the 'edit' subcommand.\n"
+ "Please use 'git notes add -f -m/-F' instead.\n");
+ }
+
if (msg.given && msgfile) {
error("mixing -m and -F options is not allowed.");
usage_with_options(git_notes_usage, options);
diff --git a/t/t3304-notes-mixed.sh b/t/t3304-notes-mixed.sh
index c975a6d3f72ad8595c7f85dbfe88ba4e23a75759..1709e8c00b859ae4f8ce91c7920a9411ac4acbce 100755 (executable)
--- a/t/t3304-notes-mixed.sh
+++ b/t/t3304-notes-mixed.sh
test_expect_success "git-notes preserves non-notes" '
test_tick &&
- git notes edit -m "foo bar"
+ git notes add -f -m "foo bar"
'
test_expect_success "verify contents of non-notes after git-notes" '
index c6d263b236248c488ddfb3d0e63978896da8b057..b1ea64b2130354b1305e752923595128782bc880 100755 (executable)
--- a/t/t3305-notes-fanout.sh
+++ b/t/t3305-notes-fanout.sh
echo "file for commit #$i" > file &&
git add file &&
git commit -q -m "commit #$i" &&
- git notes edit -m "note #$i" || return 1
+ git notes add -m "note #$i" || return 1
done
'
diff --git a/t/t3306-notes-prune.sh b/t/t3306-notes-prune.sh
index b0adc7e5bd9dc650ea60ee017b5ad4fdc5b6b192..a0ed0353e69dd6dbc96f1a8e3c9251757b4f408f 100755 (executable)
--- a/t/t3306-notes-prune.sh
+++ b/t/t3306-notes-prune.sh
git add file1 &&
test_tick &&
git commit -m 1st &&
- git notes edit -m "Note #1" &&
+ git notes add -m "Note #1" &&
: > file2 &&
git add file2 &&
test_tick &&
git commit -m 2nd &&
- git notes edit -m "Note #2" &&
+ git notes add -m "Note #2" &&
: > file3 &&
git add file3 &&
test_tick &&
git commit -m 3rd &&
- git notes edit -m "Note #3"
+ git notes add -m "Note #3"
'
cat > expect <<END_OF_LOG