Re: Help creating git alias

2013-10-31 Thread Eugene Sajine
On Thu, Oct 31, 2013 at 3:41 PM, Junio C Hamano wrote: > Eugene Sajine writes: > >> One note: i tried the ${GIT_PREFIX:-.} and ${GIT_PREFIX} and it seems >> to give the same results. What is the expected difference here? > > GIT_PREFIX may be an empty string when you run from the top-level, > in

Re: Help creating git alias

2013-10-31 Thread Junio C Hamano
Eugene Sajine writes: > One note: i tried the ${GIT_PREFIX:-.} and ${GIT_PREFIX} and it seems > to give the same results. What is the expected difference here? GIT_PREFIX may be an empty string when you run from the top-level, in which case you would end up with "cd && ..." and end up working i

Re: Help creating git alias

2013-10-31 Thread Eugene Sajine
On Thu, Oct 31, 2013 at 2:15 PM, David Aguilar wrote: > On Thu, Oct 31, 2013 at 11:07:19AM -0700, Junio C Hamano wrote: >> David Aguilar writes: >> >> > A-ha.. I think adding the chdir to alias is possible using a function. >> >> You do not have to use a function to do so, no? > > Right, of cours

Re: Help creating git alias

2013-10-31 Thread David Aguilar
On Thu, Oct 31, 2013 at 11:07:19AM -0700, Junio C Hamano wrote: > David Aguilar writes: > > > A-ha.. I think adding the chdir to alias is possible using a function. > > You do not have to use a function to do so, no? Right, of course. So something like: [alias] example = "!cd ${GIT_PR

Re: Help creating git alias

2013-10-31 Thread Junio C Hamano
David Aguilar writes: > A-ha.. I think adding the chdir to alias is possible using a function. You do not have to use a function to do so, no? -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vg

Re: Help creating git alias

2013-10-31 Thread David Aguilar
On Thu, Oct 31, 2013 at 11:36:59AM -0400, Eugene Sajine wrote: > On Wed, Oct 30, 2013 at 11:54 PM, Junio C Hamano wrote: > > Eugene Sajine writes: > > > >> That was my initial intention, because I would like to be able to pass > >> parameters like to git log or git blame correctly without the exp

Re: Help creating git alias

2013-10-31 Thread Eugene Sajine
On Wed, Oct 30, 2013 at 11:54 PM, Junio C Hamano wrote: > Eugene Sajine writes: > >> That was my initial intention, because I would like to be able to pass >> parameters like to git log or git blame correctly without the explicit >> use of $1. Could you please advise about how to make it work wit

Re: Help creating git alias

2013-10-30 Thread Junio C Hamano
Eugene Sajine writes: > That was my initial intention, because I would like to be able to pass > parameters like to git log or git blame correctly without the explicit > use of $1. Could you please advise about how to make it work with the > !sh -c ? > > Because the same exact (sed 's/@\\S*//') s

Re: Help creating git alias

2013-10-30 Thread Eugene Sajine
On Wed, Oct 30, 2013 at 5:02 PM, Junio C Hamano wrote: > Eugene Sajine writes: > >> On Wed, Oct 30, 2013 at 3:57 PM, Ralf Thielow 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 no

Re: Help creating git alias

2013-10-30 Thread Junio C Hamano
Eugene Sajine writes: > On Wed, Oct 30, 2013 at 3:57 PM, Ralf Thielow 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 sc

Re: Help creating git alias

2013-10-30 Thread Eugene Sajine
On Wed, Oct 30, 2013 at 3:57 PM, Ralf Thielow 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 > > On Wed, Oct 30, 2013 at 8:34 PM, Eugene Sajine wrote: >> Hi, >> >> I need some advic

Re: Help creating git alias

2013-10-30 Thread Ralf Thielow
lg=!git log --pretty=format:'%h %ad %ae %s' --date=short | sed 's/@\\S*//g' should work. On Wed, Oct 30, 2013 at 8:34 PM, Eugene Sajine wrote: > Hi, > > I need some advice about creating the git command alias: > > I have this as the command: > > git log --pretty=format:"%h %ad %ae %s" --date=sho

Re: Help creating git alias

2013-10-30 Thread Eugene Sajine
On Wed, Oct 30, 2013 at 3:47 PM, Andrew Ardill wrote: > Have you tried backslash escaping the backslash? double escaping? > > I don't know how many are required, but I would try first \S, then > \\S, then S, etc > Regards, > > Andrew Ardill When i do that it stops understanding \S* as regexp

Re: Help creating git alias

2013-10-30 Thread Andrew Ardill
Have you tried backslash escaping the backslash? double escaping? I don't know how many are required, but I would try first \S, then \\S, then S, etc Regards, Andrew Ardill On 30 October 2013 12:34, Eugene Sajine wrote: > Hi, > > I need some advice about creating the git command alias: > >

Help creating git alias

2013-10-30 Thread Eugene Sajine
Hi, I need some advice about creating the git command alias: I have this as the command: git log --pretty=format:"%h %ad %ae %s" --date=short | sed 's/@\S*//g' The purpose is to cut off the email domain and keep only username. I'm trying to create this as the alias: lg = !sh -c 'git log --p