[PATCH v6 03/13] Documentation: document post-rewrite hook

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Thomas Rast
Date: Wednesday, March 10, 2010 - 7:03 am

This defines the behaviour of the post-rewrite hook support, which
will be implemented in the following patches.

We deliberately do not document how often the hook will be invoked per
rewriting command, but the interface is designed to keep that at
"once".  This would currently not matter too much, since both rebase
and filter-branch are shellscripts and spawn many processes anyway.
However, when a fast sequencer in C is implemented, it will be
beneficial to only have to run the hook once.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
---


 Documentation/githooks.txt |   34 ++++++++++++++++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/Documentation/githooks.txt b/Documentation/githooks.txt
index 87e2c03..a741769 100644
--- a/Documentation/githooks.txt
+++ b/Documentation/githooks.txt
@@ -317,6 +317,40 @@ This hook is invoked by 'git gc --auto'. It takes no parameter, and
 exiting with non-zero status from this script causes the 'git gc --auto'
 to abort.
 
+post-rewrite
+~~~~~~~~~~~~
+
+This hook is invoked by commands that rewrite commits (`git commit
+--amend`, 'git-rebase'; currently 'git-filter-branch' does 'not' call
+it!).  Its first argument denotes the command it was invoked by:
+currently one of `amend` or `rebase`.  Further command-dependent
+arguments may be passed in the future.
+
+The hook receives a list of the rewritten commits on stdin, in the
+format
+
+  <old-sha1> SP <new-sha1> [ SP <extra-info> ] LF
+
+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 following command-specific comments apply:
+
+rebase::
+	For the 'squash' and 'fixup' operation, all commits that were
+	squashed are listed as being rewritten to the squashed commit.
+	This means that there will be several lines sharing the same
+	'new-sha1'.
++
+The commits are guaranteed to be listed in the order that they were
+processed by rebase.
+
+There is no default 'post-rewrite' hook, but see the
+`post-receive-copy-notes` script in `contrib/hooks` for an example
+that copies your git-notes to the rewritten commits.
+
+
 GIT
 ---
 Part of the linkgit:git[1] suite
-- 
1.7.0.2.407.g21ebda

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC PATCH 0/6] post-rewrite hook and copying notes, Thomas Rast, (Sun Feb 14, 9:17 am)
[RFC PATCH 4/6] rebase: invoke post-rewrite hook, Thomas Rast, (Sun Feb 14, 9:17 am)
[RFC PATCH 5/6] rebase -i: invoke post-rewrite hook, Thomas Rast, (Sun Feb 14, 9:17 am)
[PATCH] WIP: git notes copy --stdin, Thomas Rast, (Sun Feb 14, 2:46 pm)
Re: [PATCH] WIP: git notes copy --stdin, Johan Herland, (Sun Feb 14, 6:25 pm)
[RFC PATCH v2 03/11] rebase: invoke post-rewrite hook, Thomas Rast, (Tue Feb 16, 4:25 pm)
[RFC PATCH v2 05/11] notes: clean up t3301, Thomas Rast, (Tue Feb 16, 4:26 pm)
Re: [RFC PATCH v2 05/11] notes: clean up t3301, Junio C Hamano, (Tue Feb 16, 4:52 pm)
[RFC PATCH v3 04/12] rebase: invoke post-rewrite hook, Thomas Rast, (Sat Feb 20, 3:16 pm)
[PATCH v4 05/11] rebase: invoke post-rewrite hook, Thomas Rast, (Sun Feb 21, 5:10 pm)
[PATCH v4 06/11] rebase -i: invoke post-rewrite hook, Thomas Rast, (Sun Feb 21, 5:10 pm)
[PATCH v5 05/11] rebase: invoke post-rewrite hook, Thomas Rast, (Mon Feb 22, 5:42 pm)
[PATCH v5 06/11] rebase -i: invoke post-rewrite hook, Thomas Rast, (Mon Feb 22, 5:42 pm)
Re: [PATCH v5 06/11] rebase -i: invoke post-rewrite hook, Junio C Hamano, (Tue Feb 23, 11:15 pm)
[PATCH v6 03/13] Documentation: document post-rewrite hook, Thomas Rast, (Wed Mar 10, 7:03 am)
[PATCH v6 05/13] rebase: invoke post-rewrite hook, Thomas Rast, (Wed Mar 10, 7:05 am)
[PATCH v6 06/13] rebase -i: invoke post-rewrite hook, Thomas Rast, (Wed Mar 10, 7:05 am)
[PATCH v7 00/13] tr/display-notes, Thomas Rast, (Fri Mar 12, 10:04 am)
[PATCH v7 06/13] rebase -i: invoke post-rewrite hook, Thomas Rast, (Fri Mar 12, 10:04 am)