Discussion:
[rancid] Missing Diff Change Summary in 3.2
Matt Almgren
2015-07-23 16:27:54 UTC
Permalink
Hi, in 2.3.8, the notification emails used to have the first few lines showing <what> devices were changed, and <quantity> of lines changed.

But the new 3.2 version seems to have that stripped out – which just means that I have to go through the entire email to see if there’s some device in there that I care about. Truth be told, our load balancers are so dynamic, I usually ignore those emails when I see only those devices have changed. I’m more interested in the network infrastructure that changes.

I’d love to have the code changes that print the first three lines in bold below:

# old
mt-lb03.corp.surveymonkey.com | 71 ++++++++++++++++++++++++++++++++++----
mt-lb04.corp.surveymonkey.com | 77 ++++++++++++++++++++++++++++++++++++------
2 files changed, 129 insertions(+), 19 deletions(-)
Index: configs/mt-lb03.corp.surveymonkey.com
===================================================================

# new
Index: configs/mt-lb03.corp.surveymonkey.com
===================================================================
retrieving revision 1.3
diff -u -4 -r1.3 mt-lb03.corp.surveymonkey.com



Thanks, Matt
Matt Almgren
2015-07-26 01:27:46 UTC
Permalink
Aha, found it. It’s diffstat!

It’s included in 2.3.8, but not in 3.2:

if [ $MAXSZ -eq 0 ] ; then
(
echo "To: $mailrcpt"
echo "Subject: $subject"
echo "$MAILHEADERS" | awk '{L = "";LN = $0;while (LN ~ /\\n/) { I = index(LN,"\\n");L = L substr(LN,0,I-1) "\n";LN = substr(LN,I+2,length(LN)-I-1);}print L LN;}'
echo ""
+ if which diffstat >/dev/null; then
+ diffstat $TMP.diff
+ fi
cat $TMP.diff
) | /usr/sbin/sendmail -t $MAILOPTS
else

I installed diffstat then added the above and seems to work like 2.3.8. :) That was driving me nuts not having that.

— Matt







From: Matt Almgren <***@surveymonkey.com<mailto:***@surveymonkey.com>>
Date: Thursday, July 23, 2015 at 3:48 PM
To: John Heasley <***@shrubbery.net<mailto:***@shrubbery.net>>
Subject: Re: [rancid] Missing Diff Change Summary in 3.2

It’s CVS, not GIT. Would you know how to fix it? :)

I tried to compare the control_rancid files between the two versions to see how we’re calling CVS, but there were too many difference to find out where we call CVS.

Thanks, Matt




From: John Heasley <***@shrubbery.net<mailto:***@shrubbery.net>>
Date: Thursday, July 23, 2015 at 3:45 PM
To: Matt Almgren <***@surveymonkey.com<mailto:***@surveymonkey.com>>
Subject: Re: [rancid] Missing Diff Change Summary in 3.2





Am 23.07.2015 um 18:27 schrieb Matt Almgren <***@surveymonkey.com<mailto:***@surveymonkey.com>>:

Hi, in 2.3.8, the notification emails used to have the first few lines showing <what> devices were changed, and <quantity> of lines changed.

But the new 3.2 version seems to have that stripped out – which just means that I have to go through the entire email to see if there’s some device in there that I care about. Truth be told, our load balancers are so dynamic, I usually ignore those emails when I see only those devices have changed. I’m more interested in the network infrastructure that changes.

Thats not from rancid, its from git. So you changed something or git did.


I’d love to have the code changes that print the first three lines in bold below:

# old
mt-lb03.corp.surveymonkey.com<http://mt-lb03.corp.surveymonkey.com> | 71 ++++++++++++++++++++++++++++++++++----
mt-lb04.corp.surveymonkey.com<http://mt-lb04.corp.surveymonkey.com> | 77 ++++++++++++++++++++++++++++++++++++------
2 files changed, 129 insertions(+), 19 deletions(-)
Index: configs/mt-lb03.corp.surveymonkey.com<http://mt-lb03.corp.surveymonkey.com>
===================================================================

# new
Index: configs/mt-lb03.corp.surveymonkey.com<http://mt-lb03.corp.surveymonkey.com>
===================================================================
retrieving revision 1.3
diff -u -4 -r1.3 mt-lb03.corp.surveymonkey.com<http://mt-lb03.corp.surveymonkey.com>



Thanks, Matt

Loading...