aboutsummaryrefslogtreecommitdiff
path: root/revision.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-03-24 16:26:43 -0700
committerJunio C Hamano <gitster@pobox.com>2010-03-24 16:26:43 -0700
commita86ed83cce0fc0b9a9fe4e17ac1bf4f719028d20 (patch)
treeb601185c28e5ea4f4a624debe01427465147650c /revision.c
parentb6a7a06aa6f083f21b0fca2558c737324eda1602 (diff)
parent66d681998411e8e5034080d5267a5e0f6cdc0c17 (diff)
downloadgit-a86ed83cce0fc0b9a9fe4e17ac1bf4f719028d20.tar.gz
git-a86ed83cce0fc0b9a9fe4e17ac1bf4f719028d20.tar.xz
Merge branch 'tr/notes-display'
* tr/notes-display: git-notes(1): add a section about the meaning of history notes: track whether notes_trees were changed at all notes: add shorthand --ref to override GIT_NOTES_REF commit --amend: copy notes to the new commit rebase: support automatic notes copying notes: implement helpers needed for note copying during rewrite notes: implement 'git notes copy --stdin' rebase -i: invoke post-rewrite hook rebase: invoke post-rewrite hook commit --amend: invoke post-rewrite hook Documentation: document post-rewrite hook Support showing notes from more than one notes tree test-lib: unset GIT_NOTES_REF to stop it from influencing tests Conflicts: git-am.sh refs.c
Diffstat (limited to 'revision.c')
-rw-r--r--revision.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/revision.c b/revision.c
index 0471cd3f7..f4b8b3831 100644
--- a/revision.c
+++ b/revision.c
@@ -12,6 +12,7 @@
#include "patch-ids.h"
#include "decorate.h"
#include "log-tree.h"
+#include "string-list.h"
volatile show_early_output_fn_t show_early_output;
@@ -1191,9 +1192,29 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
} else if (!strcmp(arg, "--show-notes")) {
revs->show_notes = 1;
revs->show_notes_given = 1;
+ } else if (!prefixcmp(arg, "--show-notes=")) {
+ struct strbuf buf = STRBUF_INIT;
+ revs->show_notes = 1;
+ revs->show_notes_given = 1;
+ if (!revs->notes_opt.extra_notes_refs)
+ revs->notes_opt.extra_notes_refs = xcalloc(1, sizeof(struct string_list));
+ if (!prefixcmp(arg+13, "refs/"))
+ /* happy */;
+ else if (!prefixcmp(arg+13, "notes/"))
+ strbuf_addstr(&buf, "refs/");
+ else
+ strbuf_addstr(&buf, "refs/notes/");
+ strbuf_addstr(&buf, arg+13);
+ string_list_append(strbuf_detach(&buf, NULL),
+ revs->notes_opt.extra_notes_refs);
} else if (!strcmp(arg, "--no-notes")) {
revs->show_notes = 0;
revs->show_notes_given = 1;
+ } else if (!strcmp(arg, "--standard-notes")) {
+ revs->show_notes_given = 1;
+ revs->notes_opt.suppress_default_notes = 0;
+ } else if (!strcmp(arg, "--no-standard-notes")) {
+ revs->notes_opt.suppress_default_notes = 1;
} else if (!strcmp(arg, "--oneline")) {
revs->verbose_header = 1;
get_commit_format("oneline", revs);