Re: Help creating git alias

2013-10-31 Thread Eugene Sajine
On Wed, Oct 30, 2013 at 11:54 PM, Junio C Hamano gits...@pobox.com wrote: Eugene Sajine eugu...@gmail.com 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

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 gits...@pobox.com wrote: Eugene Sajine eugu...@gmail.com writes: That was my initial intention, because I would like to be able to pass parameters like to git log or git blame

Re: Help creating git alias

2013-10-31 Thread Junio C Hamano
David Aguilar dav...@gmail.com 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

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 dav...@gmail.com 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 =

Re: Help creating git alias

2013-10-31 Thread Eugene Sajine
On Thu, Oct 31, 2013 at 2:15 PM, David Aguilar dav...@gmail.com wrote: On Thu, Oct 31, 2013 at 11:07:19AM -0700, Junio C Hamano wrote: David Aguilar dav...@gmail.com 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,

Re: Help creating git alias

2013-10-31 Thread Junio C Hamano
Eugene Sajine eugu...@gmail.com 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

Re: Help creating git alias

2013-10-31 Thread Eugene Sajine
On Thu, Oct 31, 2013 at 3:41 PM, Junio C Hamano gits...@pobox.com wrote: Eugene Sajine eugu...@gmail.com 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

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

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 eugu...@gmail.com wrote: Hi, I need some advice about creating the git

Re: Help creating git alias

2013-10-30 Thread Eugene Sajine
On Wed, Oct 30, 2013 at 3:47 PM, Andrew Ardill andrew.ard...@gmail.com 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

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 eugu...@gmail.com 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

Re: Help creating git alias

2013-10-30 Thread Eugene Sajine
On Wed, Oct 30, 2013 at 3:57 PM, Ralf Thielow ralf.thie...@gmail.com 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 eugu...@gmail.com

Re: Help creating git alias

2013-10-30 Thread Junio C Hamano
Eugene Sajine eugu...@gmail.com writes: On Wed, Oct 30, 2013 at 3:57 PM, Ralf Thielow ralf.thie...@gmail.com 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

Re: Help creating git alias

2013-10-30 Thread Eugene Sajine
On Wed, Oct 30, 2013 at 5:02 PM, Junio C Hamano gits...@pobox.com wrote: Eugene Sajine eugu...@gmail.com writes: On Wed, Oct 30, 2013 at 3:57 PM, Ralf Thielow ralf.thie...@gmail.com wrote: lg=!git log --pretty=format:'%h %ad %ae %s' --date=short | sed 's/@\\S*//g' should work. It did!

Re: Help creating git alias

2013-10-30 Thread Junio C Hamano
Eugene Sajine eugu...@gmail.com 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