Re: Help creating git alias

3 messages, 3 authors, 2016-06-15 · open the first message on its own page

Re: Help creating git alias

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:59:09

David Aguilar [off-list ref] 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?

Re: Help creating git alias

From: David Aguilar <hidden>
Date: 2016-06-15 22:59:09

On Thu, Oct 31, 2013 at 11:07:19AM -0700, Junio C Hamano wrote:
David Aguilar [off-list ref] writes:
quoted
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_PREFIX:-.} && git log \"$@\""

should do the trick.
-- 
David

Re: Help creating git alias

From: Eugene Sajine <hidden>
Date: 2016-06-15 22:59:09

On Thu, Oct 31, 2013 at 2:15 PM, David Aguilar [off-list ref] wrote:
On Thu, Oct 31, 2013 at 11:07:19AM -0700, Junio C Hamano wrote:
quoted
David Aguilar [off-list ref] writes:
quoted
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_PREFIX:-.} && git log \"$@\""

should do the trick.
--
David

Awesome! It does work!
One note: i tried the ${GIT_PREFIX:-.}  and ${GIT_PREFIX} and it seems
to give the same results. What is the expected difference here?

Thank you!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help