* [PATCH 2/3] Only show log entries for new revisions in hooks--update
@ 2007-02-13 14:24 Andy Parkins
2007-02-13 17:41 ` Junio C Hamano
0 siblings, 1 reply; 3+ messages in thread
From: Andy Parkins @ 2007-02-13 14:24 UTC (permalink / raw)
To: git
If you were issuing emails for two branches, and one merged the other,
you would get the same log messages appearing in two separate emails.
e.g. A working repository, where the last push to central was done at
the revision marked "B", after which two branches were developed
further.
* -- B -- 1 -- 1 -- M (branch1)
\ /
2 -- 2 -- 2 (branch2)
Now imagine that branch2 is pushed to the email-generating repository;
an email containing all the "2" revisions would be sent. Now, let's say
branch1 is pushed, the old update hook would run
git-rev-list $newrev ^$baserev
Where $newrev would be "M" and $baserev would be "B". This list
includes all the "2" revisions as well as all the "1" revisions.
This patch addresses this problem by using
git-rev-parse --not --all | git-rev-list --stdin $newrev ^$baserev
To inhibit the display of all revisions that are already in the
repository.
Signed-off-by: Andy Parkins <andyparkins@gmail.com>
---
templates/hooks--update | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/templates/hooks--update b/templates/hooks--update
index e8c536f..7e8258a 100644
--- a/templates/hooks--update
+++ b/templates/hooks--update
@@ -190,7 +190,7 @@ case "$refname_type" in
fi
echo ""
echo $LOGBEGIN
- git-rev-list --pretty $newrev ^$baserev
+ git-rev-parse --not --all | git-rev-list --stdin --pretty $newrev ^$baserev
echo $LOGEND
echo ""
echo "Diffstat:"
--
1.5.0.rc4.364.g85b1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 2/3] Only show log entries for new revisions in hooks--update
2007-02-13 14:24 [PATCH 2/3] Only show log entries for new revisions in hooks--update Andy Parkins
@ 2007-02-13 17:41 ` Junio C Hamano
2007-02-13 18:08 ` Andy Parkins
0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2007-02-13 17:41 UTC (permalink / raw)
To: Andy Parkins; +Cc: git
I seem to recall that something like this was discussed recently
on the list.
While excluding commits on already updated branches works if the
same set of recipients receive e-mails for both branches by
eliminating the duplicates, I suspect that in more elaborate
settings people would want to do different notices for different
branches, and for that kind of usage people who subscribes only
to branch1 in your picture would miss what happened on branch2.
Or maybe branch1 is the main integration branch (e.g. 'master',
'next') while branch2 is a tentative topic that does not send
out notification e-mails.
If we want to take this example hook seriously, I suspect that
the existing mechanism based on hooks.* variables might need to
be made to allow finer grained, per-branch, control. I dunno.
Post 1.5.0.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 2/3] Only show log entries for new revisions in hooks--update
2007-02-13 17:41 ` Junio C Hamano
@ 2007-02-13 18:08 ` Andy Parkins
0 siblings, 0 replies; 3+ messages in thread
From: Andy Parkins @ 2007-02-13 18:08 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano
On Tuesday 2007, February 13, Junio C Hamano wrote:
> If we want to take this example hook seriously, I suspect that
> the existing mechanism based on hooks.* variables might need to
> be made to allow finer grained, per-branch, control. I dunno.
>
> Post 1.5.0.
Absolutely - per-branch sounds great. However, as that is definitely a
post-1.5.0 topic, I wanted to get the hook that was there in better
shape for the release.
Until the per-branch work is done, I think this patch is worth having.
Andy
--
Dr Andrew Parkins, M Eng (Hons), AMIEE
andyparkins@gmail.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-02-13 18:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-13 14:24 [PATCH 2/3] Only show log entries for new revisions in hooks--update Andy Parkins
2007-02-13 17:41 ` Junio C Hamano
2007-02-13 18:08 ` Andy Parkins
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).