Subject: Re: "git intepret-trailers" vs. "sed script" to add the signature

From: Kaartic Sivaraam <[email-masked]>
Date: Wed, 05 Jul 2017 00:46:44 +0530

On Mon, 2017-07-03 at 09:58 -0700, Junio C Hamano wrote:
> Kaartic Sivaraam <[email-masked]> writes:
> 
> > So, it seems that excepting for 'commit' it has quite a nice
> > spacing. I
> > guess we could add something like the following to fix that,
> > 
> >     # Add new line after SOB in case of "git commit"
> >     NEW_LINE='\
> >     '
> >     if [ -z "$2" ]
> >     then
> >       sed -i "1i$NEW_LINE" "$1"
> >     fi
> 
> Isn't "sed -i" GNUism that is not portable?
> 
It does seem to be the case. Then the alternative would be the
following,

    if [ -z "$2" ]
    then
      sed -e "1i$NEW_LINE" "$1" >"sed-output.temp"
      mv "sed-output.temp" "$1"
    fi

Actually the GNU's sed documentation tricked me into believing '-i'
wasn't a GNU extension. The '-i' option works with the '--posix' option
of GNU sed which made me believe it isn't an extension.

> > I'll send a typical patch that uses "git interpret-headers" as a
> > follow-up.
> 
> When you say a "typical" patch, what do you exactly mean?  Does
> anybody else send typical patches (or atypical ones for that matter)
> to the list?
> 
I apologise for the inconsistent wordings. I try to mean a patch which
I'm not sure is acceptable (or) not. I guess that's [PATCH/RFC] in the
language of this list. I'm not acquainted to the wordings as I'm an
"off-list" person trying to help and get help! I'll try to use
consistent wordings as far as I could. Once again, please excuse my
ignorance.

-- 
Kaartic