From 894a9d333e9e2015cad00d95250b7c5d3acea8b6 Mon Sep 17 00:00:00 2001 From: Thomas Rast Date: Fri, 12 Mar 2010 18:04:26 +0100 Subject: Support showing notes from more than one notes tree With this patch, you can set notes.displayRef to a glob that points at your favourite notes refs, e.g., [notes] displayRef = refs/notes/* Then git-log and friends will show notes from all trees. Thanks to Junio C Hamano for lots of feedback, which greatly influenced the design of the entire series and this commit in particular. Signed-off-by: Thomas Rast Acked-by: Johan Herland Signed-off-by: Junio C Hamano --- Documentation/git-notes.txt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'Documentation/git-notes.txt') diff --git a/Documentation/git-notes.txt b/Documentation/git-notes.txt index 14f73b988..7abd0fbd2 100644 --- a/Documentation/git-notes.txt +++ b/Documentation/git-notes.txt @@ -27,12 +27,13 @@ A typical use of notes is to extend a commit message without having to change the commit itself. Such commit notes can be shown by `git log` along with the original commit message. To discern these notes from the message stored in the commit object, the notes are indented like the -message, after an unindented line saying "Notes:". +message, after an unindented line saying "Notes ():" (or +"Notes:" for the default setting). -To disable notes, you have to set the config variable core.notesRef to -the empty string. Alternatively, you can set it to a different ref, -something like "refs/notes/bugzilla". This setting can be overridden -by the environment variable "GIT_NOTES_REF". +This command always manipulates the notes specified in "core.notesRef" +(see linkgit:git-config[1]), which can be overridden by GIT_NOTES_REF. +To change which notes are shown by 'git-log', see the +"notes.displayRef" configuration. SUBCOMMANDS -- cgit v1.2.1 From 160baa0d9cbdfcdb6251aa5ede77c59c0d53edfd Mon Sep 17 00:00:00 2001 From: Thomas Rast Date: Fri, 12 Mar 2010 18:04:31 +0100 Subject: notes: implement 'git notes copy --stdin' This implements a mass-copy command that takes a sequence of lines in the format SP [ SP ] LF on stdin, and copies each 's notes to the . The is ignored. The intent, of course, is that this can read the same input that the 'post-rewrite' hook gets. The copy_note() function is exposed for everyone's and in particular the next commit's use. Signed-off-by: Thomas Rast Acked-by: Johan Herland Signed-off-by: Junio C Hamano --- Documentation/git-notes.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'Documentation/git-notes.txt') diff --git a/Documentation/git-notes.txt b/Documentation/git-notes.txt index 7abd0fbd2..6ab3f982b 100644 --- a/Documentation/git-notes.txt +++ b/Documentation/git-notes.txt @@ -10,7 +10,7 @@ SYNOPSIS [verse] 'git notes' [list []] 'git notes' add [-f] [-F | -m | (-c | -C) ] [] -'git notes' copy [-f] +'git notes' copy [-f] ( --stdin | ) 'git notes' append [-F | -m | (-c | -C) ] [] 'git notes' edit [] 'git notes' show [] @@ -56,6 +56,16 @@ copy:: objects has none. (use -f to overwrite existing notes to the second object). This subcommand is equivalent to: `git notes add [-f] -C $(git notes list ) ` ++ +In `\--stdin` mode, take lines in the format ++ +---------- + SP [ SP ] LF +---------- ++ +on standard input, and copy the notes from each to its +corresponding . (The optional `` is ignored so that +the command can read the input given to the `post-rewrite` hook.) append:: Append to the notes of an existing object (defaults to HEAD). -- cgit v1.2.1 From 6956f858f6237d426fa422949033e3c558104802 Mon Sep 17 00:00:00 2001 From: Thomas Rast Date: Fri, 12 Mar 2010 18:04:32 +0100 Subject: notes: implement helpers needed for note copying during rewrite Implement helper functions to load the rewriting config, and to actually copy the notes. Also document the config. Secondly, also implement an undocumented --for-rewrite= option to 'git notes copy' which is used like --stdin, but also puts the configuration for into effect. It will be needed to support the copying in git-rebase. Signed-off-by: Thomas Rast Acked-by: Johan Herland Signed-off-by: Junio C Hamano --- Documentation/git-notes.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Documentation/git-notes.txt') diff --git a/Documentation/git-notes.txt b/Documentation/git-notes.txt index 6ab3f982b..b12d1cf53 100644 --- a/Documentation/git-notes.txt +++ b/Documentation/git-notes.txt @@ -35,6 +35,10 @@ This command always manipulates the notes specified in "core.notesRef" To change which notes are shown by 'git-log', see the "notes.displayRef" configuration. +See the description of "notes.rewrite." in +linkgit:git-config[1] for a way of carrying your notes across commands +that rewrite commits. + SUBCOMMANDS ----------- -- cgit v1.2.1 From dcf783a26110ab99f2052e378ee76c3542a4b9e9 Mon Sep 17 00:00:00 2001 From: Thomas Rast Date: Fri, 12 Mar 2010 18:04:35 +0100 Subject: notes: add shorthand --ref to override GIT_NOTES_REF Adds a shorthand option that overrides the GIT_NOTES_REF variable, and hence determines the notes tree that will be manipulated. It also DWIMs a refs/notes/ prefix. Signed-off-by: Thomas Rast Acked-by: Johan Herland Signed-off-by: Junio C Hamano --- Documentation/git-notes.txt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Documentation/git-notes.txt') diff --git a/Documentation/git-notes.txt b/Documentation/git-notes.txt index b12d1cf53..dbfa1e88e 100644 --- a/Documentation/git-notes.txt +++ b/Documentation/git-notes.txt @@ -116,6 +116,11 @@ OPTIONS Like '-C', but with '-c' the editor is invoked, so that the user can further edit the note message. +--ref :: + Manipulate the notes tree in . This overrides both + GIT_NOTES_REF and the "core.notesRef" configuration. The ref + is taken to be in `refs/notes/` if it is not qualified. + Author ------ Written by Johannes Schindelin and -- cgit v1.2.1 From 66d681998411e8e5034080d5267a5e0f6cdc0c17 Mon Sep 17 00:00:00 2001 From: Thomas Rast Date: Fri, 12 Mar 2010 18:04:37 +0100 Subject: git-notes(1): add a section about the meaning of history To the displaying code, the only interesting thing about a notes ref is that it has a tree of the required format. However, notes actually have a history since they are recorded as successive commits. Make a note about the existence of this history in the manpage, but keep some doors open if we want to change the details. Signed-off-by: Thomas Rast Acked-by: Johan Herland Signed-off-by: Junio C Hamano --- Documentation/git-notes.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Documentation/git-notes.txt') diff --git a/Documentation/git-notes.txt b/Documentation/git-notes.txt index dbfa1e88e..e2701cff1 100644 --- a/Documentation/git-notes.txt +++ b/Documentation/git-notes.txt @@ -121,6 +121,20 @@ OPTIONS GIT_NOTES_REF and the "core.notesRef" configuration. The ref is taken to be in `refs/notes/` if it is not qualified. + +NOTES +----- + +Every notes change creates a new commit at the specified notes ref. +You can therefore inspect the history of the notes by invoking, e.g., +`git log -p notes/commits`. + +Currently the commit message only records which operation triggered +the update, and the commit authorship is determined according to the +usual rules (see linkgit:git-commit[1]). These details may change in +the future. + + Author ------ Written by Johannes Schindelin and -- cgit v1.2.1