Subject: Re: Help creating git alias

From: Junio C Hamano <[email-masked]>
Date: Wed, 30 Oct 2013 14:02:00 -0700

Eugene Sajine <[email-masked]> writes:

> On Wed, Oct 30, 2013 at 3:57 PM, Ralf Thielow <[email-masked]> wrote:
>> lg=!git log --pretty=format:'%h %ad %ae %s' --date=short | sed 's/@\\S*//g'
>>
>> should work.
>
>
> It did! thanks! I didn't know that "!sh -c" is not needed

"sh -c" is often used when you pass arguments to your scriptlets,
e.g. to allow

	git lg master..next

you would want

	sh -c 'git log ... "$@" | sed ...' -

so that

	git lg master..next

turns into

	sh -c 'git log ... "$@" | sed ...' - master..next

which makes $1="master..next" and fed to "git log".