aboutsummaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorThomas Rast <trast@student.ethz.ch>2010-03-12 18:04:32 +0100
committerJunio C Hamano <gitster@pobox.com>2010-03-12 21:55:39 -0800
commit6956f858f6237d426fa422949033e3c558104802 (patch)
tree3b01ce43e51c2cd319db79446568116bbc2a8630 /Documentation
parent160baa0d9cbdfcdb6251aa5ede77c59c0d53edfd (diff)
downloadgit-6956f858f6237d426fa422949033e3c558104802.tar.gz
git-6956f858f6237d426fa422949033e3c558104802.tar.xz
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=<cmd> option to 'git notes copy' which is used like --stdin, but also puts the configuration for <cmd> into effect. It will be needed to support the copying in git-rebase. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Acked-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/config.txt30
-rw-r--r--Documentation/git-notes.txt4
-rw-r--r--Documentation/githooks.txt4
3 files changed, 38 insertions, 0 deletions
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 503942a2e..2e02f1b07 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -1305,6 +1305,36 @@ The effective value of "core.notesRef" (possibly overridden by
GIT_NOTES_REF) is also implicitly added to the list of refs to be
displayed.
+notes.rewrite.<command>::
+ When rewriting commits with <command> (currently `amend` or
+ `rebase`) and this variable is set to `true`, git
+ automatically copies your notes from the original to the
+ rewritten commit. Defaults to `true`, but see
+ "notes.rewriteRef" below.
++
+This setting can be overridden with the `GIT_NOTES_REWRITE_REF`
+environment variable, which must be a colon separated list of refs or
+globs.
+
+notes.rewriteMode::
+ When copying notes during a rewrite (see the
+ "notes.rewrite.<command>" option), determines what to do if
+ the target commit already has a note. Must be one of
+ `overwrite`, `concatenate`, or `ignore`. Defaults to
+ `concatenate`.
++
+This setting can be overridden with the `GIT_NOTES_REWRITE_MODE`
+environment variable.
+
+notes.rewriteRef::
+ When copying notes during a rewrite, specifies the (fully
+ qualified) ref whose notes should be copied. The ref may be a
+ glob, in which case notes in all matching refs will be copied.
+ You may also specify this configuration several times.
++
+Does not have a default value; you must configure this variable to
+enable note rewriting.
+
pack.window::
The size of the window used by linkgit:git-pack-objects[1] when no
window size is given on the command line. Defaults to 10.
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.<command>" in
+linkgit:git-config[1] for a way of carrying your notes across commands
+that rewrite commits.
+
SUBCOMMANDS
-----------
diff --git a/Documentation/githooks.txt b/Documentation/githooks.txt
index a74176974..7183aa9ab 100644
--- a/Documentation/githooks.txt
+++ b/Documentation/githooks.txt
@@ -335,6 +335,10 @@ The 'extra-info' is again command-dependent. If it is empty, the
preceding SP is also omitted. Currently, no commands pass any
'extra-info'.
+The hook always runs after the automatic note copying (see
+"notes.rewrite.<command>" in linkgit:git-config.txt) has happened, and
+thus has access to these notes.
+
The following command-specific comments apply:
rebase::