mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tom Rini <trini@kernel.crashing.org>
To: James Cloos <cloos@jhcloos.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: from line script for git commits
Date: Thu, 5 May 2005 16:21:39 -0700	[thread overview]
Message-ID: <20050505232139.GD1221@smtp.west.cox.net> (raw)
In-Reply-To: <m3ekd326y1.fsf@lugabout.cloos.reno.nv.us>

On Thu, Apr 21, 2005 at 04:47:18PM -0400, James Cloos wrote:

> I've been using a script grabbed from here for some time to alter
> the From: line on mail sent to bk-head-commits and bk-24-commits
> to show the author's name and email rather than LKML's address.
> 
> Below is my script for doing the same with git commit emails.

Ages ago I grabbed a different one for fixing up BK.  Here's what I've
got now that fixes up both (and munges the date on git, which may or may
not turn out to be useful).

#!/bin/sh

TMP=`mktemp /tmp/setfrom.XXXXXX`
cat > $TMP

## Old BitKeeper logic
from=`grep '^ChangeSet' $TMP | head -1 | awk '{print $NF}'`

## New git logic
author=`sed -n '/^author /p' < $TMP | head -n 1`
if [ ! -z "$author" ]; then
  from=`echo $author | sed 's/author \(.*>\).*/\1/'`
  date=`echo $author | sed 's/author.*> //'`
fi
if test -n "$from" -a -n "$date"; then
  formail -I "From: $from" -I "Date: `date -d "$date" -R`" < $TMP
else
  if test -n "$from"; then
    formail -I "From: $from" < $TMP
  else
    cat $TMP
  fi
fi

rm $TMP

-- 
Tom Rini
http://gate.crashing.org/~trini/

      reply	other threads:[~2005-05-05 23:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-21 20:47 James Cloos
2005-05-05 23:21 ` Tom Rini [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050505232139.GD1221@smtp.west.cox.net \
    --to=trini@kernel.crashing.org \
    --cc=cloos@jhcloos.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®